]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: call ABIInternal entersyscall on register ABI platforms
authorCherry Mui <cherryyz@google.com>
Fri, 7 Jan 2022 17:13:31 +0000 (12:13 -0500)
committerCherry Mui <cherryyz@google.com>
Wed, 16 Mar 2022 15:40:39 +0000 (15:40 +0000)
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>
src/syscall/asm9_unix2_amd64.s
src/syscall/asm_darwin_amd64.s
src/syscall/asm_darwin_arm64.s
src/syscall/asm_freebsd_arm64.s
src/syscall/asm_linux_amd64.s
src/syscall/asm_linux_arm64.s
src/syscall/asm_linux_ppc64x.s
src/syscall/asm_netbsd_amd64.s
src/syscall/asm_netbsd_arm64.s
src/syscall/asm_plan9_amd64.s
src/syscall/asm_unix_amd64.s

index 649bc6024c9a8f6733e2066b3e6c7697c86defc0..5bf53a125116a20d583de4d70281edee331c39fb 100644 (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
index c863889a7138526ecb6675943ffacc11bdb8ca69..77b58e051b96e8a48edc7e41c25c7817497b92fb 100644 (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)
index 95b6dc0db574b3265f493b22aaf7e67372881f62..22e07666df2a19f90b2d5b99240ac3980d1bd2a8 100644 (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
 
index 7a0809b8ec918edda5613d7f2bfd09881524aa4f..b032ce7f69c2db2c19e21871944c0666bdb9c36c 100644 (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
index a9af68d51db96d562039d9cae7212de8a4bde9ec..0b55a30fa01b8de99ea864f70fb7eb36d1866900 100644 (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)
index a30e4d87d4c08acb3604ee18d8e3ae519f459d43..6c50fa9d7cd79f466ca3ffad867af9cfa62bfbe4 100644 (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
index 1f5cb37ffeedabe533b2f0cbefd4c38d8487b7a6..bf701e529129313774a29ea6d76a2e12d34049fb 100644 (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
index 9e4dd20ad3f663cc26ed9d6a79518894144fc805..457e207296ed0bf8909dd829b0d33c0488bd0db1 100644 (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
index fbcd3388c988582dec317b02418a1aae6b71d657..aebd83f32592f204ce26cee5b02c2a5d62355f62 100644 (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
-
index d5c9f6c63f1e29dd4834b973a4847668fe375ba7..f22db3238d238c296472aad1ad407419aaee5182 100644 (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:
index 8ee46b86b57390bea16daff9e6b30728f7335d84..6d8da715a2f5091324187b214854873f4f625596 100644 (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