diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-18 12:45:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-18 20:07:13 -0400 |
commit | fe4024dcb0c01e5399394d2807406a2c13fb1eb7 (patch) | |
tree | b8d80e4c79b2b7fa058c788fb895f0414255ce87 /arch | |
parent | 990b183e58cb513a62492b6218987750e106cbfb (diff) |
x86: apic - unify lapic_shutdown
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 | 9 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 14 |
2 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 13c4b79441da..d4efe86adc72 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -838,10 +838,13 @@ void lapic_shutdown(void) | |||
838 | 838 | ||
839 | local_irq_save(flags); | 839 | local_irq_save(flags); |
840 | 840 | ||
841 | if (enabled_via_apicbase) | 841 | #ifdef CONFIG_X86_32 |
842 | disable_local_APIC(); | 842 | if (!enabled_via_apicbase) |
843 | else | ||
844 | clear_local_APIC(); | 843 | clear_local_APIC(); |
844 | else | ||
845 | #endif | ||
846 | disable_local_APIC(); | ||
847 | |||
845 | 848 | ||
846 | local_irq_restore(flags); | 849 | local_irq_restore(flags); |
847 | } | 850 | } |
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 4fb903b2fc39..48806546d49f 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -707,6 +707,12 @@ void disable_local_APIC(void) | |||
707 | #endif | 707 | #endif |
708 | } | 708 | } |
709 | 709 | ||
710 | /* | ||
711 | * If Linux enabled the LAPIC against the BIOS default disable it down before | ||
712 | * re-entering the BIOS on shutdown. Otherwise the BIOS may get confused and | ||
713 | * not power-off. Additionally clear all LVT entries before disable_local_APIC | ||
714 | * for the case where Linux didn't enable the LAPIC. | ||
715 | */ | ||
710 | void lapic_shutdown(void) | 716 | void lapic_shutdown(void) |
711 | { | 717 | { |
712 | unsigned long flags; | 718 | unsigned long flags; |
@@ -716,7 +722,13 @@ void lapic_shutdown(void) | |||
716 | 722 | ||
717 | local_irq_save(flags); | 723 | local_irq_save(flags); |
718 | 724 | ||
719 | disable_local_APIC(); | 725 | #ifdef CONFIG_X86_32 |
726 | if (!enabled_via_apicbase) | ||
727 | clear_local_APIC(); | ||
728 | else | ||
729 | #endif | ||
730 | disable_local_APIC(); | ||
731 | |||
720 | 732 | ||
721 | local_irq_restore(flags); | 733 | local_irq_restore(flags); |
722 | } | 734 | } |