aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_ppc64x.s
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2023-03-31 19:03:42 +0000
committerCherry Mui <cherryyz@google.com>2023-03-31 19:15:18 +0000
commite72cd86b360aa523ca7af552b7ad9d3e57b28e35 (patch)
treea1c918596ee38a2ea755a7a92f10fc20de7094ed /src/runtime/sys_linux_ppc64x.s
parent63ef9059a2e920d22522f9be068df357fab3d1f6 (diff)
downloadgo-e72cd86b360aa523ca7af552b7ad9d3e57b28e35.tar.xz
Revert "runtime: consolidate function descriptor definitions on PPC64"
This reverts CL 478917. Reason for revert: need to revert CL 392854, and this caused a conflict. Change-Id: I02c3285de5635b431a99adc8790c8310d1c4e6a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/481059 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
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 44cd0e7b3e..ec9b966c8c 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -447,16 +447,18 @@ 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 .
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
// Start with standard C stack frame layout and linkage.
MOVD LR, R0
@@ -625,6 +627,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
@@ -719,6 +722,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.