]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: apic - unify lapic_shutdown
authorCyrill Gorcunov <gorcunov@gmail.com>
Mon, 18 Aug 2008 16:45:52 +0000 (20:45 +0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 19 Aug 2008 00:07:13 +0000 (02:07 +0200)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic_32.c
arch/x86/kernel/apic_64.c

index 13c4b79441da07e54cf9682940308bc69e5a6804..d4efe86adc72fea62c3c31938b265813525c4f8a 100644 (file)
@@ -838,10 +838,13 @@ void lapic_shutdown(void)
 
        local_irq_save(flags);
 
-       if (enabled_via_apicbase)
-               disable_local_APIC();
-       else
+#ifdef CONFIG_X86_32
+       if (!enabled_via_apicbase)
                clear_local_APIC();
+       else
+#endif
+               disable_local_APIC();
+
 
        local_irq_restore(flags);
 }
index 4fb903b2fc39ef672af945b0f87fc8e86ed28cab..48806546d49ff2f74202ded6976a37f701b01100 100644 (file)
@@ -707,6 +707,12 @@ void disable_local_APIC(void)
 #endif
 }
 
+/*
+ * If Linux enabled the LAPIC against the BIOS default disable it down before
+ * re-entering the BIOS on shutdown.  Otherwise the BIOS may get confused and
+ * not power-off.  Additionally clear all LVT entries before disable_local_APIC
+ * for the case where Linux didn't enable the LAPIC.
+ */
 void lapic_shutdown(void)
 {
        unsigned long flags;
@@ -716,7 +722,13 @@ void lapic_shutdown(void)
 
        local_irq_save(flags);
 
-       disable_local_APIC();
+#ifdef CONFIG_X86_32
+       if (!enabled_via_apicbase)
+               clear_local_APIC();
+       else
+#endif
+               disable_local_APIC();
+
 
        local_irq_restore(flags);
 }