Permalink
Browse files

Change str/ldr again for arm32

Turns out str.w and ldr.w are not always
supported (e.g. compiling thumb for android).
Change it to str/ldr r0 with mov to/from r0,
so it should work everywhere.
  • Loading branch information...
snaury committed Feb 4, 2012
1 parent e856969 commit 013b8252e1be18855a23c77fbf3a51b19d8eb1ea
Showing with 2 additions and 2 deletions.
  1. +2 −2 platform/switch_arm32_gcc.h
@@ -45,7 +45,7 @@ slp_switch(void)
void *fp;
register int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
- __asm__ volatile ("str.w fp,%0" : "=m" (fp));
+ __asm__ volatile ("mov r0, fp\n\tstr r0, %0" : "=m" (fp) : : "r0");
__asm__ ("mov %0,sp" : "=r" (stackref));
{
SLP_SAVE_STATE(stackref, stsizediff);
@@ -57,7 +57,7 @@ slp_switch(void)
);
SLP_RESTORE_STATE();
}
- __asm__ volatile ("ldr.w fp,%0" : : "m" (fp));
+ __asm__ volatile ("ldr r0, %0\n\tmov fp, r0" : : "m" (fp) : "r0");
__asm__ volatile ("" : : : REGS_TO_SAVE);
return 0;
}

0 comments on commit 013b825

Please sign in to comment.