aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-04-21 14:48:58 -0400
committerGopher Robot <gobot@golang.org>2022-04-21 19:06:49 +0000
commit347534343b114d9183efeefcb1d49458e1e8e34f (patch)
tree7782a93324b4744776b884c2dfce018467dec4f6
parenta4ded4b5ff90a58d1ecf55914af941c468a502f1 (diff)
downloadgo-347534343b114d9183efeefcb1d49458e1e8e34f.tar.gz
go-347534343b114d9183efeefcb1d49458e1e8e34f.zip
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 <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
-rw-r--r--src/runtime/internal/syscall/asm_linux_amd64.s44
1 files changed, 15 insertions, 29 deletions
diff --git a/src/runtime/internal/syscall/asm_linux_amd64.s b/src/runtime/internal/syscall/asm_linux_amd64.s
index 3740ef1beb..961d9bd640 100644
--- a/src/runtime/internal/syscall/asm_linux_amd64.s
+++ b/src/runtime/internal/syscall/asm_linux_amd64.s
@@ -6,42 +6,28 @@
// func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
//
-// We need to convert to the syscall ABI.
-//
-// arg | ABIInternal | Syscall
-// ---------------------------
-// num | AX | AX
-// a1 | BX | DI
-// a2 | CX | SI
-// a3 | DI | DX
-// a4 | SI | R10
-// a5 | R8 | R8
-// a6 | R9 | R9
-//
-// r1 | AX | AX
-// r2 | BX | DX
-// err | CX | part of AX
+// Syscall # in AX, args in DI SI DX R10 R8 R9, return in AX DX.
//
// Note that this differs from "standard" ABI convention, which would pass 4th
// arg in CX, not R10.
-TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0
- // a6 already in R9.
- // a5 already in R8.
- MOVQ SI, R10 // a4
- MOVQ DI, DX // a3
- MOVQ CX, SI // a2
- MOVQ BX, DI // a1
- // num already in AX.
+TEXT ·Syscall6(SB),NOSPLIT,$0-80
+ MOVQ num+0(FP), AX // syscall entry
+ MOVQ a1+8(FP), DI
+ MOVQ a2+16(FP), SI
+ MOVQ a3+24(FP), DX
+ MOVQ a4+32(FP), R10
+ MOVQ a5+40(FP), R8
+ MOVQ a6+48(FP), R9
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS ok
+ MOVQ $-1, r1+56(FP)
+ MOVQ $0, r2+64(FP)
NEGQ AX
- MOVQ AX, CX // errno
- MOVQ $-1, AX // r1
- MOVQ $0, BX // r2
+ MOVQ AX, errno+72(FP)
RET
ok:
- // r1 already in AX.
- MOVQ DX, BX // r2
- MOVQ $0, CX // errno
+ MOVQ AX, r1+56(FP)
+ MOVQ DX, r2+64(FP)
+ MOVQ $0, errno+72(FP)
RET