summaryrefslogtreecommitdiffstats
path: root/sys/x86/acpica
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-08-30 17:48:38 +0000
committerjhb <jhb@FreeBSD.org>2014-08-30 17:48:38 +0000
commit59920f0385bc86c9159aeebee9795c9ad51ad015 (patch)
tree53ddc1033d8b92c20a9eb8e8550f39931d7ecc2d /sys/x86/acpica
parentaabd08ca3c41f295266de306383e555c3e499125 (diff)
downloadFreeBSD-src-59920f0385bc86c9159aeebee9795c9ad51ad015.zip
FreeBSD-src-59920f0385bc86c9159aeebee9795c9ad51ad015.tar.gz
Save and restore FPU state across suspend and resume. In earlier revisions
of this patch, resumectx() called npxresume() directly, but that doesn't work because resumectx() runs with a non-standard %cs selector. Instead, all of the FPU suspend/resume handling is done in C. MFC after: 1 week
Diffstat (limited to 'sys/x86/acpica')
-rw-r--r--sys/x86/acpica/acpi_wakeup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c
index 2bedf00..fb46983 100644
--- a/sys/x86/acpica/acpi_wakeup.c
+++ b/sys/x86/acpica/acpi_wakeup.c
@@ -30,6 +30,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#ifdef __i386__
+#include "opt_npx.h"
+#endif
+
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/eventhandler.h>
@@ -203,6 +207,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
if (savectx(susppcbs[0])) {
#ifdef __amd64__
fpususpend(susppcbs[0]->pcb_fpususpend);
+#elif defined(DEV_NPX)
+ npxsuspend(&susppcbs[0]->pcb_fpususpend);
#endif
#ifdef SMP
if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) {
@@ -237,6 +243,10 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
for (;;)
ia32_pause();
+ } else {
+#ifdef DEV_NPX
+ npxresume(&susppcbs[0]->pcb_fpususpend);
+#endif
}
return (1); /* wakeup successfully */
OpenPOWER on IntegriCloud