Skip to content

Commit 3475343

Browse files
prattmicgopherbot
authored andcommitted
Revert "runtime/internal/syscall: use ABIInternal for Syscall6 on amd64"
This reverts CL 401096. Grandparent CL 388477 breaks cmd/go TestScript/cover_pkgall_runtime. For #51087. For #52472. Change-Id: Ie82fe5f50975f66eb91fb0d01cd8bbbd0265eb4e Reviewed-on: https://go-review.googlesource.com/c/go/+/401634 Run-TryBot: Michael Pratt <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent a4ded4b commit 3475343

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

src/runtime/internal/syscall/asm_linux_amd64.s

+15-29
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,28 @@
66

77
// func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
88
//
9-
// We need to convert to the syscall ABI.
10-
//
11-
// arg | ABIInternal | Syscall
12-
// ---------------------------
13-
// num | AX | AX
14-
// a1 | BX | DI
15-
// a2 | CX | SI
16-
// a3 | DI | DX
17-
// a4 | SI | R10
18-
// a5 | R8 | R8
19-
// a6 | R9 | R9
20-
//
21-
// r1 | AX | AX
22-
// r2 | BX | DX
23-
// err | CX | part of AX
9+
// Syscall # in AX, args in DI SI DX R10 R8 R9, return in AX DX.
2410
//
2511
// Note that this differs from "standard" ABI convention, which would pass 4th
2612
// arg in CX, not R10.
27-
TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0
28-
// a6 already in R9.
29-
// a5 already in R8.
30-
MOVQ SI, R10 // a4
31-
MOVQ DI, DX // a3
32-
MOVQ CX, SI // a2
33-
MOVQ BX, DI // a1
34-
// num already in AX.
13+
TEXT ·Syscall6(SB),NOSPLIT,$0-80
14+
MOVQ num+0(FP), AX // syscall entry
15+
MOVQ a1+8(FP), DI
16+
MOVQ a2+16(FP), SI
17+
MOVQ a3+24(FP), DX
18+
MOVQ a4+32(FP), R10
19+
MOVQ a5+40(FP), R8
20+
MOVQ a6+48(FP), R9
3521
SYSCALL
3622
CMPQ AX, $0xfffffffffffff001
3723
JLS ok
24+
MOVQ $-1, r1+56(FP)
25+
MOVQ $0, r2+64(FP)
3826
NEGQ AX
39-
MOVQ AX, CX // errno
40-
MOVQ $-1, AX // r1
41-
MOVQ $0, BX // r2
27+
MOVQ AX, errno+72(FP)
4228
RET
4329
ok:
44-
// r1 already in AX.
45-
MOVQ DX, BX // r2
46-
MOVQ $0, CX // errno
30+
MOVQ AX, r1+56(FP)
31+
MOVQ DX, r2+64(FP)
32+
MOVQ $0, errno+72(FP)
4733
RET

0 commit comments

Comments
 (0)