Commit 294963fb authored by Austin Clements's avatar Austin Clements

runtime: document sigtrampgo better

Add an explanation of why sigtrampgo is nosplit.

Updates #21314.

Change-Id: I3f5909d2b2c180f9fa74d53df13e501826fd4316
Reviewed-on: https://go-review.googlesource.com/79615Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent b6cf58d5
...@@ -275,6 +275,12 @@ func sigpipe() { ...@@ -275,6 +275,12 @@ func sigpipe() {
// sigtrampgo is called from the signal handler function, sigtramp, // sigtrampgo is called from the signal handler function, sigtramp,
// written in assembly code. // written in assembly code.
// This is called by the signal handler, and the world may be stopped. // This is called by the signal handler, and the world may be stopped.
//
// It must be nosplit because getg() is still the G that was running
// (if any) when the signal was delivered, but it's (usually) called
// on the gsignal stack. Until this switches the G to gsignal, the
// stack bounds check won't work.
//
//go:nosplit //go:nosplit
//go:nowritebarrierrec //go:nowritebarrierrec
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) { func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment