aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-20 04:35:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 03:35:45 -0400
commit428cf9025b15573e16e658032f2b963283e34ae0 (patch)
treefc4620e8b7965bb191b0cebd879eaa53ede5bdda
parent66bcaf0bde100a4b54b82fc6fea6ceee2212ffb4 (diff)
x86: Move traps_init to x86_init_ops
Replace the quirks by a simple x86_init_ops function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/include/asm/setup.h3
-rw-r--r--arch/x86/include/asm/x86_init.h2
-rw-r--r--arch/x86/kernel/apic/numaq_32.c1
-rw-r--r--arch/x86/kernel/setup.c15
-rw-r--r--arch/x86/kernel/traps.c5
-rw-r--r--arch/x86/kernel/visws_quirks.c8
-rw-r--r--arch/x86/kernel/x86_init.c1
7 files changed, 8 insertions, 27 deletions
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 404086f9411c..7751d1f92bc9 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -16,11 +16,8 @@
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_trap_init)(void);
20}; 19};
21 20
22extern void x86_quirk_trap_init(void);
23
24extern void x86_quirk_pre_time_init(void); 21extern void x86_quirk_pre_time_init(void);
25extern void x86_quirk_time_init(void); 22extern void x86_quirk_time_init(void);
26 23
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 8d7be65ccf7f..07c37bd879f8 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -48,10 +48,12 @@ struct x86_init_resources {
48 * @pre_vector_init: init code to run before interrupt vectors 48 * @pre_vector_init: init code to run before interrupt vectors
49 * are set up. 49 * are set up.
50 * @intr_init: interrupt init code 50 * @intr_init: interrupt init code
51 * @trap_init: platform specific trap setup
51 */ 52 */
52struct x86_init_irqs { 53struct x86_init_irqs {
53 void (*pre_vector_init)(void); 54 void (*pre_vector_init)(void);
54 void (*intr_init)(void); 55 void (*intr_init)(void);
56 void (*trap_init)(void);
55}; 57};
56 58
57/** 59/**
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index eafd341e42dd..71c5ea645865 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_trap_init = NULL,
269}; 268};
270 269
271static __init void early_check_numaq(void) 270static __init void early_check_numaq(void)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d3da0f7333f7..bf3b87f1f7db 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1020,21 +1020,6 @@ void __init setup_arch(char **cmdline_p)
1020 1020
1021#ifdef CONFIG_X86_32 1021#ifdef CONFIG_X86_32
1022 1022
1023/**
1024 * x86_quirk_trap_init - initialise system specific traps
1025 *
1026 * Description:
1027 * Called as the final act of trap_init(). Used in VISWS to initialise
1028 * the various board specific APIC traps.
1029 **/
1030void __init x86_quirk_trap_init(void)
1031{
1032 if (x86_quirks->arch_trap_init) {
1033 if (x86_quirks->arch_trap_init())
1034 return;
1035 }
1036}
1037
1038static struct irqaction irq0 = { 1023static struct irqaction irq0 = {
1039 .handler = timer_interrupt, 1024 .handler = timer_interrupt,
1040 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, 1025 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 7e4b1f5dec8e..ed96ed53f69e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -59,6 +59,7 @@
59#include <asm/mach_traps.h> 59#include <asm/mach_traps.h>
60 60
61#ifdef CONFIG_X86_64 61#ifdef CONFIG_X86_64
62#include <asm/x86_init.h>
62#include <asm/pgalloc.h> 63#include <asm/pgalloc.h>
63#include <asm/proto.h> 64#include <asm/proto.h>
64#else 65#else
@@ -980,7 +981,5 @@ void __init trap_init(void)
980 */ 981 */
981 cpu_init(); 982 cpu_init();
982 983
983#ifdef CONFIG_X86_32 984 x86_init.irqs.trap_init();
984 x86_quirk_trap_init();
985#endif
986} 985}
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index a49013716da9..2719091b3351 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -224,11 +224,10 @@ static void __init visws_find_smp_config(unsigned int reserve)
224 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; 224 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
225} 225}
226 226
227static int visws_trap_init(void); 227static void visws_trap_init(void);
228 228
229static struct x86_quirks visws_x86_quirks __initdata = { 229static struct x86_quirks visws_x86_quirks __initdata = {
230 .arch_time_init = visws_time_init, 230 .arch_time_init = visws_time_init,
231 .arch_trap_init = visws_trap_init,
232}; 231};
233 232
234void __init visws_early_detect(void) 233void __init visws_early_detect(void)
@@ -252,6 +251,7 @@ void __init visws_early_detect(void)
252 x86_init.mpparse.get_smp_config = visws_get_smp_config; 251 x86_init.mpparse.get_smp_config = visws_get_smp_config;
253 x86_init.mpparse.find_smp_config = visws_find_smp_config; 252 x86_init.mpparse.find_smp_config = visws_find_smp_config;
254 x86_init.irqs.pre_vector_init = visws_pre_intr_init; 253 x86_init.irqs.pre_vector_init = visws_pre_intr_init;
254 x86_init.irqs.trap_init = visws_trap_init;
255 255
256 /* 256 /*
257 * Install reboot quirks: 257 * Install reboot quirks:
@@ -390,12 +390,10 @@ static __init void cobalt_init(void)
390 co_apic_read(CO_APIC_ID)); 390 co_apic_read(CO_APIC_ID));
391} 391}
392 392
393static int __init visws_trap_init(void) 393static void __init visws_trap_init(void)
394{ 394{
395 lithium_init(); 395 lithium_init();
396 cobalt_init(); 396 cobalt_init();
397
398 return 1;
399} 397}
400 398
401/* 399/*
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 8cb59332e3b4..9f2b775dc728 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -40,5 +40,6 @@ struct __initdata x86_init_ops x86_init = {
40 .irqs = { 40 .irqs = {
41 .pre_vector_init = init_ISA_irqs, 41 .pre_vector_init = init_ISA_irqs,
42 .intr_init = native_init_IRQ, 42 .intr_init = native_init_IRQ,
43 .trap_init = x86_init_noop,
43 }, 44 },
44}; 45};