This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [XenPPC] [rfc] [patch] 64-bitize guest handles

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.

Xen-ppc-devel mailing list