[haiku-commits] r36569 - haiku/trunk/src/add-ons/kernel/bus_managers/acpi

  • From: fredrik.holmqvist@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 1 May 2010 20:25:33 +0200 (CEST)

Author: tqh
Date: 2010-05-01 20:25:33 +0200 (Sat, 01 May 2010)
New Revision: 36569
Changeset: http://dev.haiku-os.org/changeset/36569/haiku
Ticket: http://dev.haiku-os.org/ticket/5861

Modified:
   haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c
Log:
Trying to fix #5861. As we are now so early in the boot process, we should 
really avoid functions that wait. The change in r36565 from waiting on condvar 
seems to have moved the problems over to the snooze method.
We now use spinlocks instead of snoozing while booting.


Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c  2010-05-01 
14:04:44 UTC (rev 36568)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c  2010-05-01 
18:25:33 UTC (rev 36569)
@@ -115,6 +115,7 @@
 
 
 #include <OS.h>
+#include <kernel.h>
 #include <stdio.h>
 #include <time.h>
 #include <unistd.h>
@@ -819,7 +820,10 @@
 AcpiOsSleep(ACPI_INTEGER milliseconds)
 {
        DEBUG_FUNCTION_F("milliseconds: %lu", milliseconds);
-       snooze(milliseconds * 1000);
+       if (gKernelStartup)
+               spin(milliseconds * 1000);
+       else
+               snooze(milliseconds * 1000);
 }
 
 


Other related posts: