diff options
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/mmzone.h | 6 | ||||
-rw-r--r-- | include/asm-i386/msr.h | 56 | ||||
-rw-r--r-- | include/asm-i386/paravirt.h | 5 | ||||
-rw-r--r-- | include/asm-i386/smp.h | 37 | ||||
-rw-r--r-- | include/asm-i386/thread_info.h | 2 |
5 files changed, 48 insertions, 58 deletions
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 3503ad66945..118e9812778 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -122,21 +122,21 @@ static inline int pfn_valid(int pfn) __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) #define alloc_bootmem_node(pgdat, x) \ ({ \ - struct pglist_data __attribute__ ((unused)) \ + struct pglist_data __maybe_unused \ *__alloc_bootmem_node__pgdat = (pgdat); \ __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ __pa(MAX_DMA_ADDRESS)); \ }) #define alloc_bootmem_pages_node(pgdat, x) \ ({ \ - struct pglist_data __attribute__ ((unused)) \ + struct pglist_data __maybe_unused \ *__alloc_bootmem_node__pgdat = (pgdat); \ __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \ __pa(MAX_DMA_ADDRESS)) \ }) #define alloc_bootmem_low_pages_node(pgdat, x) \ ({ \ - struct pglist_data __attribute__ ((unused)) \ + struct pglist_data __maybe_unused \ *__alloc_bootmem_node__pgdat = (pgdat); \ __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \ }) diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index 26861df52cc..df21ea04936 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h @@ -86,62 +86,50 @@ static inline unsigned long long native_read_pmc(void) #define rdmsr(msr,val1,val2) \ do { \ - unsigned long long __val = native_read_msr(msr); \ - val1 = __val; \ - val2 = __val >> 32; \ + u64 __val = native_read_msr(msr); \ + (val1) = (u32)__val; \ + (val2) = (u32)(__val >> 32); \ } while(0) -#define wrmsr(msr,val1,val2) \ - native_write_msr(msr, ((unsigned long long)val2 << 32) | val1) - -#define rdmsrl(msr,val) \ - do { \ - (val) = native_read_msr(msr); \ - } while(0) - -static inline void wrmsrl (unsigned long msr, unsigned long long val) +static inline void wrmsr(u32 __msr, u32 __low, u32 __high) { - unsigned long lo, hi; - lo = (unsigned long) val; - hi = val >> 32; - wrmsr (msr, lo, hi); + native_write_msr(__msr, ((u64)__high << 32) | __low); } +#define rdmsrl(msr,val) \ + ((val) = native_read_msr(msr)) + +#define wrmsrl(msr,val) native_write_msr(msr, val) + /* wrmsr with exception handling */ -#define wrmsr_safe(msr,val1,val2) \ - (native_write_msr_safe(msr, ((unsigned long long)val2 << 32) | val1)) +static inline int wrmsr_safe(u32 __msr, u32 __low, u32 __high) +{ + return native_write_msr_safe(__msr, ((u64)__high << 32) | __low); +} /* rdmsr with exception handling */ #define rdmsr_safe(msr,p1,p2) \ ({ \ int __err; \ - unsigned long long __val = native_read_msr_safe(msr, &__err);\ - (*p1) = __val; \ - (*p2) = __val >> 32; \ + u64 __val = native_read_msr_safe(msr, &__err); \ + (*p1) = (u32)__val; \ + (*p2) = (u32)(__val >> 32); \ __err; \ }) -#define rdtsc(low,high) \ - do { \ - u64 _l = native_read_tsc(); \ - (low) = (u32)_l; \ - (high) = _l >> 32; \ - } while(0) - #define rdtscl(low) \ - do { \ - (low) = native_read_tsc(); \ - } while(0) + ((low) = (u32)native_read_tsc()) -#define rdtscll(val) ((val) = native_read_tsc()) +#define rdtscll(val) \ + ((val) = native_read_tsc()) #define write_tsc(val1,val2) wrmsr(0x10, val1, val2) #define rdpmc(counter,low,high) \ do { \ u64 _l = native_read_pmc(); \ - low = (u32)_l; \ - high = _l >> 32; \ + (low) = (u32)_l; \ + (high) = (u32)(_l >> 32); \ } while(0) #endif /* !CONFIG_PARAVIRT */ diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index e2e7f98723c..bc5c12c1358 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h @@ -560,11 +560,6 @@ static inline u64 paravirt_read_tsc(void) { return PVOP_CALL0(u64, read_tsc); } -#define rdtsc(low,high) do { \ - u64 _l = paravirt_read_tsc(); \ - low = (u32)_l; \ - high = _l >> 32; \ -} while(0) #define rdtscl(low) do { \ u64 _l = paravirt_read_tsc(); \ diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 090abc1da32..0c713278706 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h @@ -124,20 +124,6 @@ static inline int num_booting_cpus(void) return cpus_weight(cpu_callout_map); } -#ifdef CONFIG_X86_LOCAL_APIC - -#ifdef APIC_DEFINITION -extern int hard_smp_processor_id(void); -#else -#include <mach_apicdef.h> -static inline int hard_smp_processor_id(void) -{ - /* we don't want to mark this access volatile - bad code generation */ - return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); -} -#endif -#endif - extern int safe_smp_processor_id(void); extern int __cpu_disable(void); extern void __cpu_die(unsigned int cpu); @@ -152,10 +138,31 @@ extern unsigned int num_processors; #define NO_PROC_ID 0xFF /* No processor magic marker */ -#endif +#endif /* CONFIG_SMP */ #ifndef __ASSEMBLY__ +#ifdef CONFIG_X86_LOCAL_APIC + +#ifdef APIC_DEFINITION +extern int hard_smp_processor_id(void); +#else +#include <mach_apicdef.h> +static inline int hard_smp_processor_id(void) +{ + /* we don't want to mark this access volatile - bad code generation */ + return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); +} +#endif /* APIC_DEFINITION */ + +#else /* CONFIG_X86_LOCAL_APIC */ + +#ifndef CONFIG_SMP +#define hard_smp_processor_id() 0 +#endif + +#endif /* CONFIG_X86_LOCAL_APIC */ + extern u8 apicid_2_node[]; #ifdef CONFIG_X86_LOCAL_APIC diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index bf01d4b342b..4cb0f91ae64 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -172,7 +172,7 @@ static inline struct thread_info *current_thread_info(void) #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ -#define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) +#define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) #endif /* __KERNEL__ */ |