]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] runtime: use internal/abi.FuncPCABI0 to take address of assembly...
authorCherry Mui <cherryyz@google.com>
Thu, 20 May 2021 22:55:47 +0000 (18:55 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 21 May 2021 21:52:38 +0000 (21:52 +0000)
There are a few assembly functions in the runtime that are marked
as ABIInternal, solely because funcPC can get the right address.
The functions themselves do not actually follow ABIInternal (or
irrelevant). Now we have internal/abi.FuncPCABI0, use that, and
un-mark the functions.

Also un-mark assembly functions that are only called in assembly.
For them, it only matters if the caller and callee are consistent.

Change-Id: I240e126ac13cb362f61ff8482057ee9f53c24097
Reviewed-on: https://go-review.googlesource.com/c/go/+/321950
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
33 files changed:
src/reflect/asm_amd64.s
src/runtime/asm.s
src/runtime/asm_amd64.s
src/runtime/mkpreempt.go
src/runtime/os3_plan9.go
src/runtime/os_linux.go
src/runtime/os_windows.go
src/runtime/preempt.go
src/runtime/preempt_386.s
src/runtime/preempt_amd64.s
src/runtime/preempt_arm.s
src/runtime/preempt_arm64.s
src/runtime/preempt_mips64x.s
src/runtime/preempt_mipsx.s
src/runtime/preempt_ppc64x.s
src/runtime/preempt_riscv64.s
src/runtime/preempt_s390x.s
src/runtime/preempt_wasm.s
src/runtime/race.go
src/runtime/race_amd64.s
src/runtime/signal_amd64.go
src/runtime/signal_unix.go
src/runtime/signal_windows.go
src/runtime/sys_linux_amd64.s
src/runtime/sys_windows_386.s
src/runtime/sys_windows_amd64.s
src/runtime/sys_windows_arm.s
src/runtime/sys_windows_arm64.s
src/runtime/syscall_windows.go
src/runtime/wincallback.go
src/runtime/zcallback_windows.s
src/runtime/zcallback_windows_arm.s
src/runtime/zcallback_windows_arm64.s

index facf07516d8c2441058c7c032db482bd5a4d2c6b..86d3f4e4bf77075e53ed7c0975cc6653bd79bb64 100644 (file)
@@ -32,7 +32,7 @@ TEXT ·makeFuncStub<ABIInternal>(SB),(NOSPLIT|WRAPPER),$312
        // NO_LOCAL_POINTERS is a lie. The stack map for the two locals in this
        // frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
        LEAQ    LOCAL_REGARGS(SP), R12
-       CALL    runtime·spillArgs<ABIInternal>(SB)
+       CALL    runtime·spillArgs(SB)
        MOVQ    DX, 24(SP) // outside of moveMakeFuncArgPtrs's arg area
        MOVQ    DX, 0(SP)
        MOVQ    R12, 8(SP)
@@ -48,7 +48,7 @@ TEXT ·makeFuncStub<ABIInternal>(SB),(NOSPLIT|WRAPPER),$312
        MOVQ    AX, 24(SP)
        CALL    ·callReflect(SB)
        LEAQ    LOCAL_REGARGS(SP), R12
-       CALL    runtime·unspillArgs<ABIInternal>(SB)
+       CALL    runtime·unspillArgs(SB)
        RET
 
 // methodValueCall is the code half of the function returned by makeMethodValue.
index 72c744925d89aec9d1cc33a6eacf55f826866fcf..0e14fcd3e6a3569f17357b31e3cefa4a142c0ae8 100644 (file)
@@ -13,6 +13,6 @@ DATA runtime·no_pointers_stackmap+0x04(SB)/4, $0
 GLOBL runtime·no_pointers_stackmap(SB),RODATA, $8
 
 #ifndef GOARCH_amd64
-TEXT ·sigpanic0<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·sigpanic0(SB),NOSPLIT,$0-0
        JMP     ·sigpanic<ABIInternal>(SB)
 #endif
index 5990ce54c8d12716de148021e9e62a622f932ae8..96f0d3fefce0a66022217b252198d5b3c4c828aa 100644 (file)
@@ -469,7 +469,7 @@ TEXT runtime·morestack_noctxt(SB),NOSPLIT,$0
 
 #ifdef GOEXPERIMENT_regabireflect
 // spillArgs stores return values from registers to a *internal/abi.RegArgs in R12.
-TEXT ·spillArgs<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·spillArgs(SB),NOSPLIT,$0-0
        MOVQ AX, 0(R12)
        MOVQ BX, 8(R12)
        MOVQ CX, 16(R12)
@@ -497,7 +497,7 @@ TEXT ·spillArgs<ABIInternal>(SB),NOSPLIT,$0-0
        RET
 
 // unspillArgs loads args into registers from a *internal/abi.RegArgs in R12.
-TEXT ·unspillArgs<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·unspillArgs(SB),NOSPLIT,$0-0
        MOVQ 0(R12), AX
        MOVQ 8(R12), BX
        MOVQ 16(R12), CX
@@ -525,11 +525,11 @@ TEXT ·unspillArgs<ABIInternal>(SB),NOSPLIT,$0-0
        RET
 #else
 // spillArgs stores return values from registers to a pointer in R12.
-TEXT ·spillArgs<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·spillArgs(SB),NOSPLIT,$0-0
        RET
 
 // unspillArgs loads args into registers from a pointer in R12.
-TEXT ·unspillArgs<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·unspillArgs(SB),NOSPLIT,$0-0
        RET
 #endif
 
@@ -588,7 +588,7 @@ TEXT NAME(SB), WRAPPER, $MAXSIZE-48;                \
        REP;MOVSB;                              \
        /* set up argument registers */         \
        MOVQ    regArgs+40(FP), R12;            \
-       CALL    ·unspillArgs<ABIInternal>(SB);         \
+       CALL    ·unspillArgs(SB);              \
        /* call function */                     \
        MOVQ    f+8(FP), DX;                    \
        PCDATA  $PCDATA_StackMapIndex, $0;      \
@@ -596,7 +596,7 @@ TEXT NAME(SB), WRAPPER, $MAXSIZE-48;                \
        CALL    R12;                            \
        /* copy register return values back */          \
        MOVQ    regArgs+40(FP), R12;            \
-       CALL    ·spillArgs<ABIInternal>(SB);           \
+       CALL    ·spillArgs(SB);                \
        MOVLQZX stackArgsSize+24(FP), CX;               \
        MOVLQZX stackRetOffset+28(FP), BX;              \
        MOVQ    stackArgs+16(FP), DI;           \
@@ -1596,7 +1596,7 @@ TEXT runtime·addmoduledata(SB),NOSPLIT,$0-0
 // This function is injected from the signal handler for panicking
 // signals. It is quite painful to set X15 in the signal context,
 // so we do it here.
-TEXT ·sigpanic0<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT ·sigpanic0(SB),NOSPLIT,$0-0
 #ifdef GOEXPERIMENT_regabig
        get_tls(R14)
        MOVQ    g(R14), R14
index 6c980540f5776019e82ccd5939775723edfd86e1..f2b90307cab1ea05755c7f657796ee7e33a93d40 100644 (file)
@@ -128,8 +128,7 @@ func header(arch string) {
        }
        fmt.Fprintf(out, "#include \"go_asm.h\"\n")
        fmt.Fprintf(out, "#include \"textflag.h\"\n\n")
-       fmt.Fprintf(out, "// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.\n")
-       fmt.Fprintf(out, "TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0\n")
+       fmt.Fprintf(out, "TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0\n")
 }
 
 func p(f string, args ...interface{}) {
index c5dc23de8b60898ee02c8c796c7517222648a635..dacb5c23a0c01f4e7f4533dea21826e07fdd42d2 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -100,7 +101,7 @@ func sighandler(_ureg *ureg, note *byte, gp *g) int {
                if usesLR {
                        c.setpc(funcPC(sigpanictramp))
                } else {
-                       c.setpc(funcPC(sigpanic0))
+                       c.setpc(abi.FuncPCABI0(sigpanic0))
                }
                return _NCONT
        }
index c8b29e396c7128cdab84057c2782694bcd793e5f..235c96e45a7d3e243a6a18e9a6293b1c89fd5120 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -149,7 +150,7 @@ func newosproc(mp *m) {
        // with signals disabled. It will enable them in minit.
        var oset sigset
        sigprocmask(_SIG_SETMASK, &sigset_all, &oset)
-       ret := clone(cloneFlags, stk, unsafe.Pointer(mp), unsafe.Pointer(mp.g0), unsafe.Pointer(funcPC(mstart)))
+       ret := clone(cloneFlags, stk, unsafe.Pointer(mp), unsafe.Pointer(mp.g0), unsafe.Pointer(abi.FuncPCABI0(mstart)))
        sigprocmask(_SIG_SETMASK, &oset, nil)
 
        if ret < 0 {
@@ -429,13 +430,13 @@ func setsig(i uint32, fn uintptr) {
        // should not be used". x86_64 kernel requires it. Only use it on
        // x86.
        if GOARCH == "386" || GOARCH == "amd64" {
-               sa.sa_restorer = funcPC(sigreturn)
+               sa.sa_restorer = abi.FuncPCABI0(sigreturn)
        }
        if fn == funcPC(sighandler) {
                if iscgo {
-                       fn = funcPC(cgoSigtramp)
+                       fn = abi.FuncPCABI0(cgoSigtramp)
                } else {
-                       fn = funcPC(sigtramp)
+                       fn = abi.FuncPCABI0(sigtramp)
                }
        }
        sa.sa_handler = fn
index f0935264ac6604b852960f2fea4164fc23e90173..d82173e738a5cbade690ec3fef9cd1151eba8420 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -543,7 +544,7 @@ func initLongPathSupport() {
 }
 
 func osinit() {
-       asmstdcallAddr = unsafe.Pointer(funcPC(asmstdcall))
+       asmstdcallAddr = unsafe.Pointer(abi.FuncPCABI0(asmstdcall))
 
        setBadSignalMsg()
 
@@ -906,7 +907,7 @@ func semacreate(mp *m) {
 func newosproc(mp *m) {
        // We pass 0 for the stack size to use the default for this binary.
        thandle := stdcall6(_CreateThread, 0, 0,
-               funcPC(tstart_stdcall), uintptr(unsafe.Pointer(mp)),
+               abi.FuncPCABI0(tstart_stdcall), uintptr(unsafe.Pointer(mp)),
                0, 0)
 
        if thandle == 0 {
@@ -1385,7 +1386,7 @@ func preemptM(mp *m) {
        if gp != nil && wantAsyncPreempt(gp) {
                if ok, newpc := isAsyncSafePoint(gp, c.ip(), c.sp(), c.lr()); ok {
                        // Inject call to asyncPreempt
-                       targetPC := funcPC(asyncPreempt)
+                       targetPC := abi.FuncPCABI0(asyncPreempt)
                        switch GOARCH {
                        default:
                                throw("unsupported architecture")
index 1d5aae1363193d01383b9dbb06a48e2e9b13cdde..d1291c9c487a8ada15de8045f0b142fb5f8400bb 100644 (file)
@@ -53,6 +53,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "runtime/internal/sys"
        "unsafe"
@@ -315,7 +316,7 @@ func asyncPreempt2() {
 var asyncPreemptStack = ^uintptr(0)
 
 func init() {
-       f := findfunc(funcPC(asyncPreempt))
+       f := findfunc(abi.FuncPCABI0(asyncPreempt))
        total := funcMaxSPDelta(f)
        f = findfunc(funcPC(asyncPreempt2))
        total += funcMaxSPDelta(f)
index a803b24dc6f0b06bec126b4dc3f1904d94a28f07..c3a5fa1f361cfb28c653c27c2f764b54031c7aaf 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        PUSHFL
        ADJSP $156
        NOP SP
index dc7af806d32f3e390dab0173db9e3442265b47c1..31f7c8b66f502b6cbeccc90b7c695214614eb6b2 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        PUSHQ BP
        MOVQ SP, BP
        // Save flags before clobbering them
index bbc9fbb1eae1d6e19640f049c2e0e87dc17ffebd..8f243c0dcd608191507494e86bac08e921241c3b 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOVW.W R14, -188(R13)
        MOVW R0, 4(R13)
        MOVW R1, 8(R13)
index 2b70a28479dd3572314bbf59fc48f0d8c125e7ef..36ee13282c777630eaa6e19310b236e7ada65634 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOVD R30, -496(RSP)
        SUB $496, RSP
        #ifdef GOOS_linux
index b755425bc5d3275e6c7700d63f41e35e4120c20a..c1249e382e206d1d002e5b64be5e2cca6a712054 100644 (file)
@@ -6,8 +6,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOVV R31, -488(R29)
        SUBV $488, R29
        MOVV R1, 8(R29)
index c1bff60859610ce4e333d4d8b097fb026011393a..70b79e05b99a23cc5229b2946ca5a58138606526 100644 (file)
@@ -6,8 +6,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOVW R31, -244(R29)
        SUB $244, R29
        MOVW R1, 4(R29)
index 70bd91982bfa89eff10177aeef5c66eed7f516eb..7ed4021dde74f7ea46d4a042c0dac03673725f46 100644 (file)
@@ -6,8 +6,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOVD R31, -488(R1)
        MOVD LR, R31
        MOVDU R31, -520(R1)
index d4f9cc277f4b62b27a8c33002fb587c53795bd43..eb68dcba2b96d137171d58c0a9b36b7f433fa387 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        MOV X1, -472(X2)
        ADD $-472, X2
        MOV X3, 8(X2)
index c6f11571df77885bf1d1d9f9f0dd44a9f00262c7..ca9e47cde1791340c6df2b7ef2740ccb6fb6c225 100644 (file)
@@ -3,8 +3,7 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        IPM R10
        MOVD R14, -248(R15)
        ADD $-248, R15
index da90e8aa6dd311c7049b2da5134399249f4b9147..0cf57d3d2265bbf9b5cc14623216097c15fa3cf6 100644 (file)
@@ -3,7 +3,6 @@
 #include "go_asm.h"
 #include "textflag.h"
 
-// Note: asyncPreempt doesn't use the internal ABI, but we must be able to inject calls to it from the signal handler, so Go code has to see the PC of this function literally.
-TEXT ·asyncPreempt<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
        // No async preemption on wasm
        UNDEF
index cc8c5db1bd2dca7d8e2aea9d5634d210667c76d8..f1c3c3098dd66a593963c433374ed332e259f151 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "unsafe"
 )
 
@@ -361,7 +362,7 @@ func raceinit() (gctx, pctx uintptr) {
                throw("raceinit: race build must use cgo")
        }
 
-       racecall(&__tsan_init, uintptr(unsafe.Pointer(&gctx)), uintptr(unsafe.Pointer(&pctx)), funcPC(racecallbackthunk), 0)
+       racecall(&__tsan_init, uintptr(unsafe.Pointer(&gctx)), uintptr(unsafe.Pointer(&pctx)), abi.FuncPCABI0(racecallbackthunk), 0)
 
        // Round data segment to page boundaries, because it's used in mmap().
        start := ^uintptr(0)
index 8d4813eadddd5e68a9303a2658d7c7920c22d056..469623ff20a8933cffeba19b393502183b5ec957 100644 (file)
@@ -441,9 +441,7 @@ call:
 // The overall effect of Go->C->Go call chain is similar to that of mcall.
 // RARG0 contains command code. RARG1 contains command-specific context.
 // See racecallback for command codes.
-// Defined as ABIInternal so as to avoid introducing a wrapper,
-// because its address is passed to C via funcPC.
-TEXT   runtime·racecallbackthunk<ABIInternal>(SB), NOSPLIT, $0-0
+TEXT   runtime·racecallbackthunk(SB), NOSPLIT, $0-0
        // Handle command raceGetProcCmd (0) here.
        // First, code below assumes that we are on curg, while raceGetProcCmd
        // can be executed on g0. Second, it is called frequently, so will
index e45fbb4a87a39f8c95973d209c1d93c07b00fd59..afcf4404fba66b3cc6cb8f9edb388cbeb175adbf 100644 (file)
@@ -9,6 +9,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -70,10 +71,10 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        // Go special registers. We inject sigpanic0 (instead of sigpanic),
        // which takes care of that.
        if shouldPushSigpanic(gp, pc, *(*uintptr)(unsafe.Pointer(sp))) {
-               c.pushCall(funcPC(sigpanic0), pc)
+               c.pushCall(abi.FuncPCABI0(sigpanic0), pc)
        } else {
                // Not safe to push the call. Just clobber the frame.
-               c.set_rip(uint64(funcPC(sigpanic0)))
+               c.set_rip(uint64(abi.FuncPCABI0(sigpanic0)))
        }
 }
 
index f2e526973df99dd4c5b1273715549c6bbcd306fb..6396232dd776e9c3b2ba9a7400c163e1062b0078 100644 (file)
@@ -8,6 +8,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/atomic"
        "unsafe"
 )
@@ -329,7 +330,7 @@ func doSigPreempt(gp *g, ctxt *sigctxt) {
        if wantAsyncPreempt(gp) {
                if ok, newpc := isAsyncSafePoint(gp, ctxt.sigpc(), ctxt.sigsp(), ctxt.siglr()); ok {
                        // Adjust the PC and inject a call to asyncPreempt.
-                       ctxt.pushCall(funcPC(asyncPreempt), newpc)
+                       ctxt.pushCall(abi.FuncPCABI0(asyncPreempt), newpc)
                }
        }
 
index f2ce24d735cf1c20ebc29ff797edeca05d866ca0..af15709a4aaba0687ccc32c52288646ffe942300 100644 (file)
@@ -5,6 +5,7 @@
 package runtime
 
 import (
+       "internal/abi"
        "runtime/internal/sys"
        "unsafe"
 )
@@ -27,15 +28,15 @@ func firstcontinuetramp()
 func lastcontinuetramp()
 
 func initExceptionHandler() {
-       stdcall2(_AddVectoredExceptionHandler, 1, funcPC(exceptiontramp))
+       stdcall2(_AddVectoredExceptionHandler, 1, abi.FuncPCABI0(exceptiontramp))
        if _AddVectoredContinueHandler == nil || GOARCH == "386" {
                // use SetUnhandledExceptionFilter for windows-386 or
                // if VectoredContinueHandler is unavailable.
                // note: SetUnhandledExceptionFilter handler won't be called, if debugging.
-               stdcall1(_SetUnhandledExceptionFilter, funcPC(lastcontinuetramp))
+               stdcall1(_SetUnhandledExceptionFilter, abi.FuncPCABI0(lastcontinuetramp))
        } else {
-               stdcall2(_AddVectoredContinueHandler, 1, funcPC(firstcontinuetramp))
-               stdcall2(_AddVectoredContinueHandler, 0, funcPC(lastcontinuetramp))
+               stdcall2(_AddVectoredContinueHandler, 1, abi.FuncPCABI0(firstcontinuetramp))
+               stdcall2(_AddVectoredContinueHandler, 0, abi.FuncPCABI0(lastcontinuetramp))
        }
 }
 
@@ -133,7 +134,7 @@ func exceptionhandler(info *exceptionrecord, r *context, gp *g) int32 {
        // The exception is not from asyncPreempt, so not to push a
        // sigpanic call to make it look like that. Instead, just
        // overwrite the PC. (See issue #35773)
-       if r.ip() != 0 && r.ip() != funcPC(asyncPreempt) {
+       if r.ip() != 0 && r.ip() != abi.FuncPCABI0(asyncPreempt) {
                sp := unsafe.Pointer(r.sp())
                delta := uintptr(sys.StackAlign)
                sp = add(sp, -delta)
@@ -145,7 +146,7 @@ func exceptionhandler(info *exceptionrecord, r *context, gp *g) int32 {
                        *((*uintptr)(sp)) = r.ip()
                }
        }
-       r.set_ip(funcPC(sigpanic0))
+       r.set_ip(abi.FuncPCABI0(sigpanic0))
        return _EXCEPTION_CONTINUE_EXECUTION
 }
 
index 33cc670b641590e6ff7a26dde2505a1cb5f2583e..f22b7ad92820f4d3c46fde8825f0455889aea34e 100644 (file)
@@ -328,9 +328,8 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
        POPQ    BP
        RET
 
-// Defined as ABIInternal since it does not use the stack-based Go ABI.
 // Called using C ABI.
-TEXT runtime·sigtramp<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT,$0
        // Transition from C ABI to Go ABI.
        PUSH_REGS_HOST_TO_ABI0()
 
@@ -348,8 +347,7 @@ TEXT runtime·sigtramp<ABIInternal>(SB),NOSPLIT,$0
 
 // Used instead of sigtramp in programs that use cgo.
 // Arguments from kernel are in DI, SI, DX.
-// Defined as ABIInternal since it does not use the stack-based Go ABI.
-TEXT runtime·cgoSigtramp<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0
        // If no traceback function, do usual sigtramp.
        MOVQ    runtime·cgoTraceback(SB), AX
        TESTQ   AX, AX
@@ -392,12 +390,12 @@ TEXT runtime·cgoSigtramp<ABIInternal>(SB),NOSPLIT,$0
        // The first three arguments, and the fifth, are already in registers.
        // Set the two remaining arguments now.
        MOVQ    runtime·cgoTraceback(SB), CX
-       MOVQ    $runtime·sigtramp<ABIInternal>(SB), R9
+       MOVQ    $runtime·sigtramp(SB), R9
        MOVQ    _cgo_callers(SB), AX
        JMP     AX
 
 sigtramp:
-       JMP     runtime·sigtramp<ABIInternal>(SB)
+       JMP     runtime·sigtramp(SB)
 
 sigtrampnog:
        // Signal arrived on a non-Go thread. If this is SIGPROF, get a
@@ -428,8 +426,7 @@ sigtrampnog:
 // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86_64/sigaction.c
 // The code that cares about the precise instructions used is:
 // https://gcc.gnu.org/viewcvs/gcc/trunk/libgcc/config/i386/linux-unwind.h?revision=219188&view=markup
-// Defined as ABIInternal since it does not use the stack-based Go ABI.
-TEXT runtime·sigreturn<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·sigreturn(SB),NOSPLIT,$0
        MOVQ    $SYS_rt_sigreturn, AX
        SYSCALL
        INT $3  // not reached
index 0b3933502ab3f4f42b8d6e8b2844724bf7a7ab96..cf3a439523c74196e54d44b498e2568d82f08f2e 100644 (file)
@@ -8,7 +8,7 @@
 #include "time_windows.h"
 
 // void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·asmstdcall(SB),NOSPLIT,$0
        MOVL    fn+0(FP), BX
 
        // SetLastError(0).
@@ -147,21 +147,21 @@ done:
        BYTE $0xC2; WORD $4
        RET // unreached; make assembler happy
 
-TEXT runtime·exceptiontramp<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·exceptiontramp(SB),NOSPLIT,$0
        MOVL    $runtime·exceptionhandler(SB), AX
        JMP     sigtramp<>(SB)
 
-TEXT runtime·firstcontinuetramp<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT runtime·firstcontinuetramp(SB),NOSPLIT,$0-0
        // is never called
        INT     $3
 
-TEXT runtime·lastcontinuetramp<ABIInternal>(SB),NOSPLIT,$0-0
+TEXT runtime·lastcontinuetramp(SB),NOSPLIT,$0-0
        MOVL    $runtime·lastcontinuehandler(SB), AX
        JMP     sigtramp<>(SB)
 
 GLOBL runtime·cbctxts(SB), NOPTR, $4
 
-TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·callbackasm1(SB),NOSPLIT,$0
        MOVL    0(SP), AX       // will use to find our callback context
 
        // remove return address from stack, we are not returning to callbackasm, but to its caller.
@@ -180,7 +180,7 @@ TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT,$0
        CLD
 
        // determine index into runtime·cbs table
-       SUBL    $runtime·callbackasm<ABIInternal>(SB), AX
+       SUBL    $runtime·callbackasm(SB), AX
        MOVL    $0, DX
        MOVL    $5, BX  // divide by 5 because each call instruction in runtime·callbacks is 5 bytes long
        DIVL    BX
@@ -250,7 +250,7 @@ TEXT tstart<>(SB),NOSPLIT,$0
        RET
 
 // uint32 tstart_stdcall(M *newm);
-TEXT runtime·tstart_stdcall<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0
        MOVL    newm+0(FP), BX
 
        PUSHL   BX
index e7782846b25c7c3b6f97391bd75c90eeb56adcc8..6cc5bba2b7378b4dd76d53965bc88a1b2c1ca505 100644 (file)
@@ -13,7 +13,7 @@
 #define maxargs 18
 
 // void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
        // asmcgocall will put first argument into CX.
        PUSHQ   CX                      // save for later
        MOVQ    libcall_fn(CX), AX
@@ -179,15 +179,15 @@ done:
 
        RET
 
-TEXT runtime·exceptiontramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·exceptiontramp(SB),NOSPLIT|NOFRAME,$0
        MOVQ    $runtime·exceptionhandler(SB), AX
        JMP     sigtramp<>(SB)
 
-TEXT runtime·firstcontinuetramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT runtime·firstcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0
        MOVQ    $runtime·firstcontinuehandler(SB), AX
        JMP     sigtramp<>(SB)
 
-TEXT runtime·lastcontinuetramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0
        MOVQ    $runtime·lastcontinuehandler(SB), AX
        JMP     sigtramp<>(SB)
 
@@ -212,7 +212,7 @@ TEXT runtime·callbackasm1(SB),NOSPLIT,$0
        ADDQ    $8, SP
 
        // determine index into runtime·cbs table
-       MOVQ    $runtime·callbackasm<ABIInternal>(SB), DX
+       MOVQ    $runtime·callbackasm(SB), DX
        SUBQ    DX, AX
        MOVQ    $0, DX
        MOVQ    $5, CX  // divide by 5 because each call instruction in runtime·callbacks is 5 bytes long
@@ -245,7 +245,7 @@ TEXT runtime·callbackasm1(SB),NOSPLIT,$0
        RET
 
 // uint32 tstart_stdcall(M *newm);
-TEXT runtime·tstart_stdcall<ABIInternal>(SB),NOSPLIT,$0
+TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0
        // Switch from the host ABI to the Go ABI.
        PUSH_REGS_HOST_TO_ABI0()
 
index 48f8c7dedffd5ec8afa7fc22e7156aafc8de5de8..c9e96cb6522a1536f76977cc1a9b3facfa77543a 100644 (file)
@@ -10,7 +10,7 @@
 // Note: For system ABI, R0-R3 are args, R4-R11 are callee-save.
 
 // void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
        MOVM.DB.W [R4, R5, R14], (R13)  // push {r4, r5, lr}
        MOVW    R0, R4                  // put libcall * in r4
        MOVW    R13, R5                 // save stack pointer in r5
@@ -222,21 +222,21 @@ TEXT sigresume<>(SB),NOSPLIT|NOFRAME,$0
        MOVW    R0, R13
        B       (R1)
 
-TEXT runtime·exceptiontramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·exceptiontramp(SB),NOSPLIT|NOFRAME,$0
        MOVW    $runtime·exceptionhandler(SB), R1
        B       sigtramp<>(SB)
 
-TEXT runtime·firstcontinuetramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·firstcontinuetramp(SB),NOSPLIT|NOFRAME,$0
        MOVW    $runtime·firstcontinuehandler(SB), R1
        B       sigtramp<>(SB)
 
-TEXT runtime·lastcontinuetramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0
        MOVW    $runtime·lastcontinuehandler(SB), R1
        B       sigtramp<>(SB)
 
 GLOBL runtime·cbctxts(SB), NOPTR, $4
 
-TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·callbackasm1(SB),NOSPLIT|NOFRAME,$0
        // On entry, the trampoline in zcallback_windows_arm.s left
        // the callback index in R12 (which is volatile in the C ABI).
 
@@ -275,7 +275,7 @@ TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
        B       (R12)   // return
 
 // uint32 tstart_stdcall(M *newm);
-TEXT runtime·tstart_stdcall<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·tstart_stdcall(SB),NOSPLIT|NOFRAME,$0
        MOVM.DB.W [R4-R11, R14], (R13)          // push {r4-r11, lr}
 
        MOVW    m_g0(R0), g
index 7a2e11f5ae29832d6536a1fd11a03a2bdff553b2..1cf877dce90b9fa852682315c0751c9ef7ecfa37 100644 (file)
@@ -18,7 +18,7 @@
 // load_g and save_g (in tls_arm64.s) clobber R27 (REGTMP) and R0.
 
 // void runtime·asmstdcall(void *c);
-TEXT runtime·asmstdcall<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·asmstdcall(SB),NOSPLIT|NOFRAME,$0
        STP.W   (R29, R30), -32(RSP)    // allocate C ABI stack frame
        STP     (R19, R20), 16(RSP) // save old R19, R20
        MOVD    R0, R19 // save libcall pointer
@@ -290,11 +290,11 @@ TEXT sigresume<>(SB),NOSPLIT|NOFRAME,$0
        MOVD    R0, RSP
        B       (R1)
 
-TEXT runtime·exceptiontramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·exceptiontramp(SB),NOSPLIT|NOFRAME,$0
        MOVD    $runtime·exceptionhandler<ABIInternal>(SB), R1
        B       sigtramp<>(SB)
 
-TEXT runtime·firstcontinuetramp<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·firstcontinuetramp(SB),NOSPLIT|NOFRAME,$0
        MOVD    $runtime·firstcontinuehandler<ABIInternal>(SB), R1
        B       sigtramp<>(SB)
 
@@ -304,7 +304,7 @@ TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0
 
 GLOBL runtime·cbctxts(SB), NOPTR, $4
 
-TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT,$208-0
+TEXT runtime·callbackasm1(SB),NOSPLIT,$208-0
        NO_LOCAL_POINTERS
 
        // On entry, the trampoline in zcallback_windows_arm64.s left
@@ -356,7 +356,7 @@ TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT,$208-0
        RET
 
 // uint32 tstart_stdcall(M *newm);
-TEXT runtime·tstart_stdcall<ABIInternal>(SB),NOSPLIT,$96-0
+TEXT runtime·tstart_stdcall(SB),NOSPLIT,$96-0
        SAVE_R19_TO_R28(-10*8)
 
        MOVD    m_g0(R0), g
index 6b9195bcd5253394fd988a9bc0ecce6d832f9528..e045e5f4bfbf52a4b1f6599c449fe00059aae648 100644 (file)
@@ -224,7 +224,7 @@ func callbackasmAddr(i int) uintptr {
                // followed by a branch instruction
                entrySize = 8
        }
-       return funcPC(callbackasm) + uintptr(i*entrySize)
+       return abi.FuncPCABI0(callbackasm) + uintptr(i*entrySize)
 }
 
 const callbackMaxFrame = 64 * sys.PtrSize
index a7a787d8f6d694579f7e7827f7838f74b67ce6df..73f1e567cecf948558a87ab15bff97a83ee36955 100644 (file)
@@ -33,7 +33,7 @@ func genasm386Amd64() {
 // CALL instruction in runtime·callbackasm. This determines
 // which Go callback function is executed later on.
 
-TEXT runtime·callbackasm<ABIInternal>(SB),7,$0
+TEXT runtime·callbackasm(SB),7,$0
 `)
        for i := 0; i < maxCallback; i++ {
                buf.WriteString("\tCALL\truntime·callbackasm1(SB)\n")
@@ -61,7 +61,7 @@ func genasmArm() {
 // It then calls the Go implementation for that callback.
 #include "textflag.h"
 
-TEXT runtime·callbackasm<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
 `)
        for i := 0; i < maxCallback; i++ {
                buf.WriteString(fmt.Sprintf("\tMOVW\t$%d, R12\n", i))
@@ -89,7 +89,7 @@ func genasmArm64() {
 // It then calls the Go implementation for that callback.
 #include "textflag.h"
 
-TEXT runtime·callbackasm<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
 `)
        for i := 0; i < maxCallback; i++ {
                buf.WriteString(fmt.Sprintf("\tMOVD\t$%d, R12\n", i))
index e451c2b9d0508bb5d46deaf3ff4c17a78a936ef5..561527c90d1c4d3e0e886e190e2a5f4632dd47c6 100644 (file)
@@ -11,7 +11,7 @@
 // CALL instruction in runtime·callbackasm. This determines
 // which Go callback function is executed later on.
 
-TEXT runtime·callbackasm<ABIInternal>(SB),7,$0
+TEXT runtime·callbackasm(SB),7,$0
        CALL    runtime·callbackasm1(SB)
        CALL    runtime·callbackasm1(SB)
        CALL    runtime·callbackasm1(SB)
index a73a813acb3c5d9095699165125f139a7fde9554..f943d84cbfe5fddfd47ae7090658db059d70f6c8 100644 (file)
@@ -9,7 +9,7 @@
 // It then calls the Go implementation for that callback.
 #include "textflag.h"
 
-TEXT runtime·callbackasm<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
        MOVW    $0, R12
        B       runtime·callbackasm1(SB)
        MOVW    $1, R12
index 2a6bda0990c108d3c180929ddcfe31ff34dba166..69fb05788cdab23883725e7b41cbf6a7f325692e 100644 (file)
@@ -9,7 +9,7 @@
 // It then calls the Go implementation for that callback.
 #include "textflag.h"
 
-TEXT runtime·callbackasm<ABIInternal>(SB),NOSPLIT|NOFRAME,$0
+TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
        MOVD    $0, R12
        B       runtime·callbackasm1(SB)
        MOVD    $1, R12