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

	/* thr_exit(null) */
	movq	$431,%rax	/* exit */
	xorq	%rdi,%rdi	/* 0 */
	syscall