ia64/xen-unstable

changeset 18417:481f0dc6beb0

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@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Aug 29 16:11:05 2008 +0100 (2008-08-29)
parents cd078a3d600e
children c503269192f2
files xen/arch/x86/microcode.c xen/arch/x86/platform_hypercall.c xen/include/asm-x86/processor.h xen/include/public/platform.h xen/include/xen/compat.h
line diff
     1.1 --- a/xen/arch/x86/microcode.c	Fri Aug 29 16:08:09 2008 +0100
     1.2 +++ b/xen/arch/x86/microcode.c	Fri Aug 29 16:11:05 2008 +0100
     1.3 @@ -124,7 +124,7 @@ static DEFINE_SPINLOCK(microcode_update_
     1.4  /* no concurrent ->write()s are allowed on /dev/cpu/microcode */
     1.5  static DEFINE_MUTEX(microcode_mutex);
     1.6  
     1.7 -static void __user *user_buffer;	/* user area microcode data buffer */
     1.8 +static const void __user *user_buffer;	/* user area microcode data buffer */
     1.9  static unsigned int user_buffer_size;	/* it's size */
    1.10  
    1.11  typedef enum mc_error_code {
    1.12 @@ -455,7 +455,7 @@ out:
    1.13  	return error;
    1.14  }
    1.15  
    1.16 -int microcode_update(XEN_GUEST_HANDLE(void) buf, unsigned long len)
    1.17 +int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)
    1.18  {
    1.19  	int ret;
    1.20  
     2.1 --- a/xen/arch/x86/platform_hypercall.c	Fri Aug 29 16:08:09 2008 +0100
     2.2 +++ b/xen/arch/x86/platform_hypercall.c	Fri Aug 29 16:11:05 2008 +0100
     2.3 @@ -147,8 +147,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
     2.4  
     2.5      case XENPF_microcode_update:
     2.6      {
     2.7 -        extern int microcode_update(XEN_GUEST_HANDLE(void), unsigned long len);
     2.8 -        XEN_GUEST_HANDLE(void) data;
     2.9 +        XEN_GUEST_HANDLE(const_void) data;
    2.10  
    2.11          ret = xsm_microcode();
    2.12          if ( ret )
     3.1 --- a/xen/include/asm-x86/processor.h	Fri Aug 29 16:08:09 2008 +0100
     3.2 +++ b/xen/include/asm-x86/processor.h	Fri Aug 29 16:11:05 2008 +0100
     3.3 @@ -583,6 +583,8 @@ int rdmsr_hypervisor_regs(
     3.4  int wrmsr_hypervisor_regs(
     3.5      uint32_t idx, uint32_t eax, uint32_t edx);
     3.6  
     3.7 +int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
     3.8 +
     3.9  #endif /* !__ASSEMBLY__ */
    3.10  
    3.11  #endif /* __ASM_X86_PROCESSOR_H */
     4.1 --- a/xen/include/public/platform.h	Fri Aug 29 16:08:09 2008 +0100
     4.2 +++ b/xen/include/public/platform.h	Fri Aug 29 16:11:05 2008 +0100
     4.3 @@ -97,7 +97,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_read_memty
     4.4  #define XENPF_microcode_update    35
     4.5  struct xenpf_microcode_update {
     4.6      /* IN variables. */
     4.7 -    XEN_GUEST_HANDLE(void) data;      /* Pointer to microcode data */
     4.8 +    XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */
     4.9      uint32_t length;                  /* Length of microcode data. */
    4.10  };
    4.11  typedef struct xenpf_microcode_update xenpf_microcode_update_t;
     5.1 --- a/xen/include/xen/compat.h	Fri Aug 29 16:08:09 2008 +0100
     5.2 +++ b/xen/include/xen/compat.h	Fri Aug 29 16:11:05 2008 +0100
     5.3 @@ -19,7 +19,9 @@
     5.4          type *_[0] __attribute__((__packed__)); \
     5.5      } __compat_handle_ ## name
     5.6  
     5.7 -#define DEFINE_COMPAT_HANDLE(name)   __DEFINE_COMPAT_HANDLE(name, name)
     5.8 +#define DEFINE_COMPAT_HANDLE(name) \
     5.9 +    __DEFINE_COMPAT_HANDLE(name, name); \
    5.10 +    __DEFINE_COMPAT_HANDLE(const_ ## name, const name)
    5.11  #define COMPAT_HANDLE(name)          __compat_handle_ ## name
    5.12  
    5.13  /* Is the compat handle a NULL reference? */