arch: arm: userspace: correct inline comment for bad syscalls

We need to correct the inline comment in swap_helper.S,
which is suggesting that system call attempts with
invalid syscall IDs (i.e. above the limit) do not force
the CPU to elevate privileges. This is in fact not true,
since the execution flow moves into valid syscall ID
handling.

In other words, all we do for system calls with invalid
ID numbers is to treat them as valid syscalls with the
K_SYSCALL_BAD ID value.

We fix the inline documentation to reflect the actual
execution flow.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-06-27 13:51:06 +02:00 committed by Anas Nashif
parent 5d423b8078
commit f3a1270f85

View file

@ -451,7 +451,7 @@ _do_syscall:
ldr r1, =z_arm_do_syscall
str r1, [r0, #24] /* overwrite the PC to point to z_arm_do_syscall */
/* validate syscall limit, only set priv mode if valid */
/* validate syscall limit */
ldr ip, =K_SYSCALL_LIMIT
cmp r6, ip
blt valid_syscall_id
@ -460,6 +460,8 @@ _do_syscall:
str r6, [r0, #0]
ldr r6, =K_SYSCALL_BAD
/* Bad syscalls treated as valid syscalls with ID K_SYSCALL_BAD. */
valid_syscall_id:
push {r0, r1}
ldr r0, =_kernel