From 59920f0385bc86c9159aeebee9795c9ad51ad015 Mon Sep 17 00:00:00 2001 From: jhb Date: Sat, 30 Aug 2014 17:48:38 +0000 Subject: 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 --- sys/x86/acpica/acpi_wakeup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/x86/acpica') 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 __FBSDID("$FreeBSD$"); +#ifdef __i386__ +#include "opt_npx.h" +#endif + #include #include #include @@ -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 */ -- cgit v1.1