Skip to content

Commit 5fca9c6

Browse files
Merge pull request #301 from PHHargrove/ppc64be-fastcontext
Restore fastcontext support for big-endian PPC64
2 parents 8e5c323 + 8b48a1d commit 5fca9c6

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)