summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2009-11-26 00:14:12 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2009-11-26 00:14:12 +0000
commitc6188fdde5deb0c9d44887457d84736e66e19ae0 (patch)
tree395dc696e1a7060a464914084f8e9bcc8f312c36 /sys
parent76fd7ffdc11cba1cb8d764a1ce63ab2eceba8abd (diff)
Fix a stack problem on amd64, now the resume functions get called properly.
Tested mlarkin on thinkpad x60, pirofti on dell d620, and deraadt on thinkpad T61. ok deraadt@, pirofti@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/acpi_machdep.c15
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S3
2 files changed, 5 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c
index 2f040d950d6..a5e29fdf655 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.26 2009/11/24 17:39:59 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.27 2009/11/26 00:14:11 mlarkin Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -227,19 +227,10 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
if (acpi_savecpu()) {
fpusave_cpu(curcpu(), 1);
wbinvd();
- acpi_enter_sleep_state(sc, state);
- panic("%s: acpi_enter_sleep_state failed", DEVNAME(sc));
+ if (acpi_enter_sleep_state(sc, state) != 0)
+ 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.
- */
-
#if NISA > 0
i8259_default_setup();
#endif
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index d1f86ecfa21..1c13e6ddf0f 100644
--- a/sys/arch/amd64/amd64/acpi_wakecode.S
+++ b/sys/arch/amd64/amd64/acpi_wakecode.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_wakecode.S,v 1.6 2009/11/25 15:41:43 pirofti Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.7 2009/11/26 00:14:11 mlarkin Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -586,6 +586,7 @@ NENTRY(acpi_savecpu)
movq %rsi, acpi_saved_rsi
movq %rdi, acpi_saved_rdi
movq %rsp, acpi_saved_rsp
+ addq $0x8, acpi_saved_rsp
movq %r8, acpi_saved_r8
movq %r9, acpi_saved_r9