diff options
author | Alexey Borzenkov <snaury@gmail.com> | 2014-09-21 00:12:02 +0400 |
---|---|---|
committer | Alexey Borzenkov <snaury@gmail.com> | 2014-09-21 00:12:02 +0400 |
commit | 1eef4bf0deda51ae3a25e1d999b9dfd1c0bb33d7 (patch) | |
tree | ddc8f8864a7e6c923e713a15ba06164a676b7a26 | |
parent | e13c4db97082489a453af830395738abe7d8827e (diff) | |
parent | 4d8bc09f455ca7c2034e7df2b692b54d2e44e9ac (diff) | |
download | greenlet-1eef4bf0deda51ae3a25e1d999b9dfd1c0bb33d7.tar.gz |
Merge pull request #58 from madisongh/master
Re-code the saving of the gp register for MIPS64 so it compiles
-rw-r--r-- | platform/switch_mips_unix.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/platform/switch_mips_unix.h b/platform/switch_mips_unix.h index 94b5489..c35f6e6 100644 --- a/platform/switch_mips_unix.h +++ b/platform/switch_mips_unix.h @@ -12,18 +12,19 @@ #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 + 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); @@ -38,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; } |