diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-20 06:05:01 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-27 11:12:52 -0400 |
commit | f4848472cd99487e182b64fb2a5d0e4fedbe86ad (patch) | |
tree | d407ce2579e01beca7bee81df5fa3dbfe99cc512 /arch/x86/kernel/apic | |
parent | 6b18ae3e2ff62daa9f181401759161dd8de0aadf (diff) |
x86: Sanitize smp_record and move it to x86_init_ops
The x86 quirkification introduced an extra ugly hackery with a
variable pointer in the mpparse code. If the pointer is initialized
then it is dereferenced and the variable set to 0 or incremented.
Create a x86_init_ops function and let the affected numaq code
hold the function. Default init is a setup noop.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 403c062f69e8..b5f0b1dc7dd0 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -66,7 +66,6 @@ struct mpc_trans { | |||
66 | unsigned short trans_reserved; | 66 | unsigned short trans_reserved; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | /* x86_quirks member */ | ||
70 | static int mpc_record; | 69 | static int mpc_record; |
71 | 70 | ||
72 | static struct mpc_trans *translation_table[MAX_MPC_ENTRY]; | 71 | static struct mpc_trans *translation_table[MAX_MPC_ENTRY]; |
@@ -177,6 +176,19 @@ static void mpc_oem_pci_bus(struct mpc_bus *m) | |||
177 | quad_local_to_mp_bus_id[quad][local] = m->busid; | 176 | quad_local_to_mp_bus_id[quad][local] = m->busid; |
178 | } | 177 | } |
179 | 178 | ||
179 | /* | ||
180 | * Called from mpparse code. | ||
181 | * mode = 0: prescan | ||
182 | * mode = 1: one mpc entry scanned | ||
183 | */ | ||
184 | static void numaq_mpc_record(unsigned int mode) | ||
185 | { | ||
186 | if (!mode) | ||
187 | mpc_record = 0; | ||
188 | else | ||
189 | mpc_record++; | ||
190 | } | ||
191 | |||
180 | static void __init MP_translation_info(struct mpc_trans *m) | 192 | static void __init MP_translation_info(struct mpc_trans *m) |
181 | { | 193 | { |
182 | printk(KERN_INFO | 194 | printk(KERN_INFO |
@@ -264,7 +276,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
264 | .arch_trap_init = NULL, | 276 | .arch_trap_init = NULL, |
265 | .mach_get_smp_config = NULL, | 277 | .mach_get_smp_config = NULL, |
266 | .mach_find_smp_config = NULL, | 278 | .mach_find_smp_config = NULL, |
267 | .mpc_record = &mpc_record, | ||
268 | .mpc_apic_id = mpc_apic_id, | 279 | .mpc_apic_id = mpc_apic_id, |
269 | .mpc_oem_bus_info = mpc_oem_bus_info, | 280 | .mpc_oem_bus_info = mpc_oem_bus_info, |
270 | .mpc_oem_pci_bus = mpc_oem_pci_bus, | 281 | .mpc_oem_pci_bus = mpc_oem_pci_bus, |
@@ -285,8 +296,10 @@ static __init void early_check_numaq(void) | |||
285 | if (smp_found_config) | 296 | if (smp_found_config) |
286 | early_get_smp_config(); | 297 | early_get_smp_config(); |
287 | 298 | ||
288 | if (found_numaq) | 299 | if (found_numaq) { |
289 | x86_quirks = &numaq_x86_quirks; | 300 | x86_quirks = &numaq_x86_quirks; |
301 | x86_init.mpparse.mpc_record = numaq_mpc_record; | ||
302 | } | ||
290 | } | 303 | } |
291 | 304 | ||
292 | int __init get_memcfg_numaq(void) | 305 | int __init get_memcfg_numaq(void) |