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 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 01 of 24] xen: define raw version of set_xen_guest_ha

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 01 of 24] xen: define raw version of set_xen_guest_handle
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 06 Sep 2010 14:38:21 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 06:41:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1283780300@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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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