Skip to content

Commit

Permalink
Restore fastcontext support for big-endian PPC64
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
PHHargrove committed Oct 17, 2024
1 parent a4ac8ee commit 8b48a1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fastcontext/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ void INTERNAL qt_makectxt(uctxt_t *ucp, void (*func)(void), int argc, ...) {
tos = (unsigned long *)ucp->uc_stack.ss_sp +
ucp->uc_stack.ss_size / sizeof(unsigned long);
sp = tos - 16;
#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
ucp->mc.pc = *(long*)func;
#else
ucp->mc.pc = (long)func;
#endif
ucp->mc.sp = (long)sp;
va_start(arg, argc);
ucp->mc.r3 = va_arg(arg, long);
Expand Down

0 comments on commit 8b48a1d

Please sign in to comment.