diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-15 15:05:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-16 09:37:45 -0400 |
commit | 638c0411922540deaf8797cacf73513b17618405 (patch) | |
tree | e857df3c688aeea198eb31eb2c8597d3a8f08c25 /arch/x86 | |
parent | 6f6da97faf29f87b3980a6992fb8cab44b4c444d (diff) |
x86: apic - unify init_bsp_APIC
- remove redundant read of APIC_LVR register in 64bit mode
- APIC is always integrated for 64bit mode so
gcc will eliminate lapic_is_integrated call
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 60575c05151a..16d9721788c1 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -925,7 +925,7 @@ void __init sync_Arb_IDs(void) | |||
925 | */ | 925 | */ |
926 | void __init init_bsp_APIC(void) | 926 | void __init init_bsp_APIC(void) |
927 | { | 927 | { |
928 | unsigned long value; | 928 | unsigned int value; |
929 | 929 | ||
930 | /* | 930 | /* |
931 | * Don't do the setup now if we have a SMP BIOS as the | 931 | * Don't do the setup now if we have a SMP BIOS as the |
@@ -946,11 +946,13 @@ void __init init_bsp_APIC(void) | |||
946 | value &= ~APIC_VECTOR_MASK; | 946 | value &= ~APIC_VECTOR_MASK; |
947 | value |= APIC_SPIV_APIC_ENABLED; | 947 | value |= APIC_SPIV_APIC_ENABLED; |
948 | 948 | ||
949 | #ifdef CONFIG_X86_32 | ||
949 | /* This bit is reserved on P4/Xeon and should be cleared */ | 950 | /* This bit is reserved on P4/Xeon and should be cleared */ |
950 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && | 951 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && |
951 | (boot_cpu_data.x86 == 15)) | 952 | (boot_cpu_data.x86 == 15)) |
952 | value &= ~APIC_SPIV_FOCUS_DISABLED; | 953 | value &= ~APIC_SPIV_FOCUS_DISABLED; |
953 | else | 954 | else |
955 | #endif | ||
954 | value |= APIC_SPIV_FOCUS_DISABLED; | 956 | value |= APIC_SPIV_FOCUS_DISABLED; |
955 | value |= SPURIOUS_APIC_VECTOR; | 957 | value |= SPURIOUS_APIC_VECTOR; |
956 | apic_write(APIC_SPIV, value); | 958 | apic_write(APIC_SPIV, value); |
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 72e94ab0e364..99d18b8976a5 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -773,8 +773,6 @@ void __init init_bsp_APIC(void) | |||
773 | if (smp_found_config || !cpu_has_apic) | 773 | if (smp_found_config || !cpu_has_apic) |
774 | return; | 774 | return; |
775 | 775 | ||
776 | value = apic_read(APIC_LVR); | ||
777 | |||
778 | /* | 776 | /* |
779 | * Do not trust the local APIC being empty at bootup. | 777 | * Do not trust the local APIC being empty at bootup. |
780 | */ | 778 | */ |
@@ -786,7 +784,15 @@ void __init init_bsp_APIC(void) | |||
786 | value = apic_read(APIC_SPIV); | 784 | value = apic_read(APIC_SPIV); |
787 | value &= ~APIC_VECTOR_MASK; | 785 | value &= ~APIC_VECTOR_MASK; |
788 | value |= APIC_SPIV_APIC_ENABLED; | 786 | value |= APIC_SPIV_APIC_ENABLED; |
789 | value |= APIC_SPIV_FOCUS_DISABLED; | 787 | |
788 | #ifdef CONFIG_X86_32 | ||
789 | /* This bit is reserved on P4/Xeon and should be cleared */ | ||
790 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && | ||
791 | (boot_cpu_data.x86 == 15)) | ||
792 | value &= ~APIC_SPIV_FOCUS_DISABLED; | ||
793 | else | ||
794 | #endif | ||
795 | value |= APIC_SPIV_FOCUS_DISABLED; | ||
790 | value |= SPURIOUS_APIC_VECTOR; | 796 | value |= SPURIOUS_APIC_VECTOR; |
791 | apic_write(APIC_SPIV, value); | 797 | apic_write(APIC_SPIV, value); |
792 | 798 | ||
@@ -795,6 +801,8 @@ void __init init_bsp_APIC(void) | |||
795 | */ | 801 | */ |
796 | apic_write(APIC_LVT0, APIC_DM_EXTINT); | 802 | apic_write(APIC_LVT0, APIC_DM_EXTINT); |
797 | value = APIC_DM_NMI; | 803 | value = APIC_DM_NMI; |
804 | if (!lapic_is_integrated()) /* 82489DX */ | ||
805 | value |= APIC_LVT_LEVEL_TRIGGER; | ||
798 | apic_write(APIC_LVT1, value); | 806 | apic_write(APIC_LVT1, value); |
799 | } | 807 | } |
800 | 808 | ||