Make SMP code path conditional at run-time.

This commit is contained in:
jkim 2010-07-13 16:35:41 +00:00
parent da4d5b3dc4
commit dbfe13b6a4

View File

@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/linker.h> #include <sys/linker.h>
#include <sys/power.h> #include <sys/power.h>
#include <sys/sbuf.h> #include <sys/sbuf.h>
#ifdef SMP
#include <sys/sched.h> #include <sys/sched.h>
#endif
#include <sys/smp.h> #include <sys/smp.h>
#include <sys/timetc.h> #include <sys/timetc.h>
@ -2523,11 +2521,11 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
#ifdef SMP if (smp_started) {
thread_lock(curthread); thread_lock(curthread);
sched_bind(curthread, 0); sched_bind(curthread, 0);
thread_unlock(curthread); thread_unlock(curthread);
#endif }
/* /*
* Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE
@ -2608,11 +2606,11 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
mtx_unlock(&Giant); mtx_unlock(&Giant);
#ifdef SMP if (smp_started) {
thread_lock(curthread); thread_lock(curthread);
sched_unbind(curthread); sched_unbind(curthread);
thread_unlock(curthread); thread_unlock(curthread);
#endif }
/* Allow another sleep request after a while. */ /* Allow another sleep request after a while. */
timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME);