|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Re: [RFC PATCH 03/35] Add Xen interface header files
On Tue, 2006-05-09 at 21:01 +0100, Keir Fraser wrote:
> On 9 May 2006, at 20:48, Anthony Liguori wrote:
>
> > Is this strictly true though? The ABI for Power and x86 are not
> > necessarily dependent on each other. One could just as easily define
> > a typedef like:
> >
> > #if defined(__ppc__)
> > typedef uint64_t guest_handle_t;
> > #elif defined(__x86__)
> > typedef unsigned long guest_handle_t;
> > #endif
> >
> > I thought the use of GUEST_HANDLE was to maintain type safety. It
> > certainly helps the issue you point out but it's not strictly
> > necessary.
> >
> > IMHO, this trick makes the code pretty ugly. I'd rather see it
> > disappear in favor of something more akin to the above.
>
> Well, I originally thought it was to allow hiding of machine-address
> scatter-gather lists for PPC (instead of passing virtual addresses). I
> seem to recall that's what Hollis said at the time. Clearly hiding
> something like that does need some macro magic. If it's not for that
> then I'm not at all for keeping it. It is indeed rather fugly.
The scatter/gather lists are still needed, but they are hidden inside
copy_to/from_guest().
If you change "unsigned long *" to an integer-based guest_handle_t, you
will lose type-checking when accessing it, and I believe that's why you
created these macros. I'm not particularly worried about type-checking,
so I'd be happy to see them go, as long as we still have typedefs.
--
Hollis Blanchard
IBM Linux Technology Center
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|