Skip to content

Commit

Permalink
Merge pull request #419 from barracuda156/powerpc
Browse files Browse the repository at this point in the history
Unbreak PowerPC build on macOS
  • Loading branch information
jamadden authored Sep 20, 2024
2 parents 6105b1a + 473ff40 commit 6081a16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/greenlet/platform/switch_ppc_macosx.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ slp_switch(void)
int err;
int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("; asm block 2\n\tmr %0, r1" : "=g" (stackref) : );
__asm__ ("; asm block 2\n\tmr %0, r1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
Expand All @@ -58,7 +58,7 @@ slp_switch(void)
"\tadd r1, r1, r11\n"
"\tadd r30, r30, r11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "r11"
);
SLP_RESTORE_STATE();
Expand Down
4 changes: 2 additions & 2 deletions src/greenlet/platform/switch_ppc_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ slp_switch(void)
int err;
int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("mr %0, 1" : "=g" (stackref) : );
__asm__ ("mr %0, 1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
"mr 11, %0\n"
"add 1, 1, 11\n"
"add 30, 30, 11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "11"
);
SLP_RESTORE_STATE();
Expand Down
2 changes: 1 addition & 1 deletion src/greenlet/slp_platformselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
# include "platform/switch_ppc64_linux.h" /* gcc on PowerPC 64-bit */
#elif defined(__GNUC__) && defined(__PPC__) && (defined(__linux__) || defined(__FreeBSD__))
# include "platform/switch_ppc_linux.h" /* gcc on PowerPC */
#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__)
#elif defined(__GNUC__) && defined(__POWERPC__) && defined(__APPLE__)
# include "platform/switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */
#elif defined(__GNUC__) && defined(__powerpc64__) && defined(_AIX)
# include "platform/switch_ppc64_aix.h" /* gcc on AIX/PowerPC 64-bit */
Expand Down

0 comments on commit 6081a16

Please sign in to comment.