diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-18 12:45:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-18 20:07:13 -0400 |
commit | 990b183e58cb513a62492b6218987750e106cbfb (patch) | |
tree | b9d20863c9dba4bddb8a78a45a813120ed354d29 /arch | |
parent | f1ee37891dab6014f6b0ec77b18bc07e2369a55f (diff) |
x86: apic - unify disable_local_APIC
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/apic_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 80db3e0426c4..13c4b79441da 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -796,7 +796,7 @@ void clear_local_APIC(void) | |||
796 | */ | 796 | */ |
797 | void disable_local_APIC(void) | 797 | void disable_local_APIC(void) |
798 | { | 798 | { |
799 | unsigned long value; | 799 | unsigned int value; |
800 | 800 | ||
801 | clear_local_APIC(); | 801 | clear_local_APIC(); |
802 | 802 | ||
@@ -808,6 +808,7 @@ void disable_local_APIC(void) | |||
808 | value &= ~APIC_SPIV_APIC_ENABLED; | 808 | value &= ~APIC_SPIV_APIC_ENABLED; |
809 | apic_write(APIC_SPIV, value); | 809 | apic_write(APIC_SPIV, value); |
810 | 810 | ||
811 | #ifdef CONFIG_X86_32 | ||
811 | /* | 812 | /* |
812 | * When LAPIC was disabled by the BIOS and enabled by the kernel, | 813 | * When LAPIC was disabled by the BIOS and enabled by the kernel, |
813 | * restore the disabled state. | 814 | * restore the disabled state. |
@@ -819,6 +820,7 @@ void disable_local_APIC(void) | |||
819 | l &= ~MSR_IA32_APICBASE_ENABLE; | 820 | l &= ~MSR_IA32_APICBASE_ENABLE; |
820 | wrmsr(MSR_IA32_APICBASE, l, h); | 821 | wrmsr(MSR_IA32_APICBASE, l, h); |
821 | } | 822 | } |
823 | #endif | ||
822 | } | 824 | } |
823 | 825 | ||
824 | /* | 826 | /* |
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 46acb9b47ae7..4fb903b2fc39 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -691,6 +691,20 @@ void disable_local_APIC(void) | |||
691 | value = apic_read(APIC_SPIV); | 691 | value = apic_read(APIC_SPIV); |
692 | value &= ~APIC_SPIV_APIC_ENABLED; | 692 | value &= ~APIC_SPIV_APIC_ENABLED; |
693 | apic_write(APIC_SPIV, value); | 693 | apic_write(APIC_SPIV, value); |
694 | |||
695 | #ifdef CONFIG_X86_32 | ||
696 | /* | ||
697 | * When LAPIC was disabled by the BIOS and enabled by the kernel, | ||
698 | * restore the disabled state. | ||
699 | */ | ||
700 | if (enabled_via_apicbase) { | ||
701 | unsigned int l, h; | ||
702 | |||
703 | rdmsr(MSR_IA32_APICBASE, l, h); | ||
704 | l &= ~MSR_IA32_APICBASE_ENABLE; | ||
705 | wrmsr(MSR_IA32_APICBASE, l, h); | ||
706 | } | ||
707 | #endif | ||
694 | } | 708 | } |
695 | 709 | ||
696 | void lapic_shutdown(void) | 710 | void lapic_shutdown(void) |