From: Cherry Mui Date: Fri, 7 Jan 2022 17:13:31 +0000 (-0500) Subject: syscall: call ABIInternal entersyscall on register ABI platforms X-Git-Tag: go1.19beta1~1054 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=95395fdbe3e76778a9035d9478f52513fc34a97b;p=gostls13.git 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 Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek --- diff --git a/src/syscall/asm9_unix2_amd64.s b/src/syscall/asm9_unix2_amd64.s index 649bc6024c..5bf53a1251 100644 --- a/src/syscall/asm9_unix2_amd64.s +++ b/src/syscall/asm9_unix2_amd64.s @@ -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(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(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(SB) RET diff --git a/src/syscall/asm_darwin_amd64.s b/src/syscall/asm_darwin_amd64.s index c863889a71..77b58e051b 100644 --- a/src/syscall/asm_darwin_amd64.s +++ b/src/syscall/asm_darwin_amd64.s @@ -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(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(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(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(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(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(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(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(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(SB) RET // func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) diff --git a/src/syscall/asm_darwin_arm64.s b/src/syscall/asm_darwin_arm64.s index 95b6dc0db5..22e07666df 100644 --- a/src/syscall/asm_darwin_arm64.s +++ b/src/syscall/asm_darwin_arm64.s @@ -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(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(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(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(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(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(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(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(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(SB) RET diff --git a/src/syscall/asm_freebsd_arm64.s b/src/syscall/asm_freebsd_arm64.s index 7a0809b8ec..b032ce7f69 100644 --- a/src/syscall/asm_freebsd_arm64.s +++ b/src/syscall/asm_freebsd_arm64.s @@ -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(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(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(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(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(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(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(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(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(SB) RET diff --git a/src/syscall/asm_linux_amd64.s b/src/syscall/asm_linux_amd64.s index a9af68d51d..0b55a30fa0 100644 --- a/src/syscall/asm_linux_amd64.s +++ b/src/syscall/asm_linux_amd64.s @@ -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(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(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(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(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(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(SB) RET // func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) diff --git a/src/syscall/asm_linux_arm64.s b/src/syscall/asm_linux_arm64.s index a30e4d87d4..6c50fa9d7c 100644 --- a/src/syscall/asm_linux_arm64.s +++ b/src/syscall/asm_linux_arm64.s @@ -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(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(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(SB) RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 - BL runtime·entersyscall(SB) + BL runtime·entersyscall(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(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(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 diff --git a/src/syscall/asm_linux_ppc64x.s b/src/syscall/asm_linux_ppc64x.s index 1f5cb37ffe..bf701e5291 100644 --- a/src/syscall/asm_linux_ppc64x.s +++ b/src/syscall/asm_linux_ppc64x.s @@ -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(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(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(SB) RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 - BL runtime·entersyscall(SB) + BL runtime·entersyscall(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(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(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 diff --git a/src/syscall/asm_netbsd_amd64.s b/src/syscall/asm_netbsd_amd64.s index 9e4dd20ad3..457e207296 100644 --- a/src/syscall/asm_netbsd_amd64.s +++ b/src/syscall/asm_netbsd_amd64.s @@ -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(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(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(SB) RET diff --git a/src/syscall/asm_netbsd_arm64.s b/src/syscall/asm_netbsd_arm64.s index fbcd3388c9..aebd83f325 100644 --- a/src/syscall/asm_netbsd_arm64.s +++ b/src/syscall/asm_netbsd_arm64.s @@ -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(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(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(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(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(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(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(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(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(SB) RET - diff --git a/src/syscall/asm_plan9_amd64.s b/src/syscall/asm_plan9_amd64.s index d5c9f6c63f..f22db3238d 100644 --- a/src/syscall/asm_plan9_amd64.s +++ b/src/syscall/asm_plan9_amd64.s @@ -18,7 +18,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64 NO_LOCAL_POINTERS - CALL runtime·entersyscall(SB) + CALL runtime·entersyscall(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(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(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(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(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(SB) LEAQ ·emptystring(SB), SI copyresult4: diff --git a/src/syscall/asm_unix_amd64.s b/src/syscall/asm_unix_amd64.s index 8ee46b86b5..6d8da715a2 100644 --- a/src/syscall/asm_unix_amd64.s +++ b/src/syscall/asm_unix_amd64.s @@ -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(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(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(SB) RET TEXT ·Syscall6(SB),NOSPLIT,$0-80 - CALL runtime·entersyscall(SB) + CALL runtime·entersyscall(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(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(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56