mirror of
https://github.com/golang/go.git
synced 2025-05-29 03:11:26 +00:00
runtime: add nowritebarrierrec to funcs called at signal time
Also nosplit where needed. Change-Id: I1e3f6f8f76df9ee7e87ed1b8560cef145928314c Reviewed-on: https://go-review.googlesource.com/18395 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
a120beaa8d
commit
84a95be922
@ -520,6 +520,8 @@ func sigaction(sig int32, act *sigactiont, oact *sigactiont) /* int32 */ {
|
|||||||
sysvicall3(&libc_sigaction, uintptr(sig), uintptr(unsafe.Pointer(act)), uintptr(unsafe.Pointer(oact)))
|
sysvicall3(&libc_sigaction, uintptr(sig), uintptr(unsafe.Pointer(act)), uintptr(unsafe.Pointer(oact)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigaltstack(ss *sigaltstackt, oss *sigaltstackt) /* int32 */ {
|
func sigaltstack(ss *sigaltstackt, oss *sigaltstackt) /* int32 */ {
|
||||||
sysvicall2(&libc_sigaltstack, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(oss)))
|
sysvicall2(&libc_sigaltstack, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(oss)))
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,9 @@ func sigfwd(fn uintptr, sig uint32, info *siginfo, ctx unsafe.Pointer)
|
|||||||
// Determines if the signal should be handled by Go and if not, forwards the
|
// Determines if the signal should be handled by Go and if not, forwards the
|
||||||
// signal to the handler that was installed before Go's. Returns whether the
|
// signal to the handler that was installed before Go's. Returns whether the
|
||||||
// signal was forwarded.
|
// signal was forwarded.
|
||||||
|
// This is called by the signal handler, and the world may be stopped.
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigfwdgo(sig uint32, info *siginfo, ctx unsafe.Pointer) bool {
|
func sigfwdgo(sig uint32, info *siginfo, ctx unsafe.Pointer) bool {
|
||||||
if sig >= uint32(len(sigtable)) {
|
if sig >= uint32(len(sigtable)) {
|
||||||
return false
|
return false
|
||||||
|
@ -50,6 +50,7 @@ var sigtable = [...]sigTabT{
|
|||||||
func sigreturn(ctx unsafe.Pointer, infostyle uint32)
|
func sigreturn(ctx unsafe.Pointer, infostyle uint32)
|
||||||
|
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
||||||
if sigfwdgo(sig, info, ctx) {
|
if sigfwdgo(sig, info, ctx) {
|
||||||
sigreturn(ctx, infostyle)
|
sigreturn(ctx, infostyle)
|
||||||
|
@ -48,6 +48,7 @@ var sigtable = [...]sigTabT{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
||||||
if sigfwdgo(sig, info, ctx) {
|
if sigfwdgo(sig, info, ctx) {
|
||||||
return
|
return
|
||||||
|
@ -48,6 +48,7 @@ var sigtable = [...]sigTabT{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
||||||
if sigfwdgo(sig, info, ctx) {
|
if sigfwdgo(sig, info, ctx) {
|
||||||
return
|
return
|
||||||
|
@ -9,7 +9,9 @@ package runtime
|
|||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
// Continuation of the (assembly) sigtramp() logic.
|
// Continuation of the (assembly) sigtramp() logic.
|
||||||
|
// This may be called with the world stopped.
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
|
//go:nowritebarrierrec
|
||||||
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
||||||
if sigfwdgo(sig, info, ctx) {
|
if sigfwdgo(sig, info, ctx) {
|
||||||
return
|
return
|
||||||
|
@ -180,6 +180,7 @@ func signal_ignored(s uint32) bool {
|
|||||||
// This runs on a foreign stack, without an m or a g. No stack split.
|
// This runs on a foreign stack, without an m or a g. No stack split.
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
//go:norace
|
//go:norace
|
||||||
|
//go:nowritebarrierrec
|
||||||
func badsignal(sig uintptr) {
|
func badsignal(sig uintptr) {
|
||||||
cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
|
cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user