From 4ac638f4b7c49370a62db4e6232f2895d7bbda0d Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Fri, 31 Mar 2023 19:56:26 +0000 Subject: Revert "Revert "runtime: consolidate function descriptor definitions on PPC64"" This reverts CL 481059, which in turn reverts CL 478917. Reason for revert: reapply the original CL. Change-Id: Icf6bb6a620313b44fadcc7f69a62fdbb943e34fd Reviewed-on: https://go-review.googlesource.com/c/go/+/481075 TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky Run-TryBot: Cherry Mui Reviewed-by: Paul Murphy --- src/runtime/sys_linux_ppc64x.s | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/runtime/sys_linux_ppc64x.s') diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index ec9b966c8c..44cd0e7b3e 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -447,18 +447,16 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 MOVD 24(R1), R2 RET -#ifdef GOARCH_ppc64le +#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 // 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 @@ -627,7 +625,6 @@ TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$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 @@ -722,14 +719,6 @@ 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. -- cgit v1.3-5-g9baa