]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64
authorCherry Zhang <cherryyz@google.com>
Tue, 2 Feb 2021 22:26:57 +0000 (17:26 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 5 Feb 2021 16:09:50 +0000 (16:09 +0000)
commit63de2110148eec432c4954dced7ff674a4942115
tree33cf248e00d5e8d62ce22a060a3252b753b22fed
parent120b819f45d1c109a1c2ef380edde9e826862a5c
[dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64

Currently, when using cgo, the g pointer is set via a separate
call to setg_gcc or with inline assembly in threadentry. This CL
changes it to call setg_gcc in crosscall_amd64, like other g-
register platforms. When we have an actual g register on AMD64,
we'll need to set the register immediately before calling into
Go.

Change-Id: Ib1171e05cd0dabba3b7d12e072084d141051cf3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/289192
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/cgo/gcc_amd64.S
src/runtime/cgo/gcc_darwin_amd64.c
src/runtime/cgo/gcc_dragonfly_amd64.c
src/runtime/cgo/gcc_freebsd_amd64.c
src/runtime/cgo/gcc_linux_amd64.c
src/runtime/cgo/gcc_netbsd_amd64.c
src/runtime/cgo/gcc_openbsd_amd64.c
src/runtime/cgo/gcc_solaris_amd64.c
src/runtime/cgo/gcc_windows_amd64.c
src/runtime/cgo/libcgo.h