diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-20 03:27:29 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-27 11:12:52 -0400 |
| commit | de93410310952fb7b705f784ef22493c8362dbe8 (patch) | |
| tree | ebf9925e8f78343ddb24049cc9146ead4df34661 | |
| parent | f4848472cd99487e182b64fb2a5d0e4fedbe86ad (diff) | |
x86: Move ioapic_ids_setup to x86_init_ops
32bit and also the numaq code have special requirements on the
ioapic_id setup. Convert it to a x86_init_ops function and get rid
of the quirks and #ifdefs
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| -rw-r--r-- | arch/x86/include/asm/io_apic.h | 3 | ||||
| -rw-r--r-- | arch/x86/include/asm/setup.h | 1 | ||||
| -rw-r--r-- | arch/x86/include/asm/x86_init.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 11 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 8 | ||||
| -rw-r--r-- | arch/x86/kernel/head32.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/x86_init.c | 1 |
7 files changed, 13 insertions, 16 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 330ee807f89e..2b8aeb89933a 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
| @@ -177,12 +177,13 @@ extern int setup_ioapic_entry(int apic, int irq, | |||
| 177 | int polarity, int vector, int pin); | 177 | int polarity, int vector, int pin); |
| 178 | extern void ioapic_write_entry(int apic, int pin, | 178 | extern void ioapic_write_entry(int apic, int pin, |
| 179 | struct IO_APIC_route_entry e); | 179 | struct IO_APIC_route_entry e); |
| 180 | extern void setup_ioapic_ids_from_mpc(void); | ||
| 180 | #else /* !CONFIG_X86_IO_APIC */ | 181 | #else /* !CONFIG_X86_IO_APIC */ |
| 181 | #define io_apic_assign_pci_irqs 0 | 182 | #define io_apic_assign_pci_irqs 0 |
| 183 | #define setup_ioapic_ids_from_mpc x86_init_noop | ||
| 182 | static const int timer_through_8259 = 0; | 184 | static const int timer_through_8259 = 0; |
| 183 | static inline void ioapic_init_mappings(void) { } | 185 | static inline void ioapic_init_mappings(void) { } |
| 184 | static inline void ioapic_insert_resources(void) { } | 186 | static inline void ioapic_insert_resources(void) { } |
| 185 | |||
| 186 | static inline void probe_nr_irqs_gsi(void) { } | 187 | static inline void probe_nr_irqs_gsi(void) { } |
| 187 | #endif | 188 | #endif |
| 188 | 189 | ||
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index bbf2dfd59b47..cc8b4b0550ea 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
| @@ -30,7 +30,6 @@ struct x86_quirks { | |||
| 30 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); | 30 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); |
| 31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, | 31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, |
| 32 | unsigned short oemsize); | 32 | unsigned short oemsize); |
| 33 | int (*setup_ioapic_ids)(void); | ||
| 34 | }; | 33 | }; |
| 35 | 34 | ||
| 36 | extern void x86_quirk_intr_init(void); | 35 | extern void x86_quirk_intr_init(void); |
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 10b297b1881a..65985730b376 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
| @@ -4,9 +4,11 @@ | |||
| 4 | /** | 4 | /** |
| 5 | * struct x86_init_mpparse - platform specific mpparse ops | 5 | * struct x86_init_mpparse - platform specific mpparse ops |
| 6 | * @mpc_record: platform specific mpc record accounting | 6 | * @mpc_record: platform specific mpc record accounting |
| 7 | * @setup_ioapic_ids: platform specific ioapic id override | ||
| 7 | */ | 8 | */ |
| 8 | struct x86_init_mpparse { | 9 | struct x86_init_mpparse { |
| 9 | void (*mpc_record)(unsigned int mode); | 10 | void (*mpc_record)(unsigned int mode); |
| 11 | void (*setup_ioapic_ids)(void); | ||
| 10 | }; | 12 | }; |
| 11 | 13 | ||
| 12 | /** | 14 | /** |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index d2ed6c5ddc80..5f4687187ceb 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -2014,7 +2014,7 @@ void disable_IO_APIC(void) | |||
| 2014 | * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999 | 2014 | * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999 |
| 2015 | */ | 2015 | */ |
| 2016 | 2016 | ||
| 2017 | static void __init setup_ioapic_ids_from_mpc(void) | 2017 | void __init setup_ioapic_ids_from_mpc(void) |
| 2018 | { | 2018 | { |
| 2019 | union IO_APIC_reg_00 reg_00; | 2019 | union IO_APIC_reg_00 reg_00; |
| 2020 | physid_mask_t phys_id_present_map; | 2020 | physid_mask_t phys_id_present_map; |
| @@ -2023,9 +2023,8 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
| 2023 | unsigned char old_id; | 2023 | unsigned char old_id; |
| 2024 | unsigned long flags; | 2024 | unsigned long flags; |
| 2025 | 2025 | ||
| 2026 | if (x86_quirks->setup_ioapic_ids && x86_quirks->setup_ioapic_ids()) | 2026 | if (acpi_ioapic) |
| 2027 | return; | 2027 | return; |
| 2028 | |||
| 2029 | /* | 2028 | /* |
| 2030 | * Don't check I/O APIC IDs for xAPIC systems. They have | 2029 | * Don't check I/O APIC IDs for xAPIC systems. They have |
| 2031 | * no meaning without the serial APIC bus. | 2030 | * no meaning without the serial APIC bus. |
| @@ -3061,10 +3060,8 @@ void __init setup_IO_APIC(void) | |||
| 3061 | /* | 3060 | /* |
| 3062 | * Set up IO-APIC IRQ routing. | 3061 | * Set up IO-APIC IRQ routing. |
| 3063 | */ | 3062 | */ |
| 3064 | #ifdef CONFIG_X86_32 | 3063 | x86_init.mpparse.setup_ioapic_ids(); |
| 3065 | if (!acpi_ioapic) | 3064 | |
| 3066 | setup_ioapic_ids_from_mpc(); | ||
| 3067 | #endif | ||
| 3068 | sync_Arb_IDs(); | 3065 | sync_Arb_IDs(); |
| 3069 | setup_IO_APIC_irqs(); | 3066 | setup_IO_APIC_irqs(); |
| 3070 | init_IO_APIC_traps(); | 3067 | init_IO_APIC_traps(); |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index b5f0b1dc7dd0..f3717659265d 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
| @@ -262,12 +262,6 @@ static void __init | |||
| 262 | } | 262 | } |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | static int __init numaq_setup_ioapic_ids(void) | ||
| 266 | { | ||
| 267 | /* so can skip it */ | ||
| 268 | return 1; | ||
| 269 | } | ||
| 270 | |||
| 271 | static struct x86_quirks numaq_x86_quirks __initdata = { | 265 | static struct x86_quirks numaq_x86_quirks __initdata = { |
| 272 | .arch_pre_time_init = numaq_pre_time_init, | 266 | .arch_pre_time_init = numaq_pre_time_init, |
| 273 | .arch_time_init = NULL, | 267 | .arch_time_init = NULL, |
| @@ -280,7 +274,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
| 280 | .mpc_oem_bus_info = mpc_oem_bus_info, | 274 | .mpc_oem_bus_info = mpc_oem_bus_info, |
| 281 | .mpc_oem_pci_bus = mpc_oem_pci_bus, | 275 | .mpc_oem_pci_bus = mpc_oem_pci_bus, |
| 282 | .smp_read_mpc_oem = smp_read_mpc_oem, | 276 | .smp_read_mpc_oem = smp_read_mpc_oem, |
| 283 | .setup_ioapic_ids = numaq_setup_ioapic_ids, | ||
| 284 | }; | 277 | }; |
| 285 | 278 | ||
| 286 | static __init void early_check_numaq(void) | 279 | static __init void early_check_numaq(void) |
| @@ -299,6 +292,7 @@ static __init void early_check_numaq(void) | |||
| 299 | if (found_numaq) { | 292 | if (found_numaq) { |
| 300 | x86_quirks = &numaq_x86_quirks; | 293 | x86_quirks = &numaq_x86_quirks; |
| 301 | x86_init.mpparse.mpc_record = numaq_mpc_record; | 294 | x86_init.mpparse.mpc_record = numaq_mpc_record; |
| 295 | x86_init.mpparse.setup_ioapic_ids = x86_init_noop; | ||
| 302 | } | 296 | } |
| 303 | } | 297 | } |
| 304 | 298 | ||
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index 921a23b6c145..a21398fac4fa 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #include <asm/e820.h> | 13 | #include <asm/e820.h> |
| 14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
| 15 | #include <asm/trampoline.h> | 15 | #include <asm/trampoline.h> |
| 16 | #include <asm/apic.h> | ||
| 17 | #include <asm/io_apic.h> | ||
| 16 | 18 | ||
| 17 | void __init i386_start_kernel(void) | 19 | void __init i386_start_kernel(void) |
| 18 | { | 20 | { |
| @@ -32,6 +34,7 @@ void __init i386_start_kernel(void) | |||
| 32 | /* Initilize 32bit specific setup functions */ | 34 | /* Initilize 32bit specific setup functions */ |
| 33 | x86_init.resources.probe_roms = probe_roms; | 35 | x86_init.resources.probe_roms = probe_roms; |
| 34 | x86_init.resources.reserve_resources = i386_reserve_resources; | 36 | x86_init.resources.reserve_resources = i386_reserve_resources; |
| 37 | x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc; | ||
| 35 | 38 | ||
| 36 | x86_init.resources.reserve_ebda_region(); | 39 | x86_init.resources.reserve_ebda_region(); |
| 37 | 40 | ||
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 83bd5db376ba..f4a32b3ab024 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
| @@ -27,5 +27,6 @@ struct __initdata x86_init_ops x86_init = { | |||
| 27 | 27 | ||
| 28 | .mpparse = { | 28 | .mpparse = { |
| 29 | .mpc_record = x86_init_uint_noop, | 29 | .mpc_record = x86_init_uint_noop, |
| 30 | .setup_ioapic_ids = x86_init_noop, | ||
| 30 | }, | 31 | }, |
| 31 | }; | 32 | }; |
