summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/thread/exit+linux-x64.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/thread/exit+linux-x64.s b/lib/thread/exit+linux-x64.s
index 38e4fa3..a54e802 100644
--- a/lib/thread/exit+linux-x64.s
+++ b/lib/thread/exit+linux-x64.s
@@ -10,12 +10,13 @@ thread$exit:
andq $~0xfff,%rdi /* align it */
addq $0x1000,%rdi
- /* syscall args */
+ /* munmap(base, size) */
movq $11,%rax /* munmap */
movq -8(%rdi),%rsi /* size */
subq %rsi,%rdi /* move to base ptr */
syscall
+ /* thread_exit(0) */
movq $60,%rax /* exit */
xorq %rdi,%rdi /* 0 */
syscall