Text file
src/syscall/asm_linux_mipsx.s
1 // Copyright 2016 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 && (mips || mipsle)
6
7 #include "textflag.h"
8 #include "funcdata.h"
9
10 //
11 // System calls for mips, Linux
12 //
13
14 // func Syscall9(trap trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr);
15 // Actually Syscall8 but the rest of the code expects it to be named Syscall9.
16 TEXT ·Syscall9(SB),NOSPLIT,$28-52
17 NO_LOCAL_POINTERS
18 JAL runtime·entersyscall(SB)
19 MOVW a1+4(FP), R4
20 MOVW a2+8(FP), R5
21 MOVW a3+12(FP), R6
22 MOVW a4+16(FP), R7
23 MOVW a5+20(FP), R8
24 MOVW a6+24(FP), R9
25 MOVW a7+28(FP), R10
26 MOVW a8+32(FP), R11
27 MOVW R8, 16(R29)
28 MOVW R9, 20(R29)
29 MOVW R10, 24(R29)
30 MOVW R11, 28(R29)
31 MOVW trap+0(FP), R2 // syscall entry
32 MOVW R0, R3 // reset R3 to zero as 1-ret SYSCALL keeps it
33 SYSCALL
34 BEQ R7, ok9
35 MOVW $-1, R1
36 MOVW R1, r1+40(FP) // r1
37 MOVW R0, r2+44(FP) // r2
38 MOVW R2, err+48(FP) // errno
39 JAL runtime·exitsyscall(SB)
40 RET
41 ok9:
42 MOVW R2, r1+40(FP) // r1
43 MOVW R3, r2+44(FP) // r2
44 MOVW R0, err+48(FP) // errno
45 JAL runtime·exitsyscall(SB)
46 RET
47
48 // func rawVforkSyscall(trap, a1, a2, a3 uintptr) (r1, err uintptr)
49 TEXT ·rawVforkSyscall(SB),NOSPLIT|NOFRAME,$0-24
50 MOVW a1+4(FP), R4
51 MOVW a2+8(FP), R5
52 MOVW a3+12(FP), R6
53 MOVW trap+0(FP), R2 // syscall entry
54 SYSCALL
55 BEQ R7, ok
56 MOVW $-1, R1
57 MOVW R1, r1+16(FP) // r1
58 MOVW R2, err+20(FP) // errno
59 RET
60 ok:
61 MOVW R2, r1+16(FP) // r1
62 MOVW R0, err+20(FP) // errno
63 RET
64
65 TEXT ·rawSyscallNoError(SB),NOSPLIT,$20-24
66 MOVW a1+4(FP), R4
67 MOVW a2+8(FP), R5
68 MOVW a3+12(FP), R6
69 MOVW trap+0(FP), R2 // syscall entry
70 MOVW R0, R3 // reset R3 to zero as 1-ret SYSCALL keeps it
71 SYSCALL
72 MOVW R2, r1+16(FP) // r1
73 MOVW R3, r2+20(FP) // r2
74 RET
75
View as plain text