Skip to contentSkip to conversation

do_set_trap_table()'s argument can be const too

PATCH New Jan Beulich 1 participant 1 message Jan 18, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do_set_trap_table()'s argument can be const too

Additionally the guest handle declaration doesn't need to be in a public header.

xen/arch/x86/traps.c +2 -1
Index: 2008-01-18/xen/arch/x86/traps.c
===================================================================
@@ -49,6 +49,7 @@
 #include <xen/trace.h>
 #include <asm/paging.h>
 #include <asm/system.h>
+#include <asm/hypercall.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <asm/desc.h>
@@ -2825,7 +2826,7 @@ long unregister_guest_nmi_callback(void)
     return 0;
 }
 
-long do_set_trap_table(XEN_GUEST_HANDLE(trap_info_t) traps)
+long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps)
 {
     struct trap_info cur;
     struct vcpu *curr = current;
xen/include/asm-x86/hypercall.h +2 -1
Index: 2008-01-18/xen/include/asm-x86/hypercall.h
===================================================================
@@ -32,9 +32,10 @@ extern long
 do_physdev_op_compat(
     XEN_GUEST_HANDLE(physdev_op_t) uop);
 
+__DEFINE_XEN_GUEST_HANDLE(const_trap_info_t, const trap_info_t);
 extern long
 do_set_trap_table(
-    XEN_GUEST_HANDLE(trap_info_t) traps);
+    XEN_GUEST_HANDLE(const_trap_info_t) traps);
 
 extern int
 do_mmu_update(
xen/include/public/arch-x86/xen.h +0 -1
Index: 2008-01-18/xen/include/public/arch-x86/xen.h
===================================================================
@@ -98,7 +98,6 @@ struct trap_info {
     unsigned long address; /* code offset                                   */
 };
 typedef struct trap_info trap_info_t;
-DEFINE_XEN_GUEST_HANDLE(trap_info_t);
 
 typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */