diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-20 04:41:58 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-27 11:12:52 -0400 |
commit | fd6c6661492226bb82f422157c535ac573cbecbd (patch) | |
tree | bbc1f0e0f9496f4670799c507b472514a19bbd19 /arch/x86 | |
parent | de93410310952fb7b705f784ef22493c8362dbe8 (diff) |
x86: Move mpc_apic_id to x86_init_ops
The mpc_apic_id setup is handled by a x86_quirk. Make it a
x86_init_ops function with a default implementation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/mpspec.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/setup.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 2 |
6 files changed, 15 insertions, 7 deletions
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index e2a1bb6d71ea..03c6a92bfd42 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -62,10 +62,12 @@ extern void get_smp_config(void); | |||
62 | extern void find_smp_config(void); | 62 | extern void find_smp_config(void); |
63 | extern void early_reserve_e820_mpc_new(void); | 63 | extern void early_reserve_e820_mpc_new(void); |
64 | extern int enable_update_mptable; | 64 | extern int enable_update_mptable; |
65 | extern int default_mpc_apic_id(struct mpc_cpu *m); | ||
65 | #else | 66 | #else |
66 | static inline void find_smp_config(void) { } | 67 | static inline void find_smp_config(void) { } |
67 | static inline void early_reserve_e820_mpc_new(void) { } | 68 | static inline void early_reserve_e820_mpc_new(void) { } |
68 | #define enable_update_mptable 0 | 69 | #define enable_update_mptable 0 |
70 | #define default_mpc_apic_id NULL | ||
69 | #endif | 71 | #endif |
70 | 72 | ||
71 | void __cpuinit generic_processor_info(int apicid, int version); | 73 | void __cpuinit generic_processor_info(int apicid, int version); |
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index cc8b4b0550ea..7c7f44f3e4d9 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
@@ -12,7 +12,6 @@ | |||
12 | /* | 12 | /* |
13 | * Any setup quirks to be performed? | 13 | * Any setup quirks to be performed? |
14 | */ | 14 | */ |
15 | struct mpc_cpu; | ||
16 | struct mpc_bus; | 15 | struct mpc_bus; |
17 | struct mpc_oemtable; | 16 | struct mpc_oemtable; |
18 | 17 | ||
@@ -25,7 +24,6 @@ struct x86_quirks { | |||
25 | int (*mach_get_smp_config)(unsigned int early); | 24 | int (*mach_get_smp_config)(unsigned int early); |
26 | int (*mach_find_smp_config)(unsigned int reserve); | 25 | int (*mach_find_smp_config)(unsigned int reserve); |
27 | 26 | ||
28 | int (*mpc_apic_id)(struct mpc_cpu *m); | ||
29 | void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); | 27 | void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); |
30 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); | 28 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); |
31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, | 29 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, |
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 65985730b376..f2be2a780189 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -1,14 +1,18 @@ | |||
1 | #ifndef _ASM_X86_PLATFORM_H | 1 | #ifndef _ASM_X86_PLATFORM_H |
2 | #define _ASM_X86_PLATFORM_H | 2 | #define _ASM_X86_PLATFORM_H |
3 | 3 | ||
4 | struct mpc_cpu; | ||
5 | |||
4 | /** | 6 | /** |
5 | * struct x86_init_mpparse - platform specific mpparse ops | 7 | * struct x86_init_mpparse - platform specific mpparse ops |
6 | * @mpc_record: platform specific mpc record accounting | 8 | * @mpc_record: platform specific mpc record accounting |
7 | * @setup_ioapic_ids: platform specific ioapic id override | 9 | * @setup_ioapic_ids: platform specific ioapic id override |
10 | * @mpc_apic_id: platform specific mpc apic id assignment | ||
8 | */ | 11 | */ |
9 | struct x86_init_mpparse { | 12 | struct x86_init_mpparse { |
10 | void (*mpc_record)(unsigned int mode); | 13 | void (*mpc_record)(unsigned int mode); |
11 | void (*setup_ioapic_ids)(void); | 14 | void (*setup_ioapic_ids)(void); |
15 | int (*mpc_apic_id)(struct mpc_cpu *m); | ||
12 | }; | 16 | }; |
13 | 17 | ||
14 | /** | 18 | /** |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index f3717659265d..222413f7e797 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -270,7 +270,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
270 | .arch_trap_init = NULL, | 270 | .arch_trap_init = NULL, |
271 | .mach_get_smp_config = NULL, | 271 | .mach_get_smp_config = NULL, |
272 | .mach_find_smp_config = NULL, | 272 | .mach_find_smp_config = NULL, |
273 | .mpc_apic_id = mpc_apic_id, | ||
274 | .mpc_oem_bus_info = mpc_oem_bus_info, | 273 | .mpc_oem_bus_info = mpc_oem_bus_info, |
275 | .mpc_oem_pci_bus = mpc_oem_pci_bus, | 274 | .mpc_oem_pci_bus = mpc_oem_pci_bus, |
276 | .smp_read_mpc_oem = smp_read_mpc_oem, | 275 | .smp_read_mpc_oem = smp_read_mpc_oem, |
@@ -293,6 +292,7 @@ static __init void early_check_numaq(void) | |||
293 | x86_quirks = &numaq_x86_quirks; | 292 | x86_quirks = &numaq_x86_quirks; |
294 | x86_init.mpparse.mpc_record = numaq_mpc_record; | 293 | x86_init.mpparse.mpc_record = numaq_mpc_record; |
295 | x86_init.mpparse.setup_ioapic_ids = x86_init_noop; | 294 | x86_init.mpparse.setup_ioapic_ids = x86_init_noop; |
295 | x86_init.mpparse.mpc_apic_id = mpc_apic_id; | ||
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index b2179fdf0ff7..04560860a72a 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -45,6 +45,11 @@ static int __init mpf_checksum(unsigned char *mp, int len) | |||
45 | return sum & 0xFF; | 45 | return sum & 0xFF; |
46 | } | 46 | } |
47 | 47 | ||
48 | int __init default_mpc_apic_id(struct mpc_cpu *m) | ||
49 | { | ||
50 | return m->apicid; | ||
51 | } | ||
52 | |||
48 | static void __init MP_processor_info(struct mpc_cpu *m) | 53 | static void __init MP_processor_info(struct mpc_cpu *m) |
49 | { | 54 | { |
50 | int apicid; | 55 | int apicid; |
@@ -55,10 +60,7 @@ static void __init MP_processor_info(struct mpc_cpu *m) | |||
55 | return; | 60 | return; |
56 | } | 61 | } |
57 | 62 | ||
58 | if (x86_quirks->mpc_apic_id) | 63 | apicid = x86_init.mpparse.mpc_apic_id(m); |
59 | apicid = x86_quirks->mpc_apic_id(m); | ||
60 | else | ||
61 | apicid = m->apicid; | ||
62 | 64 | ||
63 | if (m->cpuflag & CPU_BOOTPROCESSOR) { | 65 | if (m->cpuflag & CPU_BOOTPROCESSOR) { |
64 | bootup_cpu = " (Bootup-CPU)"; | 66 | bootup_cpu = " (Bootup-CPU)"; |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index f4a32b3ab024..08749f2612f3 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | 7 | ||
8 | #include <asm/bios_ebda.h> | 8 | #include <asm/bios_ebda.h> |
9 | #include <asm/mpspec.h> | ||
9 | #include <asm/setup.h> | 10 | #include <asm/setup.h> |
10 | #include <asm/e820.h> | 11 | #include <asm/e820.h> |
11 | 12 | ||
@@ -28,5 +29,6 @@ struct __initdata x86_init_ops x86_init = { | |||
28 | .mpparse = { | 29 | .mpparse = { |
29 | .mpc_record = x86_init_uint_noop, | 30 | .mpc_record = x86_init_uint_noop, |
30 | .setup_ioapic_ids = x86_init_noop, | 31 | .setup_ioapic_ids = x86_init_noop, |
32 | .mpc_apic_id = default_mpc_apic_id, | ||
31 | }, | 33 | }, |
32 | }; | 34 | }; |