make arm setjmp/longjmp asm thumb2-compatible

sp cannot be used in the ldm/stm register set in thumb mode.
This commit is contained in:
Rich Felker 2016-12-17 19:30:03 -05:00
parent 61ff1af76f
commit fbbeda172d
2 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,9 @@ longjmp:
mov ip,r0
movs r0,r1
moveq r0,#1
ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp,sp,lr}
ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp}
ldmia ip!, {r2,lr}
mov sp,r2
adr r1,1f
ldr r2,1f

View File

@ -9,7 +9,9 @@ __setjmp:
_setjmp:
setjmp:
mov ip,r0
stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,sp,lr}
stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp}
mov r2,sp
stmia ip!,{r2,lr}
mov r0,#0
adr r1,1f