summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Madison <madison@bliss-m.org>2014-09-20 13:04:06 -0700
committerMatt Madison <madison@bliss-m.org>2014-09-20 13:04:06 -0700
commit4d8bc09f455ca7c2034e7df2b692b54d2e44e9ac (patch)
tree48fac5b1e82696c6c864adb398278d077f4f1735
parent55e5a8fadc0dd3abedabb71cf2d1634dbc32e975 (diff)
downloadgreenlet-4d8bc09f455ca7c2034e7df2b692b54d2e44e9ac.tar.gz
Add back in the explicit save/restore, in case there is a
situation where the compiler does not automatically save it for us. Eliminate the special handling for N32 ABI, as registers are still 64 bits in that case.
-rw-r--r--platform/switch_mips_unix.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/switch_mips_unix.h b/platform/switch_mips_unix.h
index e3a2218..c35f6e6 100644
--- a/platform/switch_mips_unix.h
+++ b/platform/switch_mips_unix.h
@@ -18,7 +18,13 @@ static int
slp_switch(void)
{
register int *stackref, stsizediff;
+#ifdef __mips64
+ uint64_t gpsave;
+#endif
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
+#ifdef __mips64
+ __asm__ __volatile__ ("sd $28,%0" : "=m" (gpsave) : : );
+#endif
__asm__ ("move %0, $29" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
@@ -33,6 +39,9 @@ slp_switch(void)
);
SLP_RESTORE_STATE();
}
+#ifdef __mips64
+ __asm__ __volatile__ ("ld $28,%0" : : "m" (gpsave) : );
+#endif
__asm__ __volatile__ ("" : : : REGS_TO_SAVE);
return 0;
}