Author: jkim
Date: Tue Jul 13 16:35:41 2010
New Revision: 210003
URL: http://svn.freebsd.org/changeset/base/210003
Log:
Make SMP code path conditional at run-time.
Modified:
head/sys/dev/acpica/acpi.c
Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c Tue Jul 13 16:24:04 2010 (r210002)
+++ head/sys/dev/acpica/acpi.c Tue Jul 13 16:35:41 2010 (r210003)
@@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/linker.h>
#include <sys/power.h>
#include <sys/sbuf.h>
-#ifdef SMP
#include <sys/sched.h>
-#endif
#include <sys/smp.h>
#include <sys/timetc.h>
@@ -2523,11 +2521,11 @@ acpi_EnterSleepState(struct acpi_softc *
return_ACPI_STATUS (AE_OK);
}
-#ifdef SMP
- thread_lock(curthread);
- sched_bind(curthread, 0);
- thread_unlock(curthread);
-#endif
+ if (smp_started) {
+ thread_lock(curthread);
+ sched_bind(curthread, 0);
+ thread_unlock(curthread);
+ }
/*
* Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE
@@ -2608,11 +2606,11 @@ backout:
mtx_unlock(&Giant);
-#ifdef SMP
- thread_lock(curthread);
- sched_unbind(curthread);
- thread_unlock(curthread);
-#endif
+ if (smp_started) {
+ thread_lock(curthread);
+ sched_unbind(curthread);
+ thread_unlock(curthread);
+ }
/* Allow another sleep request after a while. */
timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"