aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_ppc64x.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-12-16 18:34:55 -0500
committerAustin Clements <austin@google.com>2015-01-07 20:36:27 +0000
commitaf7ca8dce4991860263d5e0d0322461cfd00c599 (patch)
treed590342faa9de3ff44ed3f50dffd1e94abf29fc4 /src/runtime/sys_linux_ppc64x.s
parentf1c4444dfcca5967543d43190b6c80c9254b99ac (diff)
downloadgo-af7ca8dce4991860263d5e0d0322461cfd00c599.tar.gz
go-af7ca8dce4991860263d5e0d0322461cfd00c599.zip
cmd/cgo, runtime/cgo: support ppc64
This implements support for calls to and from C in the ppc64 C ABI, as well as supporting functionality such as an entry point from the dynamic linker. Change-Id: I68da6df50d5638cb1a3d3fef773fb412d7bf631a Reviewed-on: https://go-review.googlesource.com/2009 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_ppc64x.s')
-rw-r--r--src/runtime/sys_linux_ppc64x.s7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s
index 4a4f440c53..b9d8be11c5 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -193,6 +193,13 @@ TEXT runtime·_sigtramp(SB),NOSPLIT,$64
// initialize essential registers (just in case)
BL runtime·reginit(SB)
+ // this might be called in external code context,
+ // where g is not set.
+ MOVB runtime·iscgo(SB), R6
+ CMP R6, $0
+ BEQ 2(PC)
+ BL runtime·load_g(SB)
+
// check that g exists
CMP g, $0
BNE 6(PC)