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 3503ad66945e..118e9812778f 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h | |||
@@ -122,21 +122,21 @@ static inline int pfn_valid(int pfn) | |||
122 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) | 122 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) |
123 | #define alloc_bootmem_node(pgdat, x) \ | 123 | #define alloc_bootmem_node(pgdat, x) \ |
124 | ({ \ | 124 | ({ \ |
125 | struct pglist_data __attribute__ ((unused)) \ | 125 | struct pglist_data __maybe_unused \ |
126 | *__alloc_bootmem_node__pgdat = (pgdat); \ | 126 | *__alloc_bootmem_node__pgdat = (pgdat); \ |
127 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ | 127 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ |
128 | __pa(MAX_DMA_ADDRESS)); \ | 128 | __pa(MAX_DMA_ADDRESS)); \ |
129 | }) | 129 | }) |
130 | #define alloc_bootmem_pages_node(pgdat, x) \ | 130 | #define alloc_bootmem_pages_node(pgdat, x) \ |
131 | ({ \ | 131 | ({ \ |
132 | struct pglist_data __attribute__ ((unused)) \ | 132 | struct pglist_data __maybe_unused \ |
133 | *__alloc_bootmem_node__pgdat = (pgdat); \ | 133 | *__alloc_bootmem_node__pgdat = (pgdat); \ |
134 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \ | 134 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \ |
135 | __pa(MAX_DMA_ADDRESS)) \ | 135 | __pa(MAX_DMA_ADDRESS)) \ |
136 | }) | 136 | }) |
137 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 137 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
138 | ({ \ | 138 | ({ \ |
139 | struct pglist_data __attribute__ ((unused)) \ | 139 | struct pglist_data __maybe_unused \ |
140 | *__alloc_bootmem_node__pgdat = (pgdat); \ | 140 | *__alloc_bootmem_node__pgdat = (pgdat); \ |
141 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \ | 141 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \ |
142 | }) | 142 | }) |
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index 26861df52cc4..df21ea049369 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) | |||
86 | 86 | ||
87 | #define rdmsr(msr,val1,val2) \ | 87 | #define rdmsr(msr,val1,val2) \ |
88 | do { \ | 88 | do { \ |
89 | unsigned long long __val = native_read_msr(msr); \ | 89 | u64 __val = native_read_msr(msr); \ |
90 | val1 = __val; \ | 90 | (val1) = (u32)__val; \ |
91 | val2 = __val >> 32; \ | 91 | (val2) = (u32)(__val >> 32); \ |
92 | } while(0) | 92 | } while(0) |
93 | 93 | ||
94 | #define wrmsr(msr,val1,val2) \ | 94 | static inline void wrmsr(u32 __msr, u32 __low, u32 __high) |
95 | native_write_msr(msr, ((unsigned long long)val2 << 32) | val1) | ||
96 | |||
97 | #define rdmsrl(msr,val) \ | ||
98 | do { \ | ||
99 | (val) = native_read_msr(msr); \ | ||
100 | } while(0) | ||
101 | |||
102 | static inline void wrmsrl (unsigned long msr, unsigned long long val) | ||
103 | { | 95 | { |
104 | unsigned long lo, hi; | 96 | native_write_msr(__msr, ((u64)__high << 32) | __low); |
105 | lo = (unsigned long) val; | ||
106 | hi = val >> 32; | ||
107 | wrmsr (msr, lo, hi); | ||
108 | } | 97 | } |
109 | 98 | ||
99 | #define rdmsrl(msr,val) \ | ||
100 | ((val) = native_read_msr(msr)) | ||
101 | |||
102 | #define wrmsrl(msr,val) native_write_msr(msr, val) | ||
103 | |||
110 | /* wrmsr with exception handling */ | 104 | /* wrmsr with exception handling */ |
111 | #define wrmsr_safe(msr,val1,val2) \ | 105 | static inline int wrmsr_safe(u32 __msr, u32 __low, u32 __high) |
112 | (native_write_msr_safe(msr, ((unsigned long long)val2 << 32) | val1)) | 106 | { |
107 | return native_write_msr_safe(__msr, ((u64)__high << 32) | __low); | ||
108 | } | ||
113 | 109 | ||
114 | /* rdmsr with exception handling */ | 110 | /* rdmsr with exception handling */ |
115 | #define rdmsr_safe(msr,p1,p2) \ | 111 | #define rdmsr_safe(msr,p1,p2) \ |
116 | ({ \ | 112 | ({ \ |
117 | int __err; \ | 113 | int __err; \ |
118 | unsigned long long __val = native_read_msr_safe(msr, &__err);\ | 114 | u64 __val = native_read_msr_safe(msr, &__err); \ |
119 | (*p1) = __val; \ | 115 | (*p1) = (u32)__val; \ |
120 | (*p2) = __val >> 32; \ | 116 | (*p2) = (u32)(__val >> 32); \ |
121 | __err; \ | 117 | __err; \ |
122 | }) | 118 | }) |
123 | 119 | ||
124 | #define rdtsc(low,high) \ | ||
125 | do { \ | ||
126 | u64 _l = native_read_tsc(); \ | ||
127 | (low) = (u32)_l; \ | ||
128 | (high) = _l >> 32; \ | ||
129 | } while(0) | ||
130 | |||
131 | #define rdtscl(low) \ | 120 | #define rdtscl(low) \ |
132 | do { \ | 121 | ((low) = (u32)native_read_tsc()) |
133 | (low) = native_read_tsc(); \ | ||
134 | } while(0) | ||
135 | 122 | ||
136 | #define rdtscll(val) ((val) = native_read_tsc()) | 123 | #define rdtscll(val) \ |
124 | ((val) = native_read_tsc()) | ||
137 | 125 | ||
138 | #define write_tsc(val1,val2) wrmsr(0x10, val1, val2) | 126 | #define write_tsc(val1,val2) wrmsr(0x10, val1, val2) |
139 | 127 | ||
140 | #define rdpmc(counter,low,high) \ | 128 | #define rdpmc(counter,low,high) \ |
141 | do { \ | 129 | do { \ |
142 | u64 _l = native_read_pmc(); \ | 130 | u64 _l = native_read_pmc(); \ |
143 | low = (u32)_l; \ | 131 | (low) = (u32)_l; \ |
144 | high = _l >> 32; \ | 132 | (high) = (u32)(_l >> 32); \ |
145 | } while(0) | 133 | } while(0) |
146 | #endif /* !CONFIG_PARAVIRT */ | 134 | #endif /* !CONFIG_PARAVIRT */ |
147 | 135 | ||
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index e2e7f98723c5..bc5c12c13581 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -560,11 +560,6 @@ static inline u64 paravirt_read_tsc(void) | |||
560 | { | 560 | { |
561 | return PVOP_CALL0(u64, read_tsc); | 561 | return PVOP_CALL0(u64, read_tsc); |
562 | } | 562 | } |
563 | #define rdtsc(low,high) do { \ | ||
564 | u64 _l = paravirt_read_tsc(); \ | ||
565 | low = (u32)_l; \ | ||
566 | high = _l >> 32; \ | ||
567 | } while(0) | ||
568 | 563 | ||
569 | #define rdtscl(low) do { \ | 564 | #define rdtscl(low) do { \ |
570 | u64 _l = paravirt_read_tsc(); \ | 565 | u64 _l = paravirt_read_tsc(); \ |
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 090abc1da32a..0c7132787062 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -124,20 +124,6 @@ static inline int num_booting_cpus(void) | |||
124 | return cpus_weight(cpu_callout_map); | 124 | return cpus_weight(cpu_callout_map); |
125 | } | 125 | } |
126 | 126 | ||
127 | #ifdef CONFIG_X86_LOCAL_APIC | ||
128 | |||
129 | #ifdef APIC_DEFINITION | ||
130 | extern int hard_smp_processor_id(void); | ||
131 | #else | ||
132 | #include <mach_apicdef.h> | ||
133 | static inline int hard_smp_processor_id(void) | ||
134 | { | ||
135 | /* we don't want to mark this access volatile - bad code generation */ | ||
136 | return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); | ||
137 | } | ||
138 | #endif | ||
139 | #endif | ||
140 | |||
141 | extern int safe_smp_processor_id(void); | 127 | extern int safe_smp_processor_id(void); |
142 | extern int __cpu_disable(void); | 128 | extern int __cpu_disable(void); |
143 | extern void __cpu_die(unsigned int cpu); | 129 | extern void __cpu_die(unsigned int cpu); |
@@ -152,10 +138,31 @@ extern unsigned int num_processors; | |||
152 | 138 | ||
153 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 139 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
154 | 140 | ||
155 | #endif | 141 | #endif /* CONFIG_SMP */ |
156 | 142 | ||
157 | #ifndef __ASSEMBLY__ | 143 | #ifndef __ASSEMBLY__ |
158 | 144 | ||
145 | #ifdef CONFIG_X86_LOCAL_APIC | ||
146 | |||
147 | #ifdef APIC_DEFINITION | ||
148 | extern int hard_smp_processor_id(void); | ||
149 | #else | ||
150 | #include <mach_apicdef.h> | ||
151 | static inline int hard_smp_processor_id(void) | ||
152 | { | ||
153 | /* we don't want to mark this access volatile - bad code generation */ | ||
154 | return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); | ||
155 | } | ||
156 | #endif /* APIC_DEFINITION */ | ||
157 | |||
158 | #else /* CONFIG_X86_LOCAL_APIC */ | ||
159 | |||
160 | #ifndef CONFIG_SMP | ||
161 | #define hard_smp_processor_id() 0 | ||
162 | #endif | ||
163 | |||
164 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
165 | |||
159 | extern u8 apicid_2_node[]; | 166 | extern u8 apicid_2_node[]; |
160 | 167 | ||
161 | #ifdef CONFIG_X86_LOCAL_APIC | 168 | #ifdef CONFIG_X86_LOCAL_APIC |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index bf01d4b342bd..4cb0f91ae64f 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) | |||
172 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 172 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
173 | #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ | 173 | #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ |
174 | 174 | ||
175 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | 175 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
176 | 176 | ||
177 | #endif /* __KERNEL__ */ | 177 | #endif /* __KERNEL__ */ |
178 | 178 | ||