aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-20 03:41:38 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 03:35:45 -0400
commitd9112f43021554ded2ef2b9bea5f88ba4b52abe0 (patch)
tree40d8f33402f18af494549af8e9ee1a2f83fc2736 /arch
parentb3f1b617f49447df6c3f5fac9c225aaea8b724ea (diff)
x86: Move pre_intr_init to x86_init_ops
Replace the quirk machinery by a x86_init_ops function which defaults to the standard implementation. This is also a preparatory patch for Moorestown support which needs to replace the default init_ISA_irqs as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/irq.h2
-rw-r--r--arch/x86/include/asm/setup.h1
-rw-r--r--arch/x86/include/asm/x86_init.h10
-rw-r--r--arch/x86/kernel/apic/numaq_32.c1
-rw-r--r--arch/x86/kernel/irqinit.c24
-rw-r--r--arch/x86/kernel/visws_quirks.c10
-rw-r--r--arch/x86/kernel/x86_init.c5
7 files changed, 22 insertions, 31 deletions
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index f38481bcd455..8fe2782a2537 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -47,4 +47,6 @@ extern unsigned int do_IRQ(struct pt_regs *regs);
47extern DECLARE_BITMAP(used_vectors, NR_VECTORS); 47extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
48extern int vector_used_by_percpu_irq(unsigned int vector); 48extern int vector_used_by_percpu_irq(unsigned int vector);
49 49
50extern void init_ISA_irqs(void);
51
50#endif /* _ASM_X86_IRQ_H */ 52#endif /* _ASM_X86_IRQ_H */
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 345a2551af90..66a319709d66 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -16,7 +16,6 @@
16struct x86_quirks { 16struct x86_quirks {
17 int (*arch_pre_time_init)(void); 17 int (*arch_pre_time_init)(void);
18 int (*arch_time_init)(void); 18 int (*arch_time_init)(void);
19 int (*arch_pre_intr_init)(void);
20 int (*arch_intr_init)(void); 19 int (*arch_intr_init)(void);
21 int (*arch_trap_init)(void); 20 int (*arch_trap_init)(void);
22}; 21};
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index e0d4729c9054..65e3394c77fd 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -44,12 +44,22 @@ struct x86_init_resources {
44}; 44};
45 45
46/** 46/**
47 * struct x86_init_irqs - platform specific interrupt setup
48 * @pre_vector_init: init code to run before interrupt vectors
49 * are set up.
50 */
51struct x86_init_irqs {
52 void (*pre_vector_init)(void);
53};
54
55/**
47 * struct x86_init_ops - functions for platform specific setup 56 * struct x86_init_ops - functions for platform specific setup
48 * 57 *
49 */ 58 */
50struct x86_init_ops { 59struct x86_init_ops {
51 struct x86_init_resources resources; 60 struct x86_init_resources resources;
52 struct x86_init_mpparse mpparse; 61 struct x86_init_mpparse mpparse;
62 struct x86_init_irqs irqs;
53}; 63};
54 64
55extern struct x86_init_ops x86_init; 65extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index 3dd5fd765341..ec8b3113716d 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -265,7 +265,6 @@ static void __init smp_read_mpc_oem(struct mpc_table *mpc)
265static struct x86_quirks numaq_x86_quirks __initdata = { 265static struct x86_quirks numaq_x86_quirks __initdata = {
266 .arch_pre_time_init = numaq_pre_time_init, 266 .arch_pre_time_init = numaq_pre_time_init,
267 .arch_time_init = NULL, 267 .arch_time_init = NULL,
268 .arch_pre_intr_init = NULL,
269 .arch_intr_init = NULL, 268 .arch_intr_init = NULL,
270 .arch_trap_init = NULL, 269 .arch_trap_init = NULL,
271}; 270};
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 92b7703d3d58..acdf088c7583 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -116,7 +116,7 @@ int vector_used_by_percpu_irq(unsigned int vector)
116 return 0; 116 return 0;
117} 117}
118 118
119static void __init init_ISA_irqs(void) 119void __init init_ISA_irqs(void)
120{ 120{
121 int i; 121 int i;
122 122
@@ -213,32 +213,12 @@ static void __init apic_intr_init(void)
213#endif 213#endif
214} 214}
215 215
216/**
217 * x86_quirk_pre_intr_init - initialisation prior to setting up interrupt vectors
218 *
219 * Description:
220 * Perform any necessary interrupt initialisation prior to setting up
221 * the "ordinary" interrupt call gates. For legacy reasons, the ISA
222 * interrupts should be initialised here if the machine emulates a PC
223 * in any way.
224 **/
225static void __init x86_quirk_pre_intr_init(void)
226{
227#ifdef CONFIG_X86_32
228 if (x86_quirks->arch_pre_intr_init) {
229 if (x86_quirks->arch_pre_intr_init())
230 return;
231 }
232#endif
233 init_ISA_irqs();
234}
235
236void __init native_init_IRQ(void) 216void __init native_init_IRQ(void)
237{ 217{
238 int i; 218 int i;
239 219
240 /* Execute any quirks before the call gates are initialised: */ 220 /* Execute any quirks before the call gates are initialised: */
241 x86_quirk_pre_intr_init(); 221 x86_init.irqs.pre_vector_init();
242 222
243 apic_intr_init(); 223 apic_intr_init();
244 224
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index 31e828118f8e..1d6309d70dfa 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -73,14 +73,10 @@ static int __init visws_time_init(void)
73 return 0; 73 return 0;
74} 74}
75 75
76static int __init visws_pre_intr_init(void) 76/* Replaces the default init_ISA_irqs in the generic setup */
77static void __init visws_pre_intr_init(void)
77{ 78{
78 init_VISWS_APIC_irqs(); 79 init_VISWS_APIC_irqs();
79
80 /*
81 * We dont want ISA irqs to be set up by the generic code:
82 */
83 return 1;
84} 80}
85 81
86/* Quirk for machine specific memory setup. */ 82/* Quirk for machine specific memory setup. */
@@ -232,7 +228,6 @@ static int visws_trap_init(void);
232 228
233static struct x86_quirks visws_x86_quirks __initdata = { 229static struct x86_quirks visws_x86_quirks __initdata = {
234 .arch_time_init = visws_time_init, 230 .arch_time_init = visws_time_init,
235 .arch_pre_intr_init = visws_pre_intr_init,
236 .arch_intr_init = NULL, 231 .arch_intr_init = NULL,
237 .arch_trap_init = visws_trap_init, 232 .arch_trap_init = visws_trap_init,
238}; 233};
@@ -257,6 +252,7 @@ void __init visws_early_detect(void)
257 x86_init.resources.memory_setup = visws_memory_setup; 252 x86_init.resources.memory_setup = visws_memory_setup;
258 x86_init.mpparse.get_smp_config = visws_get_smp_config; 253 x86_init.mpparse.get_smp_config = visws_get_smp_config;
259 x86_init.mpparse.find_smp_config = visws_find_smp_config; 254 x86_init.mpparse.find_smp_config = visws_find_smp_config;
255 x86_init.irqs.pre_vector_init = visws_pre_intr_init;
260 256
261 /* 257 /*
262 * Install reboot quirks: 258 * Install reboot quirks:
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 3488fb62ac03..f2abe2136da1 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -9,6 +9,7 @@
9#include <asm/mpspec.h> 9#include <asm/mpspec.h>
10#include <asm/setup.h> 10#include <asm/setup.h>
11#include <asm/e820.h> 11#include <asm/e820.h>
12#include <asm/irq.h>
12 13
13void __cpuinit x86_init_noop(void) { } 14void __cpuinit x86_init_noop(void) { }
14void __init x86_init_uint_noop(unsigned int unused) { } 15void __init x86_init_uint_noop(unsigned int unused) { }
@@ -35,4 +36,8 @@ struct __initdata x86_init_ops x86_init = {
35 .find_smp_config = default_find_smp_config, 36 .find_smp_config = default_find_smp_config,
36 .get_smp_config = default_get_smp_config, 37 .get_smp_config = default_get_smp_config,
37 }, 38 },
39
40 .irqs = {
41 .pre_vector_init = init_ISA_irqs,
42 },
38}; 43};