diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 17:12:48 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 17:12:48 -0500 |
commit | 9be1b56a3e718aa998772019c57c398dbb19e258 (patch) | |
tree | 3e05b04f1af12abeeecdd909a789610a58284178 | |
parent | 2a05180fe2e5b414f0cb2ccfc80e6c90563e3c67 (diff) |
x86, apic: separate 32-bit setup functionality out of apic_32.c
Impact: build fix, cleanup
A couple of arch setup callbacks were mistakenly in apic_32.c, breaking
the build.
Also simplify the code a bit.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/Makefile | 3 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 160 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 124 |
4 files changed, 142 insertions, 147 deletions
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index c70537d8c156..de5657c039e9 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -63,7 +63,7 @@ obj-$(CONFIG_SMP) += setup_percpu.o | |||
63 | obj-$(CONFIG_X86_64_SMP) += tsc_sync.o | 63 | obj-$(CONFIG_X86_64_SMP) += tsc_sync.o |
64 | obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o | 64 | obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o |
65 | obj-$(CONFIG_X86_MPPARSE) += mpparse.o | 65 | obj-$(CONFIG_X86_MPPARSE) += mpparse.o |
66 | obj-$(CONFIG_X86_LOCAL_APIC) += apic/ | 66 | obj-y += apic/ |
67 | obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o | 67 | obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o |
68 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 68 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
69 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | 69 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o |
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile index 97f558db5c31..da7b7b9f8bd8 100644 --- a/arch/x86/kernel/apic/Makefile +++ b/arch/x86/kernel/apic/Makefile | |||
@@ -2,10 +2,9 @@ | |||
2 | # Makefile for local APIC drivers and for the IO-APIC code | 2 | # Makefile for local APIC drivers and for the IO-APIC code |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := apic.o probe_$(BITS).o ipi.o nmi.o | 5 | obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o |
6 | obj-$(CONFIG_X86_IO_APIC) += io_apic.o | 6 | obj-$(CONFIG_X86_IO_APIC) += io_apic.o |
7 | obj-$(CONFIG_SMP) += ipi.o | 7 | obj-$(CONFIG_SMP) += ipi.o |
8 | obj-$ | ||
9 | 8 | ||
10 | ifeq ($(CONFIG_X86_64),y) | 9 | ifeq ($(CONFIG_X86_64),y) |
11 | obj-y += apic_flat_64.o | 10 | obj-y += apic_flat_64.o |
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 5fa48332c5c8..c9ec90742e9f 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -47,7 +47,22 @@ | |||
47 | 47 | ||
48 | int no_broadcast = DEFAULT_SEND_IPI; | 48 | int no_broadcast = DEFAULT_SEND_IPI; |
49 | 49 | ||
50 | #ifdef CONFIG_X86_LOCAL_APIC | 50 | static __init int no_ipi_broadcast(char *str) |
51 | { | ||
52 | get_option(&str, &no_broadcast); | ||
53 | pr_info("Using %s mode\n", | ||
54 | no_broadcast ? "No IPI Broadcast" : "IPI Broadcast"); | ||
55 | return 1; | ||
56 | } | ||
57 | __setup("no_ipi_broadcast=", no_ipi_broadcast); | ||
58 | |||
59 | static int __init print_ipi_mode(void) | ||
60 | { | ||
61 | pr_info("Using IPI %s mode\n", | ||
62 | no_broadcast ? "No-Shortcut" : "Shortcut"); | ||
63 | return 0; | ||
64 | } | ||
65 | late_initcall(print_ipi_mode); | ||
51 | 66 | ||
52 | void default_setup_apic_routing(void) | 67 | void default_setup_apic_routing(void) |
53 | { | 68 | { |
@@ -279,146 +294,3 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
279 | } | 294 | } |
280 | return 0; | 295 | return 0; |
281 | } | 296 | } |
282 | |||
283 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
284 | |||
285 | /** | ||
286 | * pre_intr_init_hook - initialisation prior to setting up interrupt vectors | ||
287 | * | ||
288 | * Description: | ||
289 | * Perform any necessary interrupt initialisation prior to setting up | ||
290 | * the "ordinary" interrupt call gates. For legacy reasons, the ISA | ||
291 | * interrupts should be initialised here if the machine emulates a PC | ||
292 | * in any way. | ||
293 | **/ | ||
294 | void __init pre_intr_init_hook(void) | ||
295 | { | ||
296 | if (x86_quirks->arch_pre_intr_init) { | ||
297 | if (x86_quirks->arch_pre_intr_init()) | ||
298 | return; | ||
299 | } | ||
300 | init_ISA_irqs(); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * intr_init_hook - post gate setup interrupt initialisation | ||
305 | * | ||
306 | * Description: | ||
307 | * Fill in any interrupts that may have been left out by the general | ||
308 | * init_IRQ() routine. interrupts having to do with the machine rather | ||
309 | * than the devices on the I/O bus (like APIC interrupts in intel MP | ||
310 | * systems) are started here. | ||
311 | **/ | ||
312 | void __init intr_init_hook(void) | ||
313 | { | ||
314 | if (x86_quirks->arch_intr_init) { | ||
315 | if (x86_quirks->arch_intr_init()) | ||
316 | return; | ||
317 | } | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * pre_setup_arch_hook - hook called prior to any setup_arch() execution | ||
322 | * | ||
323 | * Description: | ||
324 | * generally used to activate any machine specific identification | ||
325 | * routines that may be needed before setup_arch() runs. On Voyager | ||
326 | * this is used to get the board revision and type. | ||
327 | **/ | ||
328 | void __init pre_setup_arch_hook(void) | ||
329 | { | ||
330 | } | ||
331 | |||
332 | /** | ||
333 | * trap_init_hook - initialise system specific traps | ||
334 | * | ||
335 | * Description: | ||
336 | * Called as the final act of trap_init(). Used in VISWS to initialise | ||
337 | * the various board specific APIC traps. | ||
338 | **/ | ||
339 | void __init trap_init_hook(void) | ||
340 | { | ||
341 | if (x86_quirks->arch_trap_init) { | ||
342 | if (x86_quirks->arch_trap_init()) | ||
343 | return; | ||
344 | } | ||
345 | } | ||
346 | |||
347 | static struct irqaction irq0 = { | ||
348 | .handler = timer_interrupt, | ||
349 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL, | ||
350 | .mask = CPU_MASK_NONE, | ||
351 | .name = "timer" | ||
352 | }; | ||
353 | |||
354 | /** | ||
355 | * pre_time_init_hook - do any specific initialisations before. | ||
356 | * | ||
357 | **/ | ||
358 | void __init pre_time_init_hook(void) | ||
359 | { | ||
360 | if (x86_quirks->arch_pre_time_init) | ||
361 | x86_quirks->arch_pre_time_init(); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * time_init_hook - do any specific initialisations for the system timer. | ||
366 | * | ||
367 | * Description: | ||
368 | * Must plug the system timer interrupt source at HZ into the IRQ listed | ||
369 | * in irq_vectors.h:TIMER_IRQ | ||
370 | **/ | ||
371 | void __init time_init_hook(void) | ||
372 | { | ||
373 | if (x86_quirks->arch_time_init) { | ||
374 | /* | ||
375 | * A nonzero return code does not mean failure, it means | ||
376 | * that the architecture quirk does not want any | ||
377 | * generic (timer) setup to be performed after this: | ||
378 | */ | ||
379 | if (x86_quirks->arch_time_init()) | ||
380 | return; | ||
381 | } | ||
382 | |||
383 | irq0.mask = cpumask_of_cpu(0); | ||
384 | setup_irq(0, &irq0); | ||
385 | } | ||
386 | |||
387 | #ifdef CONFIG_MCA | ||
388 | /** | ||
389 | * mca_nmi_hook - hook into MCA specific NMI chain | ||
390 | * | ||
391 | * Description: | ||
392 | * The MCA (Microchannel Architecture) has an NMI chain for NMI sources | ||
393 | * along the MCA bus. Use this to hook into that chain if you will need | ||
394 | * it. | ||
395 | **/ | ||
396 | void mca_nmi_hook(void) | ||
397 | { | ||
398 | /* | ||
399 | * If I recall correctly, there's a whole bunch of other things that | ||
400 | * we can do to check for NMI problems, but that's all I know about | ||
401 | * at the moment. | ||
402 | */ | ||
403 | pr_warning("NMI generated from unknown source!\n"); | ||
404 | } | ||
405 | #endif | ||
406 | |||
407 | static __init int no_ipi_broadcast(char *str) | ||
408 | { | ||
409 | get_option(&str, &no_broadcast); | ||
410 | pr_info("Using %s mode\n", | ||
411 | no_broadcast ? "No IPI Broadcast" : "IPI Broadcast"); | ||
412 | return 1; | ||
413 | } | ||
414 | __setup("no_ipi_broadcast=", no_ipi_broadcast); | ||
415 | |||
416 | static int __init print_ipi_mode(void) | ||
417 | { | ||
418 | pr_info("Using IPI %s mode\n", | ||
419 | no_broadcast ? "No-Shortcut" : "Shortcut"); | ||
420 | return 0; | ||
421 | } | ||
422 | |||
423 | late_initcall(print_ipi_mode); | ||
424 | |||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 6b588d6b3889..ebef80055795 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -985,4 +985,128 @@ void __init setup_arch(char **cmdline_p) | |||
985 | #endif | 985 | #endif |
986 | } | 986 | } |
987 | 987 | ||
988 | #ifdef CONFIG_X86_32 | ||
989 | |||
990 | /** | ||
991 | * pre_intr_init_hook - initialisation prior to setting up interrupt vectors | ||
992 | * | ||
993 | * Description: | ||
994 | * Perform any necessary interrupt initialisation prior to setting up | ||
995 | * the "ordinary" interrupt call gates. For legacy reasons, the ISA | ||
996 | * interrupts should be initialised here if the machine emulates a PC | ||
997 | * in any way. | ||
998 | **/ | ||
999 | void __init pre_intr_init_hook(void) | ||
1000 | { | ||
1001 | if (x86_quirks->arch_pre_intr_init) { | ||
1002 | if (x86_quirks->arch_pre_intr_init()) | ||
1003 | return; | ||
1004 | } | ||
1005 | init_ISA_irqs(); | ||
1006 | } | ||
1007 | |||
1008 | /** | ||
1009 | * intr_init_hook - post gate setup interrupt initialisation | ||
1010 | * | ||
1011 | * Description: | ||
1012 | * Fill in any interrupts that may have been left out by the general | ||
1013 | * init_IRQ() routine. interrupts having to do with the machine rather | ||
1014 | * than the devices on the I/O bus (like APIC interrupts in intel MP | ||
1015 | * systems) are started here. | ||
1016 | **/ | ||
1017 | void __init intr_init_hook(void) | ||
1018 | { | ||
1019 | if (x86_quirks->arch_intr_init) { | ||
1020 | if (x86_quirks->arch_intr_init()) | ||
1021 | return; | ||
1022 | } | ||
1023 | } | ||
1024 | |||
1025 | /** | ||
1026 | * pre_setup_arch_hook - hook called prior to any setup_arch() execution | ||
1027 | * | ||
1028 | * Description: | ||
1029 | * generally used to activate any machine specific identification | ||
1030 | * routines that may be needed before setup_arch() runs. On Voyager | ||
1031 | * this is used to get the board revision and type. | ||
1032 | **/ | ||
1033 | void __init pre_setup_arch_hook(void) | ||
1034 | { | ||
1035 | } | ||
1036 | |||
1037 | /** | ||
1038 | * trap_init_hook - initialise system specific traps | ||
1039 | * | ||
1040 | * Description: | ||
1041 | * Called as the final act of trap_init(). Used in VISWS to initialise | ||
1042 | * the various board specific APIC traps. | ||
1043 | **/ | ||
1044 | void __init trap_init_hook(void) | ||
1045 | { | ||
1046 | if (x86_quirks->arch_trap_init) { | ||
1047 | if (x86_quirks->arch_trap_init()) | ||
1048 | return; | ||
1049 | } | ||
1050 | } | ||
1051 | |||
1052 | static struct irqaction irq0 = { | ||
1053 | .handler = timer_interrupt, | ||
1054 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL, | ||
1055 | .mask = CPU_MASK_NONE, | ||
1056 | .name = "timer" | ||
1057 | }; | ||
1058 | |||
1059 | /** | ||
1060 | * pre_time_init_hook - do any specific initialisations before. | ||
1061 | * | ||
1062 | **/ | ||
1063 | void __init pre_time_init_hook(void) | ||
1064 | { | ||
1065 | if (x86_quirks->arch_pre_time_init) | ||
1066 | x86_quirks->arch_pre_time_init(); | ||
1067 | } | ||
1068 | |||
1069 | /** | ||
1070 | * time_init_hook - do any specific initialisations for the system timer. | ||
1071 | * | ||
1072 | * Description: | ||
1073 | * Must plug the system timer interrupt source at HZ into the IRQ listed | ||
1074 | * in irq_vectors.h:TIMER_IRQ | ||
1075 | **/ | ||
1076 | void __init time_init_hook(void) | ||
1077 | { | ||
1078 | if (x86_quirks->arch_time_init) { | ||
1079 | /* | ||
1080 | * A nonzero return code does not mean failure, it means | ||
1081 | * that the architecture quirk does not want any | ||
1082 | * generic (timer) setup to be performed after this: | ||
1083 | */ | ||
1084 | if (x86_quirks->arch_time_init()) | ||
1085 | return; | ||
1086 | } | ||
1087 | |||
1088 | irq0.mask = cpumask_of_cpu(0); | ||
1089 | setup_irq(0, &irq0); | ||
1090 | } | ||
1091 | |||
1092 | #ifdef CONFIG_MCA | ||
1093 | /** | ||
1094 | * mca_nmi_hook - hook into MCA specific NMI chain | ||
1095 | * | ||
1096 | * Description: | ||
1097 | * The MCA (Microchannel Architecture) has an NMI chain for NMI sources | ||
1098 | * along the MCA bus. Use this to hook into that chain if you will need | ||
1099 | * it. | ||
1100 | **/ | ||
1101 | void mca_nmi_hook(void) | ||
1102 | { | ||
1103 | /* | ||
1104 | * If I recall correctly, there's a whole bunch of other things that | ||
1105 | * we can do to check for NMI problems, but that's all I know about | ||
1106 | * at the moment. | ||
1107 | */ | ||
1108 | pr_warning("NMI generated from unknown source!\n"); | ||
1109 | } | ||
1110 | #endif /* CONFIG_MCA */ | ||
988 | 1111 | ||
1112 | #endif /* CONFIG_X86_32 */ | ||