ia64/xen-unstable

changeset 17221:12b589420bd1

x86: Clean ups and fixes after bitops changes.

Firstly, the vlapic bitops need fewer casts.

Secondly, the minimum-alignment check is unnecessary and also breaks
the build (page_info's type_info field has alignment == 1). It is an
unnecessary check because bitops operate on only one bit of the word
they access, so lack of atomicity of the read and writeback does not
matter -- furthermore the LOCKed variants are guaranteed atomic
regardless of alignment.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 10:51:20 2008 +0000 (2008-03-18)
parents 9b0ee101c2e2
children bab6afd2a29f
files xen/arch/x86/hvm/vlapic.c xen/include/asm-x86/bitops.h
line diff
     1.1 --- a/xen/arch/x86/hvm/vlapic.c	Tue Mar 18 10:05:56 2008 +0000
     1.2 +++ b/xen/arch/x86/hvm/vlapic.c	Tue Mar 18 10:51:20 2008 +0000
     1.3 @@ -114,14 +114,12 @@ static int vlapic_find_highest_vector(vo
     1.4  
     1.5  static int vlapic_test_and_set_irr(int vector, struct vlapic *vlapic)
     1.6  {
     1.7 -    return vlapic_test_and_set_vector(
     1.8 -        vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
     1.9 +    return vlapic_test_and_set_vector(vector, &vlapic->regs->data[APIC_IRR]);
    1.10  }
    1.11  
    1.12  static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
    1.13  {
    1.14 -    vlapic_clear_vector(
    1.15 -        vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
    1.16 +    vlapic_clear_vector(vector, &vlapic->regs->data[APIC_IRR]);
    1.17  }
    1.18  
    1.19  static int vlapic_find_highest_irr(struct vlapic *vlapic)
     2.1 --- a/xen/include/asm-x86/bitops.h	Tue Mar 18 10:05:56 2008 +0000
     2.2 +++ b/xen/include/asm-x86/bitops.h	Tue Mar 18 10:51:20 2008 +0000
     2.3 @@ -26,7 +26,7 @@
     2.4  #define CONST_ADDR (*(const volatile long *) addr)
     2.5  
     2.6  extern void __bitop_bad_size(void);
     2.7 -#define bitop_bad_size(addr) (min(sizeof(*(addr)), __alignof__(*(addr))) < 4)
     2.8 +#define bitop_bad_size(addr) (sizeof(*(addr)) < 4)
     2.9  
    2.10  /**
    2.11   * set_bit - Atomically set a bit in memory