1
0
mirror of https://github.com/golang/go synced 2024-11-22 20:14:40 -07:00

[dev.typeparams] runtime: use internal/abi.FuncPCABI0 for sigtramp PC on FreeBSD

Same as CL 313230, for FreeBSD. sigtramp is the only one we need.

Change-Id: Iefc00c1cb7e70b08a07c3bc3604b2114fd86563d
Reviewed-on: https://go-review.googlesource.com/c/go/+/320912
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2021-05-18 12:47:30 -04:00
parent f39200b037
commit 077f03f4d8
2 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,8 @@
package runtime
import "internal/abi"
//go:nosplit
//go:nowritebarrierrec
func setsig(i uint32, fn uintptr) {
@ -14,7 +16,7 @@ func setsig(i uint32, fn uintptr) {
sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
sa.sa_mask = sigset_all
if fn == funcPC(sighandler) {
fn = funcPC(sigtramp)
fn = abi.FuncPCABI0(sigtramp)
}
sa.sa_handler = fn
sigaction(i, &sa, nil)

View File

@ -4,6 +4,8 @@
package runtime
import "internal/abi"
func cgoSigtramp()
//go:nosplit
@ -14,9 +16,9 @@ func setsig(i uint32, fn uintptr) {
sa.sa_mask = sigset_all
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