[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 01 of 24] xen: define raw version of set_xen_guest_handle
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1283778426 -3600 # Node ID f3b0732b41af4dd3218e59dae6e0a005c323774f # Parent 8848895e50ded4d37879bf63635f5774d9dc4959 xen: define raw version of set_xen_guest_handle allows users to define more complex (e.g. type-safer) variations on set_xen_guest_handle if they wish. Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> diff -r 8848895e50de -r f3b0732b41af xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Mon Sep 06 14:07:06 2010 +0100 +++ b/xen/include/public/arch-ia64.h Mon Sep 06 14:07:06 2010 +0100 @@ -49,10 +49,11 @@ #define XEN_GUEST_HANDLE(name) __guest_handle_ ## name #define XEN_GUEST_HANDLE_64(name) XEN_GUEST_HANDLE(name) #define uint64_aligned_t uint64_t -#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) +#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0) #ifdef __XEN_TOOLS__ #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0) #endif +#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val) #ifndef __ASSEMBLY__ typedef unsigned long xen_pfn_t; diff -r 8848895e50de -r f3b0732b41af xen/include/public/arch-x86/xen-x86_32.h --- a/xen/include/public/arch-x86/xen-x86_32.h Mon Sep 06 14:07:06 2010 +0100 +++ b/xen/include/public/arch-x86/xen-x86_32.h Mon Sep 06 14:07:06 2010 +0100 @@ -108,8 +108,8 @@ __guest_handle_ ## name; \ typedef struct { union { type *p; uint64_aligned_t q; }; } \ __guest_handle_64_ ## name -#undef set_xen_guest_handle -#define set_xen_guest_handle(hnd, val) \ +#undef set_xen_guest_handle_raw +#define set_xen_guest_handle_raw(hnd, val) \ do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0; \ (hnd).p = val; \ } while ( 0 ) diff -r 8848895e50de -r f3b0732b41af xen/include/public/arch-x86/xen.h --- a/xen/include/public/arch-x86/xen.h Mon Sep 06 14:07:06 2010 +0100 +++ b/xen/include/public/arch-x86/xen.h Mon Sep 06 14:07:06 2010 +0100 @@ -44,10 +44,11 @@ #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) -#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) +#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0) #ifdef __XEN_TOOLS__ #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0) #endif +#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val) #if defined(__i386__) #include "xen-x86_32.h" _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |