]> Cypherpunks repositories - gostls13.git/commit
runtime: pass to signal handler value of g at time of signal
authorRuss Cox <rsc@golang.org>
Wed, 23 Feb 2011 19:47:42 +0000 (14:47 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 23 Feb 2011 19:47:42 +0000 (14:47 -0500)
commit690291a2c008ec4adf754a394437f1e9f6d46aba
tree2dfc612a8aa2fad674aff6966899e858fccfe906
parent4b376ef328c69a803bcb801b122b4bfc270a403d
runtime: pass to signal handler value of g at time of signal

The existing code assumed that signals only arrived
while executing on the goroutine stack (g == m->curg),
not while executing on the scheduler stack (g == m->g0).

Most of the signal handling trampolines correctly saved
and restored g already, but the sighandler C code did not
have access to it.

Some rewriting of assembly to make the various
implementations as similar as possible.

Will need to change Windows too but I don't
understand how sigtramp gets called there.

R=r
CC=golang-dev
https://golang.org/cl/4203042
14 files changed:
src/pkg/runtime/darwin/386/signal.c
src/pkg/runtime/darwin/386/sys.s
src/pkg/runtime/darwin/amd64/signal.c
src/pkg/runtime/darwin/amd64/sys.s
src/pkg/runtime/freebsd/386/signal.c
src/pkg/runtime/freebsd/386/sys.s
src/pkg/runtime/freebsd/amd64/signal.c
src/pkg/runtime/freebsd/amd64/sys.s
src/pkg/runtime/linux/386/signal.c
src/pkg/runtime/linux/386/sys.s
src/pkg/runtime/linux/amd64/signal.c
src/pkg/runtime/linux/amd64/sys.s
src/pkg/runtime/linux/arm/signal.c
src/pkg/runtime/linux/arm/sys.s