On Jun 28, 2006, at 1:10 PM, Hollis Blanchard wrote:
On Wed, 2006-06-28 at 06:34 -0400, Jimi Xenidis wrote:
#define set_xen_guest_handle(hnd, val) \
do { \
if (sizeof ((hnd).__pad)) \
(hnd).__pad = 0; \
(hnd).p = val; \
} while (0)
I like the union better than a struct with carefully-constructed
non-overlapping members.
hmm, really! Ok, then you will have to also fix:
#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; }
while (0)
or the 32bit caller will only get the high-order 32bit into val.
Also, the separate assignment to 0 would be avoided.
In 32 bits the store in of a long long is still 2 stw instructions,
and the conditional will get optimized away so the instruction
sequence is equivalent.
I'll leave it to you.
-JX
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|