Skip to content

Commit ef8e9c6

Browse files
committed
fix compilation under MIPS and newer binutils
addu needs 3 parameters, not two. Also, this function fundamentally does not support MIPS16. Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 parent dc04a9f commit ef8e9c6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/greenlet/platform/switch_mips_unix.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#define REGS_TO_SAVE "$16", "$17", "$18", "$19", "$20", "$21", "$22", \
1818
"$23", "$30"
19+
__attribute__((nomips16))
1920
static int
2021
slp_switch(void)
2122
{
@@ -33,9 +34,9 @@ slp_switch(void)
3334
SLP_SAVE_STATE(stackref, stsizediff);
3435
__asm__ __volatile__ (
3536
#ifdef __mips64
36-
"daddu $29, %0\n"
37+
"daddu $29, $29, %0\n"
3738
#else
38-
"addu $29, %0\n"
39+
"addu $29, $29, %0\n"
3940
#endif
4041
: /* no outputs */
4142
: "r" (stsizediff)

0 commit comments

Comments
 (0)