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] linux: do_callback_op()'s second argument can be con

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: do_callback_op()'s second argument can be const
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 18 Jan 2008 15:17:49 +0000
Delivery-date: Fri, 18 Jan 2008 07:17:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Subject: Constify pointer argument of HYPERVISOR_callback_op

This (obviously) duplicates the public header changes already submitted
with the Xen side patch.

As usual, written and tested on 2.6.24-rc7 and made apply to the 2.6.18
tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-10-26/include/xen/interface/arch-ia64.h
===================================================================
--- head-2007-10-26.orig/include/xen/interface/arch-ia64.h      2007-11-20 
17:45:33.000000000 +0100
+++ head-2007-10-26/include/xen/interface/arch-ia64.h   2007-11-20 
17:29:31.000000000 +0100
@@ -45,18 +45,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-__DEFINE_XEN_GUEST_HANDLE(u64,   unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
 typedef unsigned long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define PRI_xen_pfn "lx"
 #endif
 
Index: head-2007-10-26/include/xen/interface/arch-powerpc.h
===================================================================
--- head-2007-10-26.orig/include/xen/interface/arch-powerpc.h   2007-11-20 
17:45:33.000000000 +0100
+++ head-2007-10-26/include/xen/interface/arch-powerpc.h        2007-11-20 
17:28:06.000000000 +0100
@@ -45,17 +45,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
 typedef unsigned long long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define PRI_xen_pfn "llx"
 #endif
 
Index: head-2007-11-30/include/xen/interface/arch-x86/xen.h
===================================================================
--- head-2007-11-30.orig/include/xen/interface/arch-x86/xen.h   2007-12-06 
11:23:05.000000000 +0100
+++ head-2007-11-30/include/xen/interface/arch-x86/xen.h        2007-11-20 
17:26:06.000000000 +0100
@@ -54,17 +54,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
 typedef unsigned long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define PRI_xen_pfn "lx"
 #endif
 
Index: head-2007-11-30/include/xen/interface/xen.h
===================================================================
--- head-2007-11-30.orig/include/xen/interface/xen.h    2007-12-06 
11:23:05.000000000 +0100
+++ head-2007-11-30/include/xen/interface/xen.h 2007-11-20 17:27:12.000000000 
+0100
@@ -41,6 +41,20 @@
 #error "Unsupported architecture"
 #endif
 
+#ifndef __ASSEMBLY__
+/* Guest handles for primitive C types. */
+DEFINE_XEN_GUEST_HANDLE(char);
+__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
+DEFINE_XEN_GUEST_HANDLE(int);
+__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
+DEFINE_XEN_GUEST_HANDLE(long);
+__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+DEFINE_XEN_GUEST_HANDLE(void);
+__DEFINE_XEN_GUEST_HANDLE(cvoid, const void);
+
+DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+#endif
+
 /*
  * HYPERCALLS
  */
Index: head-2007-11-30/arch/x86_64/ia32/syscall32-xen.c
===================================================================
--- head-2007-11-30.orig/arch/x86_64/ia32/syscall32-xen.c       2007-12-06 
11:23:05.000000000 +0100
+++ head-2007-11-30/arch/x86_64/ia32/syscall32-xen.c    2007-11-21 
14:18:09.000000000 +0100
@@ -87,11 +87,11 @@ core_initcall(init_syscall32); 
 /* May not be __init: called during resume */
 void syscall32_cpu_init(void)
 {
-       static struct callback_register cstar = {
+       static const struct callback_register cstar = {
                .type = CALLBACKTYPE_syscall32,
                .address = (unsigned long)ia32_cstar_target
        };
-       static struct callback_register sysenter = {
+       static const struct callback_register sysenter = {
                .type = CALLBACKTYPE_sysenter,
                .address = (unsigned long)ia32_sysenter_target
        };
Index: head-2007-11-30/include/asm-i386/mach-xen/asm/hypercall.h
===================================================================
--- head-2007-11-30.orig/include/asm-i386/mach-xen/asm/hypercall.h      
2007-12-06 11:23:05.000000000 +0100
+++ head-2007-11-30/include/asm-i386/mach-xen/asm/hypercall.h   2007-11-21 
14:19:15.000000000 +0100
@@ -384,7 +384,7 @@ HYPERVISOR_hvm_op(
 
 static inline int
 HYPERVISOR_callback_op(
-       int cmd, void *arg)
+       int cmd, const void *arg)
 {
        return _hypercall2(int, callback_op, cmd, arg);
 }
Index: head-2007-11-30/include/asm-x86_64/mach-xen/asm/hypercall.h
===================================================================
--- head-2007-11-30.orig/include/asm-x86_64/mach-xen/asm/hypercall.h    
2007-12-06 11:23:05.000000000 +0100
+++ head-2007-11-30/include/asm-x86_64/mach-xen/asm/hypercall.h 2007-11-21 
15:48:12.000000000 +0100
@@ -385,7 +385,7 @@ HYPERVISOR_hvm_op(
 
 static inline int
 HYPERVISOR_callback_op(
-       int cmd, void *arg)
+       int cmd, const void *arg)
 {
        return _hypercall2(int, callback_op, cmd, arg);
 }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: do_callback_op()'s second argument can be const, Jan Beulich <=