# HG changeset patch # User gingold@virtu10 # Node ID 102ff2fdb6db6449ae8402932422039c7b59872e # Parent d42e9a6f537883c707ee5f7dd2a2c980881934c8 Bug fix for field macros. Use _d/_s local variables rather than _x/_y (more readable). Signed-off-by: Tristan Gingold diff -r d42e9a6f5378 -r 102ff2fdb6db xen/include/asm-powerpc/guest_access.h --- a/xen/include/asm-powerpc/guest_access.h Fri Aug 18 15:01:04 2006 -0600 +++ b/xen/include/asm-powerpc/guest_access.h Mon Aug 21 07:45:22 2006 +0200 @@ -16,6 +16,7 @@ * Copyright (C) IBM Corp. 2006 * * Authors: Hollis Blanchard + * Tristan Gingold */ #ifndef __PPC_GUEST_ACCESS_H__ @@ -74,29 +75,29 @@ extern int xencomm_handle_is_null(void * __copy_field_from_guest(ptr, hnd, field) #define __copy_to_guest_offset(hnd, idx, ptr, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ - xencomm_copy_to_guest(_x, _y, sizeof(*_x)*(nr), sizeof(*_x)*(idx)); \ + const typeof(ptr) _d = (hnd).p; \ + const typeof(ptr) _s = (ptr); \ + xencomm_copy_to_guest(_d, _s, sizeof(*_s)*(nr), sizeof(*_s)*(idx)); \ }) #define __copy_field_to_guest(hnd, ptr, field) ({ \ - const int _off = offsetof(typeof(*ptr), field); \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ - xencomm_copy_to_guest(_x, _y, sizeof(*_x), sizeof(*_x)*(_off)); \ + const int _off = offsetof(typeof(*ptr), field); \ + const typeof(ptr) _d = (hnd).p; \ + const typeof(&(ptr)->field) _s = &(ptr)->field; \ + xencomm_copy_to_guest(_d, _s, sizeof(*_s), _off); \ }) #define __copy_from_guest_offset(ptr, hnd, idx, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ - xencomm_copy_from_guest(_y, _x, sizeof(*_x)*(nr), sizeof(*_x)*(idx)); \ + const typeof(ptr) _s = (hnd).p; \ + const typeof(ptr) _d = (ptr); \ + xencomm_copy_from_guest(_d, _s, sizeof(*_s)*(nr), sizeof(*_s)*(idx)); \ }) #define __copy_field_from_guest(ptr, hnd, field) ({ \ const int _off = offsetof(typeof(*ptr), field); \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ - xencomm_copy_to_guest(_y, _x, sizeof(*_x), sizeof(*_x)*(_off)); \ + const typeof(ptr) _s = (hnd).p; \ + const typeof(&(ptr)->field) _d = &(ptr)->field; \ + xencomm_copy_from_guest(_d, _s, sizeof(*_d), _off); \ }) #endif /* __PPC_GUEST_ACCESS_H__ */