[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen: define raw version of set_xen_guest_handle



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1284395393 -3600
# Node ID 35318cc05a50528d8e15585c23cf4578c31702c3
# Parent  ec31bb01c4243df239dbdbe362e8296afda91cc0
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>
---
 xen/include/public/arch-ia64.h           |    3 ++-
 xen/include/public/arch-x86/xen-x86_32.h |    4 ++--
 xen/include/public/arch-x86/xen.h        |    3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff -r ec31bb01c424 -r 35318cc05a50 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Mon Sep 13 17:27:22 2010 +0100
+++ b/xen/include/public/arch-ia64.h    Mon Sep 13 17:29:53 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 ec31bb01c424 -r 35318cc05a50 xen/include/public/arch-x86/xen-x86_32.h
--- a/xen/include/public/arch-x86/xen-x86_32.h  Mon Sep 13 17:27:22 2010 +0100
+++ b/xen/include/public/arch-x86/xen-x86_32.h  Mon Sep 13 17:29:53 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 ec31bb01c424 -r 35318cc05a50 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h Mon Sep 13 17:27:22 2010 +0100
+++ b/xen/include/public/arch-x86/xen.h Mon Sep 13 17:29:53 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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.