Skip to content

Commit 8b48a1d

Browse files
committed
Restore fastcontext support for big-endian PPC64
This commit restores support in fastcontext for the "function descriptor" of the 64-bit PowerPC ELF ABI, which is common to both AIX and Linux on big-endian PPC64. It appears to have been unintentionally removed along with AIX support in pull request #277 due to the (unfortunate) choice of `QTHREAD_PPC_ABI_AIX` to identify this ABI. Partially reverts 4f3031c Signed-off-by: Paul H. Hargrove <[email protected]>
1 parent a4ac8ee commit 8b48a1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/fastcontext/context.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ void INTERNAL qt_makectxt(uctxt_t *ucp, void (*func)(void), int argc, ...) {
2727
tos = (unsigned long *)ucp->uc_stack.ss_sp +
2828
ucp->uc_stack.ss_size / sizeof(unsigned long);
2929
sp = tos - 16;
30+
#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
31+
ucp->mc.pc = *(long*)func;
32+
#else
3033
ucp->mc.pc = (long)func;
34+
#endif
3135
ucp->mc.sp = (long)sp;
3236
va_start(arg, argc);
3337
ucp->mc.r3 = va_arg(arg, long);

0 commit comments

Comments
 (0)