Text file
src/syscall/asm_linux_ppc64x.s
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build linux && (ppc64 || ppc64le)
6
7 #include "textflag.h"
8
9 //
10 // System calls for ppc64, Linux
11 //
12
13 // func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
14 TEXT ·Syscall(SB),NOSPLIT,$0-56
15 BL runtime·entersyscall(SB)
16 MOVD a1+8(FP), R3
17 MOVD a2+16(FP), R4
18 MOVD a3+24(FP), R5
19 MOVD R0, R6
20 MOVD R0, R7
21 MOVD R0, R8
22 MOVD trap+0(FP), R9 // syscall entry
23 SYSCALL R9
24 BVC ok
25 MOVD $-1, R4
26 MOVD R4, r1+32(FP) // r1
27 MOVD R0, r2+40(FP) // r2
28 MOVD R3, err+48(FP) // errno
29 BL runtime·exitsyscall(SB)
30 RET
31 ok:
32 MOVD R3, r1+32(FP) // r1
33 MOVD R4, r2+40(FP) // r2
34 MOVD R0, err+48(FP) // errno
35 BL runtime·exitsyscall(SB)
36 RET
37
38 TEXT ·Syscall6(SB),NOSPLIT,$0-80
39 BL runtime·entersyscall(SB)
40 MOVD a1+8(FP), R3
41 MOVD a2+16(FP), R4
42 MOVD a3+24(FP), R5
43 MOVD a4+32(FP), R6
44 MOVD a5+40(FP), R7
45 MOVD a6+48(FP), R8
46 MOVD trap+0(FP), R9 // syscall entry
47 SYSCALL R9
48 BVC ok6
49 MOVD $-1, R4
50 MOVD R4, r1+56(FP) // r1
51 MOVD R0, r2+64(FP) // r2
52 MOVD R3, err+72(FP) // errno
53 BL runtime·exitsyscall(SB)
54 RET
55 ok6:
56 MOVD R3, r1+56(FP) // r1
57 MOVD R4, r2+64(FP) // r2
58 MOVD R0, err+72(FP) // errno
59 BL runtime·exitsyscall(SB)
60 RET
61
62 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
63 MOVD a1+8(FP), R3
64 MOVD a2+16(FP), R4
65 MOVD a3+24(FP), R5
66 MOVD R0, R6
67 MOVD R0, R7
68 MOVD R0, R8
69 MOVD trap+0(FP), R9 // syscall entry
70 SYSCALL R9
71 BVC ok1
72 MOVD $-1, R4
73 MOVD R4, r1+32(FP) // r1
74 MOVD R0, r2+40(FP) // r2
75 MOVD R3, err+48(FP) // errno
76 RET
77 ok1:
78 MOVD R3, r1+32(FP) // r1
79 MOVD R4, r2+40(FP) // r2
80 MOVD R0, err+48(FP) // errno
81 RET
82
83 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
84 MOVD a1+8(FP), R3
85 MOVD a2+16(FP), R4
86 MOVD a3+24(FP), R5
87 MOVD a4+32(FP), R6
88 MOVD a5+40(FP), R7
89 MOVD a6+48(FP), R8
90 MOVD trap+0(FP), R9 // syscall entry
91 SYSCALL R9
92 BVC ok2
93 MOVD $-1, R4
94 MOVD R4, r1+56(FP) // r1
95 MOVD R0, r2+64(FP) // r2
96 MOVD R3, err+72(FP) // errno
97 RET
98 ok2:
99 MOVD R3, r1+56(FP) // r1
100 MOVD R4, r2+64(FP) // r2
101 MOVD R0, err+72(FP) // errno
102 RET
103
104 // func rawVforkSyscall(trap, a1 uintptr) (r1, err uintptr)
105 TEXT ·rawVforkSyscall(SB),NOSPLIT|NOFRAME,$0-32
106 MOVD a1+8(FP), R3
107 MOVD R0, R4
108 MOVD R0, R5
109 MOVD R0, R6
110 MOVD R0, R7
111 MOVD R0, R8
112 MOVD trap+0(FP), R9 // syscall entry
113 SYSCALL R9
114 BVC ok
115 MOVD $-1, R4
116 MOVD R4, r1+16(FP) // r1
117 MOVD R3, err+24(FP) // errno
118 RET
119 ok:
120 MOVD R3, r1+16(FP) // r1
121 MOVD R0, err+24(FP) // errno
122 RET
123
124 TEXT ·rawSyscallNoError(SB),NOSPLIT,$0-48
125 MOVD a1+8(FP), R3
126 MOVD a2+16(FP), R4
127 MOVD a3+24(FP), R5
128 MOVD R0, R6
129 MOVD R0, R7
130 MOVD R0, R8
131 MOVD trap+0(FP), R9 // syscall entry
132 SYSCALL R9
133 MOVD R3, r1+32(FP)
134 MOVD R4, r2+40(FP)
135 RET
136
View as plain text