diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 15:21:36 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 15:21:36 -0400 |
commit | 85cc35fa7255d113b5383a9c8536c363274bb475 (patch) | |
tree | de41a35a212984d3f93b77177eb2e7ffabe2038d /arch/x86/kernel/mpparse.c | |
parent | 136ef671df04dc157afa0d4b96c7bd23ba072c9c (diff) |
x86: fix mpparse fallout
UP builds with LOCAL_APIC=y and IO_APIC=n fail with a missing
reference to mp_bus_not_pci. Distangle the mpparse code some more and
move the ioapic specific bus check into a separate function.
This code needs sume urgent un#ifdef surgery all over the place.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/mpparse.c')
-rw-r--r-- | arch/x86/kernel/mpparse.c | 73 |
1 files changed, 41 insertions, 32 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index e8e041ed84d6..9f3792d55044 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -81,6 +81,7 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | |||
81 | generic_processor_info(apicid, m->mpc_apicver); | 81 | generic_processor_info(apicid, m->mpc_apicver); |
82 | } | 82 | } |
83 | 83 | ||
84 | #ifdef CONFIG_X86_IO_APIC | ||
84 | static void __init MP_bus_info(struct mpc_config_bus *m) | 85 | static void __init MP_bus_info(struct mpc_config_bus *m) |
85 | { | 86 | { |
86 | char str[7]; | 87 | char str[7]; |
@@ -122,6 +123,7 @@ static void __init MP_bus_info(struct mpc_config_bus *m) | |||
122 | } else | 123 | } else |
123 | printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); | 124 | printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); |
124 | } | 125 | } |
126 | #endif | ||
125 | 127 | ||
126 | #ifdef CONFIG_X86_IO_APIC | 128 | #ifdef CONFIG_X86_IO_APIC |
127 | 129 | ||
@@ -336,7 +338,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | |||
336 | { | 338 | { |
337 | struct mpc_config_bus *m = | 339 | struct mpc_config_bus *m = |
338 | (struct mpc_config_bus *)mpt; | 340 | (struct mpc_config_bus *)mpt; |
341 | #ifdef CONFIG_X86_IO_APIC | ||
339 | MP_bus_info(m); | 342 | MP_bus_info(m); |
343 | #endif | ||
340 | mpt += sizeof(*m); | 344 | mpt += sizeof(*m); |
341 | count += sizeof(*m); | 345 | count += sizeof(*m); |
342 | break; | 346 | break; |
@@ -472,40 +476,11 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type) | |||
472 | MP_intsrc_info(&intsrc); | 476 | MP_intsrc_info(&intsrc); |
473 | } | 477 | } |
474 | 478 | ||
475 | #endif | ||
476 | 479 | ||
477 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) | 480 | static void construct_ioapic_table(int mpc_default_type) |
478 | { | 481 | { |
479 | struct mpc_config_processor processor; | ||
480 | struct mpc_config_bus bus; | ||
481 | #ifdef CONFIG_X86_IO_APIC | ||
482 | struct mpc_config_ioapic ioapic; | 482 | struct mpc_config_ioapic ioapic; |
483 | #endif | 483 | struct mpc_config_bus bus; |
484 | struct mpc_config_lintsrc lintsrc; | ||
485 | int linttypes[2] = { mp_ExtINT, mp_NMI }; | ||
486 | int i; | ||
487 | |||
488 | /* | ||
489 | * local APIC has default address | ||
490 | */ | ||
491 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; | ||
492 | |||
493 | /* | ||
494 | * 2 CPUs, numbered 0 & 1. | ||
495 | */ | ||
496 | processor.mpc_type = MP_PROCESSOR; | ||
497 | /* Either an integrated APIC or a discrete 82489DX. */ | ||
498 | processor.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; | ||
499 | processor.mpc_cpuflag = CPU_ENABLED; | ||
500 | processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | | ||
501 | (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; | ||
502 | processor.mpc_featureflag = boot_cpu_data.x86_capability[0]; | ||
503 | processor.mpc_reserved[0] = 0; | ||
504 | processor.mpc_reserved[1] = 0; | ||
505 | for (i = 0; i < 2; i++) { | ||
506 | processor.mpc_apicid = i; | ||
507 | MP_processor_info(&processor); | ||
508 | } | ||
509 | 484 | ||
510 | bus.mpc_type = MP_BUS; | 485 | bus.mpc_type = MP_BUS; |
511 | bus.mpc_busid = 0; | 486 | bus.mpc_busid = 0; |
@@ -534,7 +509,6 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) | |||
534 | MP_bus_info(&bus); | 509 | MP_bus_info(&bus); |
535 | } | 510 | } |
536 | 511 | ||
537 | #ifdef CONFIG_X86_IO_APIC | ||
538 | ioapic.mpc_type = MP_IOAPIC; | 512 | ioapic.mpc_type = MP_IOAPIC; |
539 | ioapic.mpc_apicid = 2; | 513 | ioapic.mpc_apicid = 2; |
540 | ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; | 514 | ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; |
@@ -546,7 +520,42 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) | |||
546 | * We set up most of the low 16 IO-APIC pins according to MPS rules. | 520 | * We set up most of the low 16 IO-APIC pins according to MPS rules. |
547 | */ | 521 | */ |
548 | construct_default_ioirq_mptable(mpc_default_type); | 522 | construct_default_ioirq_mptable(mpc_default_type); |
523 | } | ||
524 | #else | ||
525 | static inline void construct_ioapic_table(int mpc_default_type) { } | ||
549 | #endif | 526 | #endif |
527 | |||
528 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) | ||
529 | { | ||
530 | struct mpc_config_processor processor; | ||
531 | struct mpc_config_lintsrc lintsrc; | ||
532 | int linttypes[2] = { mp_ExtINT, mp_NMI }; | ||
533 | int i; | ||
534 | |||
535 | /* | ||
536 | * local APIC has default address | ||
537 | */ | ||
538 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; | ||
539 | |||
540 | /* | ||
541 | * 2 CPUs, numbered 0 & 1. | ||
542 | */ | ||
543 | processor.mpc_type = MP_PROCESSOR; | ||
544 | /* Either an integrated APIC or a discrete 82489DX. */ | ||
545 | processor.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; | ||
546 | processor.mpc_cpuflag = CPU_ENABLED; | ||
547 | processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | | ||
548 | (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; | ||
549 | processor.mpc_featureflag = boot_cpu_data.x86_capability[0]; | ||
550 | processor.mpc_reserved[0] = 0; | ||
551 | processor.mpc_reserved[1] = 0; | ||
552 | for (i = 0; i < 2; i++) { | ||
553 | processor.mpc_apicid = i; | ||
554 | MP_processor_info(&processor); | ||
555 | } | ||
556 | |||
557 | construct_ioapic_table(mpc_default_type); | ||
558 | |||
550 | lintsrc.mpc_type = MP_LINTSRC; | 559 | lintsrc.mpc_type = MP_LINTSRC; |
551 | lintsrc.mpc_irqflag = 0; /* conforming */ | 560 | lintsrc.mpc_irqflag = 0; /* conforming */ |
552 | lintsrc.mpc_srcbusid = 0; | 561 | lintsrc.mpc_srcbusid = 0; |