# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1220022665 -3600
# Node ID 481f0dc6beb0b19cb02354dbe9b4ce068a5f6a18
# Parent cd078a3d600e6a1bab65e6392a60a832253cff8b
x86: constify microcode hypercall argument
Linux 2.6.27 marks the data pointer in its firmware struct 'const',
and hence, to avoid a compiler warning, Xen's microcode update
interface should be properly properly constified too.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
xen/arch/x86/microcode.c | 4 ++--
xen/arch/x86/platform_hypercall.c | 3 +--
xen/include/asm-x86/processor.h | 2 ++
xen/include/public/platform.h | 2 +-
xen/include/xen/compat.h | 4 +++-
5 files changed, 9 insertions(+), 6 deletions(-)
diff -r cd078a3d600e -r 481f0dc6beb0 xen/arch/x86/microcode.c
--- a/xen/arch/x86/microcode.c Fri Aug 29 16:08:09 2008 +0100
+++ b/xen/arch/x86/microcode.c Fri Aug 29 16:11:05 2008 +0100
@@ -124,7 +124,7 @@ static DEFINE_SPINLOCK(microcode_update_
/* no concurrent ->write()s are allowed on /dev/cpu/microcode */
static DEFINE_MUTEX(microcode_mutex);
-static void __user *user_buffer; /* user area microcode data buffer */
+static const void __user *user_buffer; /* user area microcode data buffer */
static unsigned int user_buffer_size; /* it's size */
typedef enum mc_error_code {
@@ -455,7 +455,7 @@ out:
return error;
}
-int microcode_update(XEN_GUEST_HANDLE(void) buf, unsigned long len)
+int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)
{
int ret;
diff -r cd078a3d600e -r 481f0dc6beb0 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Fri Aug 29 16:08:09 2008 +0100
+++ b/xen/arch/x86/platform_hypercall.c Fri Aug 29 16:11:05 2008 +0100
@@ -147,8 +147,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
case XENPF_microcode_update:
{
- extern int microcode_update(XEN_GUEST_HANDLE(void), unsigned long len);
- XEN_GUEST_HANDLE(void) data;
+ XEN_GUEST_HANDLE(const_void) data;
ret = xsm_microcode();
if ( ret )
diff -r cd078a3d600e -r 481f0dc6beb0 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h Fri Aug 29 16:08:09 2008 +0100
+++ b/xen/include/asm-x86/processor.h Fri Aug 29 16:11:05 2008 +0100
@@ -583,6 +583,8 @@ int wrmsr_hypervisor_regs(
int wrmsr_hypervisor_regs(
uint32_t idx, uint32_t eax, uint32_t edx);
+int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
+
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_X86_PROCESSOR_H */
diff -r cd078a3d600e -r 481f0dc6beb0 xen/include/public/platform.h
--- a/xen/include/public/platform.h Fri Aug 29 16:08:09 2008 +0100
+++ b/xen/include/public/platform.h Fri Aug 29 16:11:05 2008 +0100
@@ -97,7 +97,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_read_memty
#define XENPF_microcode_update 35
struct xenpf_microcode_update {
/* IN variables. */
- XEN_GUEST_HANDLE(void) data; /* Pointer to microcode data */
+ XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */
uint32_t length; /* Length of microcode data. */
};
typedef struct xenpf_microcode_update xenpf_microcode_update_t;
diff -r cd078a3d600e -r 481f0dc6beb0 xen/include/xen/compat.h
--- a/xen/include/xen/compat.h Fri Aug 29 16:08:09 2008 +0100
+++ b/xen/include/xen/compat.h Fri Aug 29 16:11:05 2008 +0100
@@ -19,7 +19,9 @@
type *_[0] __attribute__((__packed__)); \
} __compat_handle_ ## name
-#define DEFINE_COMPAT_HANDLE(name) __DEFINE_COMPAT_HANDLE(name, name)
+#define DEFINE_COMPAT_HANDLE(name) \
+ __DEFINE_COMPAT_HANDLE(name, name); \
+ __DEFINE_COMPAT_HANDLE(const_ ## name, const name)
#define COMPAT_HANDLE(name) __compat_handle_ ## name
/* Is the compat handle a NULL reference? */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|