summaryrefslogtreecommitdiff
path: root/src/arch/x86/c_start.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/c_start.S')
-rw-r--r--src/arch/x86/c_start.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S
index 43d78020e1..bd99c21c91 100644
--- a/src/arch/x86/c_start.S
+++ b/src/arch/x86/c_start.S
@@ -60,6 +60,14 @@ _start:
cld
+#ifdef __x86_64__
+ mov %rdi, _cbmem_top_ptr
+#else
+ /* The return argument is at 0(%esp), the calling argument at 4(%esp) */
+ movl 4(%esp), %eax
+ movl %eax, _cbmem_top_ptr
+#endif
+
/** poison the stack. Code should not count on the
* stack being full of zeros. This stack poisoning
* recently uncovered a bug in the broadcast SIPI