Skip to contentSkip to conversation

xen: Have __DEFINE_COMPAT_HANDLE() generate const versions

PATCH New Razvan Cojocaru 1 participant 1 message Sep 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Have __DEFINE_COMPAT_HANDLE() generate const versions

Both DEFINE_XEN_GUEST_HANDLE() and __DEFINE_XEN_GUEST_HANDLE() each produce both const and non-const handles,
only DEFINE_COMPAT_HANDLE() does (__DEFINE_COMPAT_HANDLE() does not). This patch has __DEFINE_COMPAT_HANDLE() also produce a const handle.

---
 xen/include/xen/compat.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
xen/include/xen/compat.h +6 -3
index 3f4cef6..ce913ac 100644
@@ -15,11 +15,14 @@
     typedef struct { \
         compat_ptr_t c; \
         type *_[0] __packed; \
-    } __compat_handle_ ## name
+    } __compat_handle_ ## name; \
+    typedef struct { \
+        compat_ptr_t c; \
+        const type *_[0] __packed; \
+    } __compat_handle_const_ ## name
 
 #define DEFINE_COMPAT_HANDLE(name) \
-    __DEFINE_COMPAT_HANDLE(name, name); \
-    __DEFINE_COMPAT_HANDLE(const_ ## name, const name)
+    __DEFINE_COMPAT_HANDLE(name, name)
 #define COMPAT_HANDLE(name)          __compat_handle_ ## name
 
 /* NB: it is assumed that if an arch uses the compat layer it does not
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel