arch: arm: swap-helper: simplify several assembly expressions
Some assembly simplifications, to make code common for ARMv6 and ARMv7 architecture. We can use ldrb, directly for reading the SVC encoding; this removes the need for ANDing the result with 0xff right below. We remove an immediate value of 0 from an str instruction, as it's redundant. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
9ea2df1788
commit
a6accb3e75
1 changed files with 2 additions and 3 deletions
|
@ -429,7 +429,7 @@ SECTION_FUNC(TEXT, z_arm_svc)
|
||||||
/* SVC is a two-byte instruction, point to it and read the
|
/* SVC is a two-byte instruction, point to it and read the
|
||||||
* SVC number (lower byte of SCV instruction)
|
* SVC number (lower byte of SCV instruction)
|
||||||
*/
|
*/
|
||||||
ldrh r1, [r1, #-2]
|
ldrb r1, [r1, #-2]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* grab service call number:
|
* grab service call number:
|
||||||
|
@ -438,7 +438,6 @@ SECTION_FUNC(TEXT, z_arm_svc)
|
||||||
* 2: kernel panic or oops (software generated fatal exception)
|
* 2: kernel panic or oops (software generated fatal exception)
|
||||||
* 3: System call (if user mode supported)
|
* 3: System call (if user mode supported)
|
||||||
*/
|
*/
|
||||||
ands r1, #0xff
|
|
||||||
#if defined(CONFIG_USERSPACE)
|
#if defined(CONFIG_USERSPACE)
|
||||||
mrs r2, CONTROL
|
mrs r2, CONTROL
|
||||||
|
|
||||||
|
@ -504,7 +503,7 @@ _do_syscall:
|
||||||
blt valid_syscall_id
|
blt valid_syscall_id
|
||||||
|
|
||||||
/* bad syscall id. Set arg1 to bad id and set call_id to SYSCALL_BAD */
|
/* bad syscall id. Set arg1 to bad id and set call_id to SYSCALL_BAD */
|
||||||
str r6, [r0, #0]
|
str r6, [r0]
|
||||||
ldr r6, =K_SYSCALL_BAD
|
ldr r6, =K_SYSCALL_BAD
|
||||||
|
|
||||||
/* Bad syscalls treated as valid syscalls with ID K_SYSCALL_BAD. */
|
/* Bad syscalls treated as valid syscalls with ID K_SYSCALL_BAD. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue