1 // Copyright 2022 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 #include "textflag.h"
6
7 // func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
8 TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0-80
9 #ifdef GOEXPERIMENT_regabiargs
10 MOVD R2, R1
11 MOVD R3, R2
12 MOVD R4, R3
13 MOVD R5, R4
14 MOVD R6, R5
15 MOVD R7, R6
16 MOVD R8, R7
17 #else
18 MOVD num+0(FP), R1 // syscall entry
19 MOVD a1+8(FP), R2
20 MOVD a2+16(FP), R3
21 MOVD a3+24(FP), R4
22 MOVD a4+32(FP), R5
23 MOVD a5+40(FP), R6
24 MOVD a6+48(FP), R7
25 #endif
26 SYSCALL
27 MOVD $0xfffffffffffff001, R8
28 CMPUBLT R2, R8, ok
29 #ifdef GOEXPERIMENT_regabiargs
30 MOVD $0, R3
31 NEG R2, R4
32 MOVD $-1, R2
33 #else
34 MOVD $-1, r1+56(FP)
35 MOVD $0, r2+64(FP)
36 NEG R2, R2
37 MOVD R2, errno+72(FP)
38 #endif
39 RET
40 ok:
41 #ifdef GOEXPERIMENT_regabiargs
42 MOVD $0, R4
43 #else
44 MOVD R2, r1+56(FP)
45 MOVD R3, r2+64(FP)
46 MOVD $0, errno+72(FP)
47 #endif
48 RET
49
View as plain text