[haiku-commits] r37635 - haiku/trunk/src/system/kernel/arch/x86

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 20 Jul 2010 23:45:49 +0200 (CEST)

Author: axeld
Date: 2010-07-20 23:45:48 +0200 (Tue, 20 Jul 2010)
New Revision: 37635
Changeset: http://dev.haiku-os.org/changeset/37635

Modified:
   haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp
Log:
* Added some test code to make sure that we run on the boot CPU on shutdown;
  I haven't tested it on the problematic machine yet, though.


Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2010-07-20 21:20:36 UTC 
(rev 37634)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.cpp 2010-07-20 21:45:48 UTC 
(rev 37635)
@@ -913,6 +913,13 @@
 status_t
 arch_cpu_shutdown(bool rebootSystem)
 {
+       // Make sure we run on the boot CPU (apparently needed for ACPI)
+       _user_set_cpu_enabled(0, true);
+       for (int32 cpu = 1; cpu < smp_get_num_cpus(); cpu++) {
+               _user_set_cpu_enabled(cpu, false);
+       }
+       thread_yield(true);
+
        if (acpi_shutdown(rebootSystem) == B_OK)
                return B_OK;
 


Other related posts:

  • » [haiku-commits] r37635 - haiku/trunk/src/system/kernel/arch/x86 - axeld