Skip to content

Commit

Permalink
Merge pull request #65 from basak/unoptimize-return-value
Browse files Browse the repository at this point in the history
arm32: force return value from asm
  • Loading branch information
snaury committed Oct 14, 2014
2 parents 1565ffb + 505c91a commit f90dbe4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions platform/switch_arm32_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ slp_switch(void)
{
void *fp;
register int *stackref, stsizediff;
int result;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ volatile ("mov r0," REG_FP "\n\tstr r0,%0" : "=m" (fp) : : "r0");
__asm__ ("mov %0," REG_SP : "=r" (stackref));
Expand All @@ -70,9 +71,9 @@ slp_switch(void)
);
SLP_RESTORE_STATE();
}
__asm__ volatile ("ldr r0,%0\n\tmov " REG_FP ",r0" : : "m" (fp) : "r0");
__asm__ volatile ("ldr r0,%1\n\tmov " REG_FP ",r0\n\tmov %0, #0" : "=r" (result) : "m" (fp) : "r0");
__asm__ volatile ("" : : : REGS_TO_SAVE);
return 0;
return result;
}

#endif

0 comments on commit f90dbe4

Please sign in to comment.