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:
Piotr Zięcik 2018-06-01 08:49:14 +02:00 committed by Anas Nashif
commit 997a49ade9
3 changed files with 11 additions and 11 deletions

View file

@ -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 */