On Aug 21, 2006, at 3:47 AM, Tristan Gingold wrote:
Le Vendredi 18 Août 2006 23:21, Hollis Blanchard a écrit :
On Fri, 2006-08-18 at 18:02 +0200, Tristan Gingold wrote:
[...]
I have also fixed a few bugs in guest_access.h
Do you think you could split those out as a diff to
xen/include/asm-powerpc/guest_access.h, to be applied before we
move it?
Here is the patch.
your patch inlined below, does not do anything other than rename
_x,_y to _d,_s.. am I missing something?
-JX
# 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 <tristan.gingold@xxxxxxxx>
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 <hollisb@xxxxxxxxxx>
+ * Tristan Gingold <tristan.gingold@xxxxxxxx>
*/
#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__ */
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|