diff options
| author | Joel Sing <joel@sing.id.au> | 2018-04-06 05:00:25 +1000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-04-05 19:29:35 +0000 |
| commit | a7bb8d3eb8ffd99fc6728dd1b27152cebbb45dc4 (patch) | |
| tree | d8f0e90fe9e200d388fe34716085b775d731f011 /src/runtime/sys_openbsd_amd64.s | |
| parent | d3026dd30ac8a5254ec2165938624397fdecf132 (diff) | |
| download | go-a7bb8d3eb8ffd99fc6728dd1b27152cebbb45dc4.tar.xz | |
runtime: fix/improve exitThread on openbsd
OpenBSD's __threxit syscall takes a pointer to a 32-bit value that will be
zeroed immediately before the thread exits. Make use of this instead of
zeroing freeWait from the exitThread assembly and using hacks like switching
to a static stack, so this works on 386.
Change-Id: I3ec5ead82b6496404834d148f713794d5d9da723
Reviewed-on: https://go-review.googlesource.com/105055
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_openbsd_amd64.s')
| -rw-r--r-- | src/runtime/sys_openbsd_amd64.s | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/runtime/sys_openbsd_amd64.s b/src/runtime/sys_openbsd_amd64.s index 658f2c49dc..38ac38d9bf 100644 --- a/src/runtime/sys_openbsd_amd64.s +++ b/src/runtime/sys_openbsd_amd64.s @@ -90,10 +90,7 @@ TEXT runtime·exit(SB),NOSPLIT,$-8 // func exitThread(wait *uint32) TEXT runtime·exitThread(SB),NOSPLIT,$0-8 - MOVQ wait+0(FP), AX - // We're done using the stack. - MOVL $0, (AX) - MOVQ $0, DI // arg 1 - notdead + MOVQ wait+0(FP), DI // arg 1 - notdead MOVL $302, AX // sys___threxit SYSCALL MOVL $0xf1, 0xf1 // crash |
