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/kernel/apic_64.c | |
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/kernel/apic_64.c')
-rw-r--r-- | arch/x86/kernel/apic_64.c | 14 |
1 files changed, 11 insertions, 3 deletions
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 | ||