arm: userspace: Do not overwrite r7 during syscall.
The r7 register is used as a frame pointer on ARM Thumb. As result, it cannot be modified by the assembly code in functions using stack frame. This commit replaces r7 by r8, which is a general purpose register. Also it fixes #7704. Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
parent
817e3cd952
commit
997a49ade9
3 changed files with 11 additions and 11 deletions
|
@ -365,10 +365,10 @@ _oops:
|
|||
* r4 - arg5
|
||||
* r5 - arg6
|
||||
* r6 - call_id
|
||||
* r7 - saved link register
|
||||
* r8 - saved link register
|
||||
*/
|
||||
_do_syscall:
|
||||
ldr r7, [r0, #24] /* grab address of PC from stack frame */
|
||||
ldr r8, [r0, #24] /* grab address of PC from stack frame */
|
||||
ldr r1, =_arm_do_syscall
|
||||
str r1, [r0, #24] /* overwrite the LR to point to _arm_do_syscall */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue