summaryrefslogtreecommitdiff
path: root/lib/thread/exit+linux-x64.s
blob: d736f6d1119823acc39ef47df9de3e1c99dfeeb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
const thread.exit : (-> void)
*/
.globl thread$exit
thread$exit:
	/* munmap(base, size) */
	movq	$11,%rax	/* munmap */
	movq	%fs:0x08,%rdi	/* base */
	movq	%fs:0x10,%rsi	/* stksz */
	syscall

	/* thread_exit(0) */
	movq	$60,%rax	/* exit */
	xorq	%rdi,%rdi	/* 0 */
	syscall