diff options
author | Andi Kleen <ak@suse.de> | 2008-01-30 07:30:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:40 -0500 |
commit | 739f33b38bf88312447e38ae8b7ac3acdbb72a6b (patch) | |
tree | 2d5e09f00175f7078f519609c20624a8e77f0e5b /arch/x86/kernel/apic_64.c | |
parent | 3f6e5a12b8384ab9816ba6703f4b4be87ac94b5a (diff) |
x86: untable __init references between IO data
Earlier patch added IO APIC setup into local APIC setup. This caused
modpost warnings. Fix them by untangling setup_local_APIC() and splitting
it into smaller functions. The IO APIC initialization is only called
for the BP init.
Also removed some outdated debugging code and minor cleanup.
[ tglx: arch/x86 adaptation ]
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic_64.c')
-rw-r--r-- | arch/x86/kernel/apic_64.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 994298bf4921..d341f798255c 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -677,7 +677,7 @@ void __init init_bsp_APIC(void) | |||
677 | */ | 677 | */ |
678 | void __cpuinit setup_local_APIC(void) | 678 | void __cpuinit setup_local_APIC(void) |
679 | { | 679 | { |
680 | unsigned int value, maxlvt; | 680 | unsigned int value; |
681 | int i, j; | 681 | int i, j; |
682 | 682 | ||
683 | value = apic_read(APIC_LVR); | 683 | value = apic_read(APIC_LVR); |
@@ -773,32 +773,23 @@ void __cpuinit setup_local_APIC(void) | |||
773 | else | 773 | else |
774 | value = APIC_DM_NMI | APIC_LVT_MASKED; | 774 | value = APIC_DM_NMI | APIC_LVT_MASKED; |
775 | apic_write(APIC_LVT1, value); | 775 | apic_write(APIC_LVT1, value); |
776 | } | ||
777 | |||
778 | void __cpuinit lapic_setup_esr(void) | ||
779 | { | ||
780 | unsigned maxlvt = lapic_get_maxlvt(); | ||
776 | 781 | ||
782 | apic_write(APIC_LVTERR, ERROR_APIC_VECTOR); | ||
777 | /* | 783 | /* |
778 | * Now enable IO-APICs, actually call clear_IO_APIC | 784 | * spec says clear errors after enabling vector. |
779 | * We need clear_IO_APIC before enabling vector on BP | ||
780 | */ | 785 | */ |
781 | if (!smp_processor_id() && !skip_ioapic_setup && nr_ioapics) | 786 | if (maxlvt > 3) |
782 | enable_IO_APIC(); | 787 | apic_write(APIC_ESR, 0); |
783 | 788 | } | |
784 | { | ||
785 | unsigned oldvalue; | ||
786 | maxlvt = lapic_get_maxlvt(); | ||
787 | oldvalue = apic_read(APIC_ESR); | ||
788 | value = ERROR_APIC_VECTOR; // enables sending errors | ||
789 | apic_write(APIC_LVTERR, value); | ||
790 | /* | ||
791 | * spec says clear errors after enabling vector. | ||
792 | */ | ||
793 | if (maxlvt > 3) | ||
794 | apic_write(APIC_ESR, 0); | ||
795 | value = apic_read(APIC_ESR); | ||
796 | if (value != oldvalue) | ||
797 | apic_printk(APIC_VERBOSE, | ||
798 | "ESR value after enabling vector: %08x, after %08x\n", | ||
799 | oldvalue, value); | ||
800 | } | ||
801 | 789 | ||
790 | void __cpuinit end_local_APIC_setup(void) | ||
791 | { | ||
792 | lapic_setup_esr(); | ||
802 | nmi_watchdog_default(); | 793 | nmi_watchdog_default(); |
803 | setup_apic_nmi_watchdog(NULL); | 794 | setup_apic_nmi_watchdog(NULL); |
804 | apic_pm_activate(); | 795 | apic_pm_activate(); |
@@ -879,6 +870,15 @@ int __init APIC_init_uniprocessor(void) | |||
879 | 870 | ||
880 | setup_local_APIC(); | 871 | setup_local_APIC(); |
881 | 872 | ||
873 | /* | ||
874 | * Now enable IO-APICs, actually call clear_IO_APIC | ||
875 | * We need clear_IO_APIC before enabling vector on BP | ||
876 | */ | ||
877 | if (!skip_ioapic_setup && nr_ioapics) | ||
878 | enable_IO_APIC(); | ||
879 | |||
880 | end_local_APIC_setup(); | ||
881 | |||
882 | if (smp_found_config && !skip_ioapic_setup && nr_ioapics) | 882 | if (smp_found_config && !skip_ioapic_setup && nr_ioapics) |
883 | setup_IO_APIC(); | 883 | setup_IO_APIC(); |
884 | else | 884 | else |