summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2017-08-30 23:40:23 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2017-08-30 23:40:23 +0000
commit0acf157382e884bf92cfa459a350b5da595b03bd (patch)
treebeb8bf2aa1f749640e56c8bddf14c877e524f7a4 /sys/arch
parente4ff6187ee3ab9a347bf96cff88be46d8c7c87cd (diff)
adjust ACPI resume-time saved stack location to account for a different
layout used by clang on i386. Also add a clarification to amd64's version of the same (amd64 already had such an adjustment). ok deraadt, tom, kettenis
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S6
-rw-r--r--sys/arch/i386/i386/acpi_wakecode.S5
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index ae4125570d0..1121e693777 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.40 2017/06/28 07:16:58 mlarkin Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.41 2017/08/30 23:40:22 mlarkin Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -671,6 +671,10 @@ NENTRY(acpi_savecpu)
movq %rsi, .Lacpi_saved_rsi
movq %rdi, .Lacpi_saved_rdi
movq %rsp, .Lacpi_saved_rsp
+ /*
+ * acpi_protected_mode_resume performs restores inline, so undo own
+ * ret
+ */
addq $0x8, .Lacpi_saved_rsp
movq %r8, .Lacpi_saved_r8
diff --git a/sys/arch/i386/i386/acpi_wakecode.S b/sys/arch/i386/i386/acpi_wakecode.S
index 1ff79d39ab9..6ab905dc308 100644
--- a/sys/arch/i386/i386/acpi_wakecode.S
+++ b/sys/arch/i386/i386/acpi_wakecode.S
@@ -594,6 +594,11 @@ NENTRY(acpi_savecpu)
movl %esi, .Lacpi_saved_esi
movl %edi, .Lacpi_saved_edi
movl %esp, .Lacpi_saved_esp
+ /*
+ * acpi_protected_mode_resume performs restores inline, so undo own
+ * ret
+ */
+ addl $0x4, .Lacpi_saved_esp
pushfl
popl .Lacpi_saved_fl