summaryrefslogtreecommitdiff
path: root/lib/thread/start+osx-x64.s
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread/start+osx-x64.s')
-rw-r--r--lib/thread/start+osx-x64.s11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/thread/start+osx-x64.s b/lib/thread/start+osx-x64.s
index bb497bb..081ed45 100644
--- a/lib/thread/start+osx-x64.s
+++ b/lib/thread/start+osx-x64.s
@@ -15,20 +15,13 @@ _thread$start:
/*
const thread.exit : (stacksz : std.size -> void)
-NOTE: must be called from the bottom of the stack, since
-we assume that %rbp is in the top 4k of the stack.
*/
.globl _thread$exit
_thread$exit:
- /* find top of stack */
- movq %rbp,%rdi /* addr */
- andq $~0xfff,%rdi /* align it */
- addq $0x1000,%rdi
-
/* munmap(base, size) */
movq $0x2000049,%rax /* munmap */
- movq -8(%rdi),%rsi /* size */
- subq %rsi,%rdi /* move to base ptr */
+ movq %gs:0x08,%rdi /* base */
+ movq %gs:0x10,%rsi /* stksz */
syscall
/* exit the thread */