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 /arch/x86/kernel/setup.c | |
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>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 124 |
1 files changed, 124 insertions, 0 deletions
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 */ | ||