WARNING - OLD ARCHIVES

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/
Xen

xen-devel

[Top] [All Lists]

Re: [Xen-devel] Re: [RFC PATCH 03/35] Add Xen interface header files

To: Hollis Blanchard <hollisb@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [RFC PATCH 03/35] Add Xen interface header files
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: 2006年5月09日 14:48:00 -0500
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>
Delivery-date: 2006年5月09日 12:48:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1147203309.19485.62.camel@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060509084945.373541000@xxxxxxxxxxxx> <20060509085147.903310000@xxxxxxxxxxxx> <20060509151516.GA16332@xxxxxxxxxxxxx> <1147203309.19485.62.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mail/News 1.5 (X11/20060309)
Hollis Blanchard wrote:
On Tue, 2006年05月09日 at 16:15 +0100, Christoph Hellwig wrote:
+#ifdef __XEN__
+#define __DEFINE_GUEST_HANDLE(name, type) \
+ typedef struct { type *p; } __guest_handle_ ## name
+#else
+#define __DEFINE_GUEST_HANDLE(name, type) \
+ typedef type * __guest_handle_ ## name
+#endif
please get rid of all these stupid typedefs
These typedefs are a new hack to work around a basic interface problem:
instead of explicitly-sized types, Xen uses longs and pointers in its
interface. On PowerPC in particular, where we need a 32-bit userland
communicating with a 64-bit hypervisor, those types don't work.
However, the maintainers are reluctant to switch the interface to use
explicitly-sized types because it would break binary compatibility.
These ugly "HANDLE" macros allow PowerPC to do what we need without
affecting binary compatibility on x86.
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.
Regards,
Anthony Liguori
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: [Xen-devel] [PATCH] xm-test: update enforce_dom0_cpus testcase , Ryan Harper
Next by Date: [Xen-devel] [PATCH] Fix for minor video corruption on a Windows guest , Donald D. Dugger
Previous by Thread: [Xen-devel] Re: [RFC PATCH 03/35] Add Xen interface header files , Hollis Blanchard
Next by Thread: Re: [Xen-devel] Re: [RFC PATCH 03/35] Add Xen interface header files , Keir Fraser
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /