Date: Tue, 13 Jul 2010 16:35:42 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r210003 - head/sys/dev/acpica Message-ID: <201007131635.o6DGZgUq092661@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007131635.o6DGZgUq092661>