diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-20 05:11:52 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-31 03:35:45 -0400 |
commit | b3f1b617f49447df6c3f5fac9c225aaea8b724ea (patch) | |
tree | 9c1cc5a96be1330868312d7970583838790b14a3 /arch/x86/kernel | |
parent | 90e1c6969d8711edb888a00ec54c74370f125c8f (diff) |
x86: Move get/find_smp_config to x86_init_ops
Replace the quirk machinery by a x86_init_ops function which defaults
to the standard implementation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse.c | 33 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/visws_quirks.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 2 |
5 files changed, 8 insertions, 45 deletions
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 700273dca684..3dd5fd765341 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -268,8 +268,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
268 | .arch_pre_intr_init = NULL, | 268 | .arch_pre_intr_init = NULL, |
269 | .arch_intr_init = NULL, | 269 | .arch_intr_init = NULL, |
270 | .arch_trap_init = NULL, | 270 | .arch_trap_init = NULL, |
271 | .mach_get_smp_config = NULL, | ||
272 | .mach_find_smp_config = NULL, | ||
273 | }; | 271 | }; |
274 | 272 | ||
275 | static __init void early_check_numaq(void) | 273 | static __init void early_check_numaq(void) |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index a42f23f1dc7e..75357647b6ec 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -610,7 +610,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) | |||
610 | /* | 610 | /* |
611 | * Scan the memory blocks for an SMP configuration block. | 611 | * Scan the memory blocks for an SMP configuration block. |
612 | */ | 612 | */ |
613 | static void __init __get_smp_config(unsigned int early) | 613 | void __init default_get_smp_config(unsigned int early) |
614 | { | 614 | { |
615 | struct mpf_intel *mpf = mpf_found; | 615 | struct mpf_intel *mpf = mpf_found; |
616 | 616 | ||
@@ -627,11 +627,6 @@ static void __init __get_smp_config(unsigned int early) | |||
627 | if (acpi_lapic && acpi_ioapic) | 627 | if (acpi_lapic && acpi_ioapic) |
628 | return; | 628 | return; |
629 | 629 | ||
630 | if (x86_quirks->mach_get_smp_config) { | ||
631 | if (x86_quirks->mach_get_smp_config(early)) | ||
632 | return; | ||
633 | } | ||
634 | |||
635 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", | 630 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", |
636 | mpf->specification); | 631 | mpf->specification); |
637 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) | 632 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) |
@@ -672,16 +667,6 @@ static void __init __get_smp_config(unsigned int early) | |||
672 | */ | 667 | */ |
673 | } | 668 | } |
674 | 669 | ||
675 | void __init early_get_smp_config(void) | ||
676 | { | ||
677 | __get_smp_config(1); | ||
678 | } | ||
679 | |||
680 | void __init get_smp_config(void) | ||
681 | { | ||
682 | __get_smp_config(0); | ||
683 | } | ||
684 | |||
685 | static void __init smp_reserve_bootmem(struct mpf_intel *mpf) | 670 | static void __init smp_reserve_bootmem(struct mpf_intel *mpf) |
686 | { | 671 | { |
687 | unsigned long size = get_mpc_size(mpf->physptr); | 672 | unsigned long size = get_mpc_size(mpf->physptr); |
@@ -747,14 +732,10 @@ static int __init smp_scan_config(unsigned long base, unsigned long length, | |||
747 | return 0; | 732 | return 0; |
748 | } | 733 | } |
749 | 734 | ||
750 | static void __init __find_smp_config(unsigned int reserve) | 735 | void __init default_find_smp_config(unsigned int reserve) |
751 | { | 736 | { |
752 | unsigned int address; | 737 | unsigned int address; |
753 | 738 | ||
754 | if (x86_quirks->mach_find_smp_config) { | ||
755 | if (x86_quirks->mach_find_smp_config(reserve)) | ||
756 | return; | ||
757 | } | ||
758 | /* | 739 | /* |
759 | * FIXME: Linux assumes you have 640K of base ram.. | 740 | * FIXME: Linux assumes you have 640K of base ram.. |
760 | * this continues the error... | 741 | * this continues the error... |
@@ -789,16 +770,6 @@ static void __init __find_smp_config(unsigned int reserve) | |||
789 | smp_scan_config(address, 0x400, reserve); | 770 | smp_scan_config(address, 0x400, reserve); |
790 | } | 771 | } |
791 | 772 | ||
792 | void __init early_find_smp_config(void) | ||
793 | { | ||
794 | __find_smp_config(0); | ||
795 | } | ||
796 | |||
797 | void __init find_smp_config(void) | ||
798 | { | ||
799 | __find_smp_config(1); | ||
800 | } | ||
801 | |||
802 | #ifdef CONFIG_X86_IO_APIC | 773 | #ifdef CONFIG_X86_IO_APIC |
803 | static u8 __initdata irq_used[MAX_IRQ_SOURCES]; | 774 | static u8 __initdata irq_used[MAX_IRQ_SOURCES]; |
804 | 775 | ||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c2a8090e8312..54043cb7ba68 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -981,13 +981,11 @@ void __init setup_arch(char **cmdline_p) | |||
981 | */ | 981 | */ |
982 | acpi_boot_init(); | 982 | acpi_boot_init(); |
983 | 983 | ||
984 | #if defined(CONFIG_X86_MPPARSE) || defined(CONFIG_X86_VISWS) | ||
985 | /* | 984 | /* |
986 | * get boot-time SMP configuration: | 985 | * get boot-time SMP configuration: |
987 | */ | 986 | */ |
988 | if (smp_found_config) | 987 | if (smp_found_config) |
989 | get_smp_config(); | 988 | get_smp_config(); |
990 | #endif | ||
991 | 989 | ||
992 | prefill_possible_map(); | 990 | prefill_possible_map(); |
993 | 991 | ||
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c index 97c670df1aed..31e828118f8e 100644 --- a/arch/x86/kernel/visws_quirks.c +++ b/arch/x86/kernel/visws_quirks.c | |||
@@ -156,12 +156,8 @@ static void visws_machine_power_off(void) | |||
156 | outl(PIIX_SPECIAL_STOP, 0xCFC); | 156 | outl(PIIX_SPECIAL_STOP, 0xCFC); |
157 | } | 157 | } |
158 | 158 | ||
159 | static int __init visws_get_smp_config(unsigned int early) | 159 | static void __init visws_get_smp_config(unsigned int early) |
160 | { | 160 | { |
161 | /* | ||
162 | * Prevent MP-table parsing by the generic code: | ||
163 | */ | ||
164 | return 1; | ||
165 | } | 161 | } |
166 | 162 | ||
167 | /* | 163 | /* |
@@ -208,7 +204,7 @@ static void __init MP_processor_info(struct mpc_cpu *m) | |||
208 | apic_version[m->apicid] = ver; | 204 | apic_version[m->apicid] = ver; |
209 | } | 205 | } |
210 | 206 | ||
211 | static int __init visws_find_smp_config(unsigned int reserve) | 207 | static void __init visws_find_smp_config(unsigned int reserve) |
212 | { | 208 | { |
213 | struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS); | 209 | struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS); |
214 | unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS)); | 210 | unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS)); |
@@ -230,8 +226,6 @@ static int __init visws_find_smp_config(unsigned int reserve) | |||
230 | MP_processor_info(mp++); | 226 | MP_processor_info(mp++); |
231 | 227 | ||
232 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; | 228 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; |
233 | |||
234 | return 1; | ||
235 | } | 229 | } |
236 | 230 | ||
237 | static int visws_trap_init(void); | 231 | static int visws_trap_init(void); |
@@ -241,8 +235,6 @@ static struct x86_quirks visws_x86_quirks __initdata = { | |||
241 | .arch_pre_intr_init = visws_pre_intr_init, | 235 | .arch_pre_intr_init = visws_pre_intr_init, |
242 | .arch_intr_init = NULL, | 236 | .arch_intr_init = NULL, |
243 | .arch_trap_init = visws_trap_init, | 237 | .arch_trap_init = visws_trap_init, |
244 | .mach_get_smp_config = visws_get_smp_config, | ||
245 | .mach_find_smp_config = visws_find_smp_config, | ||
246 | }; | 238 | }; |
247 | 239 | ||
248 | void __init visws_early_detect(void) | 240 | void __init visws_early_detect(void) |
@@ -263,6 +255,8 @@ void __init visws_early_detect(void) | |||
263 | x86_quirks = &visws_x86_quirks; | 255 | x86_quirks = &visws_x86_quirks; |
264 | 256 | ||
265 | x86_init.resources.memory_setup = visws_memory_setup; | 257 | x86_init.resources.memory_setup = visws_memory_setup; |
258 | x86_init.mpparse.get_smp_config = visws_get_smp_config; | ||
259 | x86_init.mpparse.find_smp_config = visws_find_smp_config; | ||
266 | 260 | ||
267 | /* | 261 | /* |
268 | * Install reboot quirks: | 262 | * Install reboot quirks: |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 27685edc5460..3488fb62ac03 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -32,5 +32,7 @@ struct __initdata x86_init_ops x86_init = { | |||
32 | .mpc_apic_id = default_mpc_apic_id, | 32 | .mpc_apic_id = default_mpc_apic_id, |
33 | .smp_read_mpc_oem = default_smp_read_mpc_oem, | 33 | .smp_read_mpc_oem = default_smp_read_mpc_oem, |
34 | .mpc_oem_bus_info = default_mpc_oem_bus_info, | 34 | .mpc_oem_bus_info = default_mpc_oem_bus_info, |
35 | .find_smp_config = default_find_smp_config, | ||
36 | .get_smp_config = default_get_smp_config, | ||
35 | }, | 37 | }, |
36 | }; | 38 | }; |