summaryrefslogtreecommitdiff
path: root/src/syscall/syscall_amd64_darwin.s
blob: 3f32ff653b9e67b5d6f28c70e6862c65e06a703e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright 2009 The Go Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//
// System calls for AMD64, Darwin
//

TEXT	syscall·open(SB),1,$-8
	MOVQ	8(SP), DI
	MOVQ	16(SP), SI
	MOVQ	$0, R10
	MOVL	$(0x2000000+5), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 24(SP)
	MOVQ	AX, 32(SP)
	RET
	MOVQ	AX, 24(SP)
	MOVQ	$0, 32(SP)
	RET

TEXT	syscall·close(SB),1,$-8
	MOVL	8(SP), DI
	MOVL	$(0x2000000+6), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 16(SP)
	MOVQ	AX, 24(SP)
	RET
	MOVQ	AX, 16(SP)
	MOVQ	$0, 24(SP)
	RET

TEXT	syscall·read(SB),1,$-8
	MOVQ	8(SP), DI
	MOVQ	16(SP), SI
	MOVQ	24(SP), DX
	MOVL	$(0x2000000+3), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 32(SP)
	MOVQ	AX, 40(SP)
	RET
	MOVQ	AX, 32(SP)
	MOVQ	$0, 40(SP)
	RET

TEXT	syscall·write(SB),1,$-8
	MOVQ	8(SP), DI
	MOVQ	16(SP), SI
	MOVQ	24(SP), DX
	MOVL	$(0x2000000+4), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 32(SP)
	MOVQ	AX, 40(SP)
	RET
	MOVQ	AX, 32(SP)
	MOVQ	$0, 40(SP)
	RET

TEXT	syscall·stat(SB),1,$-8
	MOVQ	8(SP), DI
	MOVQ	16(SP), SI
	MOVL	$(0x2000000+338), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 24(SP)
	MOVQ	AX, 32(SP)
	RET
	MOVQ	AX, 24(SP)
	MOVQ	$0, 32(SP)
	RET

TEXT	syscall·fstat(SB),1,$-8
	MOVQ	8(SP), DI
	MOVQ	16(SP), SI
	MOVL	$(0x2000000+339), AX	// syscall entry
	SYSCALL
	JCC	4(PC)
	MOVQ	$-1, 24(SP)
	MOVQ	AX, 32(SP)
	RET
	MOVQ	AX, 24(SP)
	MOVQ	$0, 32(SP)
	RET