]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add nowritebarrierrec to funcs called at signal time
authorIan Lance Taylor <iant@golang.org>
Fri, 8 Jan 2016 04:28:04 +0000 (20:28 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Jan 2016 17:26:28 +0000 (17:26 +0000)
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>

src/runtime/os3_solaris.go
src/runtime/signal2_unix.go
src/runtime/signal_darwin.go
src/runtime/signal_freebsd.go
src/runtime/signal_openbsd.go
src/runtime/signal_sigtramp.go
src/runtime/sigqueue.go

index 940a841c1082b6383c4304ebb5d5d1c30c7f227b..a112b2edd0d1761ec674a497f6532a3353acf53b 100644 (file)
@@ -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)))
 }
 
+//go:nosplit
+//go:nowritebarrierrec
 func sigaltstack(ss *sigaltstackt, oss *sigaltstackt) /* int32 */ {
        sysvicall2(&libc_sigaltstack, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(oss)))
 }
index 490a69d56db69715ca1a2e824d40ada369e14ed6..7481b8570ac24ecf294857ab533af8e81315fc7d 100644 (file)
@@ -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
 // signal to the handler that was installed before Go's.  Returns whether the
 // signal was forwarded.
+// This is called by the signal handler, and the world may be stopped.
 //go:nosplit
+//go:nowritebarrierrec
 func sigfwdgo(sig uint32, info *siginfo, ctx unsafe.Pointer) bool {
        if sig >= uint32(len(sigtable)) {
                return false
index 542169c9f8b8986887227fe184d88e840c7121a4..8d43724e2fe136117fce960e30d29068aea2fe04 100644 (file)
@@ -50,6 +50,7 @@ var sigtable = [...]sigTabT{
 func sigreturn(ctx unsafe.Pointer, infostyle uint32)
 
 //go:nosplit
+//go:nowritebarrierrec
 func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Pointer) {
        if sigfwdgo(sig, info, ctx) {
                sigreturn(ctx, infostyle)
index 7c98cf372bddc22b7ef9b2b29bdf49b7b9237119..f3411aac6afd2121b109acf4846e51d64b649f3f 100644 (file)
@@ -48,6 +48,7 @@ var sigtable = [...]sigTabT{
 }
 
 //go:nosplit
+//go:nowritebarrierrec
 func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
        if sigfwdgo(sig, info, ctx) {
                return
index d1e48c43fc1017b77ed01c7bca92ffef5238b253..d0239b1d91f2c7ca89fb2b2d1a5eb0b96f2c9221 100644 (file)
@@ -48,6 +48,7 @@ var sigtable = [...]sigTabT{
 }
 
 //go:nosplit
+//go:nowritebarrierrec
 func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
        if sigfwdgo(sig, info, ctx) {
                return
index 5197a3d70bf521b27e900d66219d58559267d8c3..00ab03846e1b8946f21a232da7501a66edf32005 100644 (file)
@@ -9,7 +9,9 @@ package runtime
 import "unsafe"
 
 // Continuation of the (assembly) sigtramp() logic.
+// This may be called with the world stopped.
 //go:nosplit
+//go:nowritebarrierrec
 func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
        if sigfwdgo(sig, info, ctx) {
                return
index 84616ebceba780beec8eb00c8e3b2b815f2cbcb5..546d3abb248c02dae48563dfb4e85fa17d872ee7 100644 (file)
@@ -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.
 //go:nosplit
 //go:norace
+//go:nowritebarrierrec
 func badsignal(sig uintptr) {
        cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
 }