aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/x86/wakeup.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arch/x86/wakeup.S b/src/arch/x86/wakeup.S
index dc9510bb90..7462dadbe8 100644
--- a/src/arch/x86/wakeup.S
+++ b/src/arch/x86/wakeup.S
@@ -15,6 +15,13 @@
.globl __wakeup
__wakeup:
#if ENV_X86_64
+ /* When called in x86_64 mode, the resume vector is in %rdi
+ * instead of the stack, save it in 4(%rsp) for the 32-bit code.
+ * It's OK to overwrite the return address at (%rsp) because this
+ * function doesn't return.
+ */
+ mov %edi, 4(%rsp)
+
xor %rax,%rax
mov %ss, %ax
push %rax