>>> On 03.07.18 at 22:55, <andrew.coop...@citrix.com> wrote:
> @@ -47,6 +48,17 @@ static inline bool test_bit(unsigned int bit, const void 
> *vaddr)
>      0;                                                  \
>  })
>  
> +/* memcpy(), but with copy_from_guest_offset()'s API */
> +#define copy_from_buffer_offset(dst, src, index, nr) ({ \
> +    const typeof(*(dst)) *s = (src);                    \
> +    unsigned int i;                                     \
> +                                                        \
> +    for ( i = 0; i < (nr); i++ )                        \
> +        (dst)[i] = s[(index) + i];                      \
> +                                                        \
> +    0;                                                  \
> +})

Again the question on whether multiple evaluation of macro arguments
would better be avoided here.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to