aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_ppc64x.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/sys_linux_ppc64x.s')
-rw-r--r--src/runtime/sys_linux_ppc64x.s23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s
index d105585b7e..32db3c6b50 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -447,12 +447,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
MOVD 24(R1), R2
RET
-#ifdef GO_PPC64X_HAS_FUNCDESC
-DEFINE_PPC64X_FUNCDESC(runtime·sigtramp, sigtramp<>)
-// cgo isn't supported on ppc64, but we need to supply a cgoSigTramp function.
-DEFINE_PPC64X_FUNCDESC(runtime·cgoSigtramp, sigtramp<>)
-TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
-#else
+#ifdef GOARCH_ppc64le
// ppc64le doesn't need function descriptors
// Save callee-save registers in the case of signal forwarding.
// Same as on ARM64 https://golang.org/issue/31827 .
@@ -461,6 +456,13 @@ TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
// a function pointer) as R2 may not be preserved when calling this
// function. In those cases, the caller preserves their R2.
TEXT runtime·sigtramp(SB),NOSPLIT|NOFRAME,$0
+#else
+// function descriptor for the real sigtramp
+TEXT runtime·sigtramp(SB),NOSPLIT|NOFRAME,$0
+ DWORD $sigtramp<>(SB)
+ DWORD $0
+ DWORD $0
+TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
#endif
// This is called with ELF calling conventions. Convert to Go.
// Allocate space for argument storage to call runtime.sigtrampgo.
@@ -489,6 +491,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT|NOFRAME,$0
RET
#ifdef GOARCH_ppc64le
+// ppc64le doesn't need function descriptors
TEXT runtime·cgoSigtramp(SB),NOSPLIT|NOFRAME,$0
// The stack unwinder, presumably written in C, may not be able to
// handle Go frame correctly. So, this function is NOFRAME, and we
@@ -583,6 +586,14 @@ sigtrampnog:
MOVD R12, CTR
MOVD R10, LR // restore LR
JMP (CTR)
+#else
+// function descriptor for the real sigtramp
+TEXT runtime·cgoSigtramp(SB),NOSPLIT|NOFRAME,$0
+ DWORD $cgoSigtramp<>(SB)
+ DWORD $0
+ DWORD $0
+TEXT cgoSigtramp<>(SB),NOSPLIT,$0
+ JMP sigtramp<>(SB)
#endif
// Used by cgoSigtramp to inspect without clobbering R30/R31 via runtime.load_g.