From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] xen: make (set|get)_xen_guest_handle available Date: Thu, 30 Jul 2009 11:12:15 +0200 Message-ID: <200907301112.15209.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_vPWcKZlPdVekXn6" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_vPWcKZlPdVekXn6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Make (set|get)_xen_guest_handle() always available. This avoids code snippets in the guest like this: #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 set_xen_guest_handle(hnd, val); #else hnd = val; #endif Also make get_xen_guest_handle() available for the guest. It is useful for the guest, too. Signed-off-by: Christoph Egger P.S.: Keir: Please apply this patch also in xen-3.4-testing and xen-3.3-testing tree. -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_vPWcKZlPdVekXn6 Content-Type: text/x-diff; charset="us-ascii"; name="xen_public.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_public.diff" diff -r 41b2c4e4f674 xen/include/public/arch-x86/xen.h --- a/xen/include/public/arch-x86/xen.h Wed Jul 29 09:20:46 2009 +0100 +++ b/xen/include/public/arch-x86/xen.h Thu Jul 30 11:08:01 2009 +0200 @@ -44,9 +44,13 @@ #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) #define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) + +#if __XEN_INTERFACE_VERSION__ >= 0x00030201 #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) -#ifdef __XEN_TOOLS__ #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0) +#else +#define set_xen_guest_handle(hnd, val) (hnd) = val +#define get_xen_guest_handle(val, hnd) val = (hnd) #endif #if defined(__i386__) --Boundary-00=_vPWcKZlPdVekXn6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_vPWcKZlPdVekXn6--