diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2010-07-01 00:48:49 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2010-07-01 00:48:49 +0000 |
commit | 16368b1774dec7d3952aa00e3978d0c5488eff45 (patch) | |
tree | 17f9866368f1ed01d0c1287e4d1ec6646b000b90 /sys | |
parent | 8e8d648bfa1b2e70d8c8790eca4a32160e99156b (diff) |
More accurate comment as to what happens with acpi_savecpu
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/i386/acpi_machdep.c | 18 |
2 files changed, 15 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index 8fde0558fc6..16637cbccd1 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.36 2010/06/26 04:05:32 mlarkin Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.37 2010/07/01 00:48:48 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -225,8 +225,12 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) if (sc->sc_facs->version == 1) sc->sc_facs->x_wakeup_vector = 0; - /* Copy the current cpu registers into a safe place for resume. */ + /* Copy the current cpu registers into a safe place for resume. + * acpi_savecpu actually returns twice - once in the suspend + * path and once in the resume path (see setjmp(3)). + */ if (acpi_savecpu()) { + /* Suspend path */ fpusave_cpu(curcpu(), 1); #ifdef MULTIPROCESSOR x86_broadcast_ipi(X86_IPI_FLUSH_FPU); @@ -236,6 +240,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) acpi_enter_sleep_state(sc, state); panic("%s: acpi_enter_sleep_state failed", DEVNAME(sc)); } + + /* Resume path continues here */ #if 0 /* Temporarily disabled for debugging purposes */ /* Reset the wakeup vector to avoid resuming on reboot */ diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index d7caf9980c2..14e811e0ca3 100644 --- a/sys/arch/i386/i386/acpi_machdep.c +++ b/sys/arch/i386/i386/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.30 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.31 2010/07/01 00:48:48 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -243,8 +243,12 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) if (sc->sc_facs->version == 1) sc->sc_facs->x_wakeup_vector = 0; - /* Copy the current cpu registers into a safe place for resume. */ + /* Copy the current cpu registers into a safe place for resume. + * acpi_savecpu actually returns twice - once in the suspend + * path and once in the resume path (see setjmp(3)). + */ if (acpi_savecpu()) { + /* Suspend path */ npxsave_cpu(curcpu(), 1); #ifdef MULTIPROCESSOR i386_broadcast_ipi(I386_IPI_FLUSH_FPU); @@ -255,15 +259,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) panic("%s: acpi_enter_sleep_state failed", DEVNAME(sc)); } - /* - * On resume, the execution path will actually occur here. - * This is because we previously saved the stack location - * in acpi_savecpu, and issued a far jmp to the restore - * routine in the wakeup code. This means we are - * returning to the location immediately following the - * last call instruction - after the call to acpi_savecpu. - */ - + /* Resume path continues here */ #if 0 /* Temporarily disabled for debugging purposes */ /* Reset the wakeup vector to avoid resuming on reboot */ |