Text file
src/syscall/asm_linux_mips64x.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 && (mips64 || mips64le)
6
7 #include "textflag.h"
8
9 //
10 // System calls for mips64, Linux
11 //
12
13 // func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
14 TEXT ·Syscall(SB),NOSPLIT,$0-56
15 JAL runtime·entersyscall(SB)
16 MOVV a1+8(FP), R4
17 MOVV a2+16(FP), R5
18 MOVV a3+24(FP), R6
19 MOVV R0, R7
20 MOVV R0, R8
21 MOVV R0, R9
22 MOVV trap+0(FP), R2 // syscall entry
23 SYSCALL
24 BEQ R7, ok
25 MOVV $-1, R1
26 MOVV R1, r1+32(FP) // r1
27 MOVV R0, r2+40(FP) // r2
28 MOVV R2, err+48(FP) // errno
29 JAL runtime·exitsyscall(SB)
30 RET
31 ok:
32 MOVV R2, r1+32(FP) // r1
33 MOVV R3, r2+40(FP) // r2
34 MOVV R0, err+48(FP) // errno
35 JAL runtime·exitsyscall(SB)
36 RET
37
38 TEXT ·Syscall6(SB),NOSPLIT,$0-80
39 JAL runtime·entersyscall(SB)
40 MOVV a1+8(FP), R4
41 MOVV a2+16(FP), R5
42 MOVV a3+24(FP), R6
43 MOVV a4+32(FP), R7
44 MOVV a5+40(FP), R8
45 MOVV a6+48(FP), R9
46 MOVV trap+0(FP), R2 // syscall entry
47 SYSCALL
48 BEQ R7, ok6
49 MOVV $-1, R1
50 MOVV R1, r1+56(FP) // r1
51 MOVV R0, r2+64(FP) // r2
52 MOVV R2, err+72(FP) // errno
53 JAL runtime·exitsyscall(SB)
54 RET
55 ok6:
56 MOVV R2, r1+56(FP) // r1
57 MOVV R3, r2+64(FP) // r2
58 MOVV R0, err+72(FP) // errno
59 JAL runtime·exitsyscall(SB)
60 RET
61
62 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
63 MOVV a1+8(FP), R4
64 MOVV a2+16(FP), R5
65 MOVV a3+24(FP), R6
66 MOVV R0, R7
67 MOVV R0, R8
68 MOVV R0, R9
69 MOVV trap+0(FP), R2 // syscall entry
70 SYSCALL
71 BEQ R7, ok1
72 MOVV $-1, R1
73 MOVV R1, r1+32(FP) // r1
74 MOVV R0, r2+40(FP) // r2
75 MOVV R2, err+48(FP) // errno
76 RET
77 ok1:
78 MOVV R2, r1+32(FP) // r1
79 MOVV R3, r2+40(FP) // r2
80 MOVV R0, err+48(FP) // errno
81 RET
82
83 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
84 MOVV a1+8(FP), R4
85 MOVV a2+16(FP), R5
86 MOVV a3+24(FP), R6
87 MOVV a4+32(FP), R7
88 MOVV a5+40(FP), R8
89 MOVV a6+48(FP), R9
90 MOVV trap+0(FP), R2 // syscall entry
91 SYSCALL
92 BEQ R7, ok2
93 MOVV $-1, R1
94 MOVV R1, r1+56(FP) // r1
95 MOVV R0, r2+64(FP) // r2
96 MOVV R2, err+72(FP) // errno
97 RET
98 ok2:
99 MOVV R2, r1+56(FP) // r1
100 MOVV R3, r2+64(FP) // r2
101 MOVV 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 MOVV a1+8(FP), R4
107 MOVV R0, R5
108 MOVV R0, R6
109 MOVV R0, R7
110 MOVV R0, R8
111 MOVV R0, R9
112 MOVV trap+0(FP), R2 // syscall entry
113 SYSCALL
114 BEQ R7, ok
115 MOVV $-1, R1
116 MOVV R1, r1+16(FP) // r1
117 MOVV R2, err+24(FP) // errno
118 RET
119 ok:
120 MOVV R2, r1+16(FP) // r1
121 MOVV R0, err+24(FP) // errno
122 RET
123
124 TEXT ·rawSyscallNoError(SB),NOSPLIT,$0-48
125 MOVV a1+8(FP), R4
126 MOVV a2+16(FP), R5
127 MOVV a3+24(FP), R6
128 MOVV R0, R7
129 MOVV R0, R8
130 MOVV R0, R9
131 MOVV trap+0(FP), R2 // syscall entry
132 SYSCALL
133 MOVV R2, r1+32(FP)
134 MOVV R3, r2+40(FP)
135 RET
136
View as plain text