Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-code the saving of the gp register for MIPS64 so it compiles #58

Merged
merged 5 commits into from
Sep 20, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions platform/switch_mips_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down