syscall: call ABIInternal entersyscall on register ABI platforms

Currently, when register ABI is used, syscall.Syscall calls
entersyscall via a wrapper, so the actual entersyscall records the
caller PC and SP of the wrapper. At the point of the actual
syscall, the wrapper frame is gone, so the recorded PC and SP are
technically invalid. Furthermore, in some functions on some
platforms (e.g. Syscall9 on NetBSD/AMD64), that frame is
overwritten. If we unwind the stack from the recorded syscallpc
and syscallsp, it may go wrong. Fix this by calling the
ABIInternal function directly.

exitsyscall calls are changed as well. It doesn't really matter,
just changed for consistency.

Change-Id: Iead8dd22cf32b05e382414fef664b7c4c1719b7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/376356
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2022-01-07 12:13:31 -05:00
parent 1a2f726195
commit 95395fdbe3
11 changed files with 72 additions and 73 deletions

View File

@ -13,7 +13,7 @@
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
TEXT ·Syscall9(SB),NOSPLIT,$0-104
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ num+0(FP), AX // syscall entry
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
@ -38,11 +38,11 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVQ $-1, r1+80(FP) // r1
MOVQ $0, r2+88(FP) // r2
MOVQ AX, err+96(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok9:
MOVQ AX, r1+80(FP) // r1
MOVQ DX, r2+88(FP) // r2
MOVQ $0, err+96(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET

View File

@ -13,7 +13,7 @@
// func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno);
TEXT ·Syscall(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
MOVQ a3+24(FP), DX
@ -24,18 +24,18 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVQ $-1, r1+32(FP)
MOVQ $0, r2+40(FP)
MOVQ AX, err+48(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVQ AX, r1+32(FP)
MOVQ DX, r2+40(FP)
MOVQ $0, err+48(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
// func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno);
TEXT ·Syscall6(SB),NOSPLIT,$0-80
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
MOVQ a3+24(FP), DX
@ -49,18 +49,18 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVQ $-1, r1+56(FP)
MOVQ $0, r2+64(FP)
MOVQ AX, err+72(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok6:
MOVQ AX, r1+56(FP)
MOVQ DX, r2+64(FP)
MOVQ $0, err+72(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
// func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ trap+0(FP), AX // syscall entry
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
@ -82,14 +82,14 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVQ $-1, r1+80(FP)
MOVQ $0, r2+88(FP)
MOVQ AX, err+96(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok9:
ADDQ $32, SP
MOVQ AX, r1+80(FP)
MOVQ DX, r2+88(FP)
MOVQ $0, err+96(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)

View File

@ -10,7 +10,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-56
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R16
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -21,13 +21,13 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD R1, r1+32(FP) // r1
MOVD ZR, r2+40(FP) // r2
MOVD R0, err+48(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+32(FP) // r1
MOVD R1, r2+40(FP) // r2
MOVD ZR, err+48(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
@ -51,7 +51,7 @@ ok:
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R16 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -65,13 +65,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD R1, r1+56(FP) // r1
MOVD ZR, r2+64(FP) // r2
MOVD R0, err+72(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+56(FP) // r1
MOVD R1, r2+64(FP) // r2
MOVD ZR, err+72(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
@ -99,7 +99,7 @@ ok:
// Actually Syscall7
TEXT ·Syscall9(SB),NOSPLIT,$0-104
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD num+0(FP), R16 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -116,12 +116,12 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVD R1, r1+80(FP) // r1
MOVD ZR, r2+88(FP) // r2
MOVD R0, err+96(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+80(FP) // r1
MOVD R1, r2+88(FP) // r2
MOVD ZR, err+96(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET

View File

@ -12,7 +12,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-56
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R8 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -23,13 +23,13 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD R1, r1+32(FP)
MOVD ZR, r2+40(FP)
MOVD R0, err+48(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+32(FP)
MOVD R1, r2+40(FP)
MOVD ZR, err+48(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
@ -53,7 +53,7 @@ ok:
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R8 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -67,13 +67,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD R1, r1+56(FP)
MOVD ZR, r2+64(FP)
MOVD R0, err+72(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+56(FP)
MOVD R1, r2+64(FP)
MOVD ZR, err+72(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
@ -101,7 +101,7 @@ ok:
// Actually Syscall7
// func Syscall9(num uintptr, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD num+0(FP), R8 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -118,11 +118,11 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVD R1, r1+80(FP)
MOVD ZR, r2+88(FP)
MOVD R0, err+96(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+80(FP)
MOVD R1, r2+88(FP)
MOVD ZR, err+96(FP)
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET

View File

@ -17,7 +17,7 @@
// would pass 4th arg in CX, not R10.
TEXT ·Syscall(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
MOVQ a3+24(FP), DX
@ -29,18 +29,18 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVQ $0, r2+40(FP)
NEGQ AX
MOVQ AX, err+48(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVQ AX, r1+32(FP)
MOVQ DX, r2+40(FP)
MOVQ $0, err+48(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
// func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
MOVQ a3+24(FP), DX
@ -55,13 +55,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVQ $0, r2+64(FP)
NEGQ AX
MOVQ AX, err+72(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok6:
MOVQ AX, r1+56(FP)
MOVQ DX, r2+64(FP)
MOVQ $0, err+72(FP)
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)

View File

@ -6,7 +6,7 @@
// func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
TEXT ·Syscall(SB),NOSPLIT,$0-56
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
MOVD a3+24(FP), R2
@ -22,17 +22,17 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD ZR, r2+40(FP) // r2
NEG R0, R0
MOVD R0, err+48(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+32(FP) // r1
MOVD R1, r2+40(FP) // r2
MOVD ZR, err+48(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
MOVD a3+24(FP), R2
@ -48,13 +48,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD ZR, r2+64(FP) // r2
NEG R0, R0
MOVD R0, err+72(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+56(FP) // r1
MOVD R1, r2+64(FP) // r2
MOVD ZR, err+72(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56

View File

@ -12,7 +12,7 @@
// func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
TEXT ·Syscall(SB),NOSPLIT,$0-56
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD a1+8(FP), R3
MOVD a2+16(FP), R4
MOVD a3+24(FP), R5
@ -26,17 +26,17 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD R4, r1+32(FP) // r1
MOVD R0, r2+40(FP) // r2
MOVD R3, err+48(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R3, r1+32(FP) // r1
MOVD R0, r2+40(FP) // r2
MOVD R0, err+48(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD a1+8(FP), R3
MOVD a2+16(FP), R4
MOVD a3+24(FP), R5
@ -50,13 +50,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD R4, r1+56(FP) // r1
MOVD R0, r2+64(FP) // r2
MOVD R3, err+72(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok6:
MOVD R3, r1+56(FP) // r1
MOVD R0, r2+64(FP) // r2
MOVD R0, err+72(FP) // errno
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56

View File

@ -11,7 +11,7 @@
// func Syscall9(trap int64, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int64);
TEXT ·Syscall9(SB),NOSPLIT,$0-104
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ num+0(FP), AX // syscall entry
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
@ -32,12 +32,12 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVQ $-1, 88(SP) // r1
MOVQ $0, 96(SP) // r2
MOVQ AX, 104(SP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok9:
ADDQ $32, SP
MOVQ AX, 88(SP) // r1
MOVQ DX, 96(SP) // r2
MOVQ $0, 104(SP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET

View File

@ -12,7 +12,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-56
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R17
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -23,13 +23,13 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVD R1, r1+32(FP) // r1
MOVD ZR, r2+40(FP) // r2
MOVD R0, err+48(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+32(FP) // r1
MOVD R1, r2+40(FP) // r2
MOVD ZR, err+48(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
@ -53,7 +53,7 @@ ok:
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD trap+0(FP), R17 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -67,13 +67,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD R1, r1+56(FP) // r1
MOVD ZR, r2+64(FP) // r2
MOVD R0, err+72(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+56(FP) // r1
MOVD R1, r2+64(FP) // r2
MOVD ZR, err+72(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
@ -101,7 +101,7 @@ ok:
// Actually Syscall7
TEXT ·Syscall9(SB),NOSPLIT,$0-104
BL runtime·entersyscall(SB)
BL runtime·entersyscall<ABIInternal>(SB)
MOVD num+0(FP), R17 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
@ -118,12 +118,11 @@ TEXT ·Syscall9(SB),NOSPLIT,$0-104
MOVD R1, r1+80(FP) // r1
MOVD ZR, r2+88(FP) // r2
MOVD R0, err+96(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVD R0, r1+80(FP) // r1
MOVD R1, r2+88(FP) // r2
MOVD ZR, err+96(FP) // err
BL runtime·exitsyscall(SB)
BL runtime·exitsyscall<ABIInternal>(SB)
RET

View File

@ -18,7 +18,7 @@
TEXT ·Syscall(SB),NOSPLIT,$168-64
NO_LOCAL_POINTERS
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ trap+0(FP), BP // syscall entry
// copy args down
LEAQ a1+8(FP), SI
@ -38,7 +38,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@ -46,7 +46,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
JMP copyresult3
ok3:
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
LEAQ ·emptystring(SB), SI
copyresult3:
@ -60,7 +60,7 @@ copyresult3:
TEXT ·Syscall6(SB),NOSPLIT,$168-88
NO_LOCAL_POINTERS
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ trap+0(FP), BP // syscall entry
// copy args down
LEAQ a1+8(FP), SI
@ -83,7 +83,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@ -91,7 +91,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
JMP copyresult4
ok4:
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
LEAQ ·emptystring(SB), SI
copyresult4:

View File

@ -16,7 +16,7 @@
// Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-56
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ trap+0(FP), AX // syscall entry
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
@ -26,17 +26,17 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
MOVQ $-1, r1+32(FP) // r1
MOVQ $0, r2+40(FP) // r2
MOVQ AX, err+48(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok:
MOVQ AX, r1+32(FP) // r1
MOVQ DX, r2+40(FP) // r2
MOVQ $0, err+48(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80
CALL runtime·entersyscall(SB)
CALL runtime·entersyscall<ABIInternal>(SB)
MOVQ trap+0(FP), AX // syscall entry
MOVQ a1+8(FP), DI
MOVQ a2+16(FP), SI
@ -49,13 +49,13 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVQ $-1, r1+56(FP) // r1
MOVQ $0, r2+64(FP) // r2
MOVQ AX, err+72(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
ok6:
MOVQ AX, r1+56(FP) // r1
MOVQ DX, r2+64(FP) // r2
MOVQ $0, err+72(FP) // errno
CALL runtime·exitsyscall(SB)
CALL runtime·exitsyscall<ABIInternal>(SB)
RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56