diff options
author | jhb <jhb@FreeBSD.org> | 2014-08-30 17:48:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-08-30 17:48:38 +0000 |
commit | 59920f0385bc86c9159aeebee9795c9ad51ad015 (patch) | |
tree | 53ddc1033d8b92c20a9eb8e8550f39931d7ecc2d /sys/x86/acpica | |
parent | aabd08ca3c41f295266de306383e555c3e499125 (diff) | |
download | FreeBSD-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.c | 10 |
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 */ |