summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Madison <madison@bliss-m.org>2014-09-18 11:53:12 -0700
committerMatt Madison <madison@bliss-m.org>2014-09-18 12:39:44 -0700
commitb81b53dd33ccc80b8654dd0181c4fbe71397ab9d (patch)
tree45b1f4655c18b5f6f6d0deb17a1b8cd93137d7eb
parent602e9047a20122e00906ab61b0c7cf3e322225fc (diff)
downloadgreenlet-b81b53dd33ccc80b8654dd0181c4fbe71397ab9d.tar.gz
Re-code the saving of the gp register for MIPS64 so it compiles under
recent versions of gcc.
-rw-r--r--platform/switch_mips_unix.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/switch_mips_unix.h b/platform/switch_mips_unix.h
index 94b5489..9acf2b5 100644
--- a/platform/switch_mips_unix.h
+++ b/platform/switch_mips_unix.h
@@ -12,17 +12,16 @@
#define STACK_MAGIC 0
-#ifdef __mips64
-#define REGS_TO_SAVE "$16", "$17", "$18", "$19", "$20", "$21", "$22", \
- "$23", "$28", "$30"
-#else
#define REGS_TO_SAVE "$16", "$17", "$18", "$19", "$20", "$21", "$22", \
"$23", "$30"
-#endif
static int
slp_switch(void)
{
register int *stackref, stsizediff;
+#ifdef __mips64
+ volatile register void *gp __asm__("$28");
+ volatile void *gpsave = gp;
+#endif
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
__asm__ ("move %0, $29" : "=r" (stackref) : );
{
@@ -39,6 +38,9 @@ slp_switch(void)
SLP_RESTORE_STATE();
}
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
+#ifdef __mips64
+ gp = gpsave;
+#endif
return 0;
}