]> Cypherpunks repositories - gostls13.git/commit
runtime: update newosproc asm to access m.id directly
authorMatthew Dempsky <mdempsky@google.com>
Thu, 12 Nov 2015 22:26:19 +0000 (14:26 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 12 Nov 2015 23:16:33 +0000 (23:16 +0000)
commitdbdd8c2c94ec118050331455681606b9f14b6244
treece8e62d3530479371cb4d67af490b46601ed93b3
parentc83c8065355c7ccef33eb0ebc870bf648d3d89cb
runtime: update newosproc asm to access m.id directly

darwin/386, freebsd/386, and linux/386 use a setldt system call to
setup each M's thread-local storage area, and they need access to the
M's id for this.  The current code copies m.id into m.tls[0] (and this
logic has been cargo culted to OSes like NetBSD and OpenBSD, which
don't even need m.id to configure TLS), and then the 386 assembly
loads m.tls[0]... but since the assembly code already has a pointer to
the M, it might as well just load m.id directly.

Change-Id: I1a7278f1ec8ebda8d1de3aa3a61993070e3a8cdf
Reviewed-on: https://go-review.googlesource.com/16881
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/os1_darwin.go
src/runtime/os1_dragonfly.go
src/runtime/os1_freebsd.go
src/runtime/os1_linux.go
src/runtime/os1_netbsd.go
src/runtime/os1_openbsd.go
src/runtime/sys_darwin_386.s
src/runtime/sys_freebsd_386.s
src/runtime/sys_linux_386.s