Browse Source

xtensa: userspace: use ADDX4 to calculate syscall table index

When looking for jump address in the syscall table, we need to
multiply the syscall ID by 4 before adding the address offset
of the beginning of the table. This is due to the jump address
being 32-bit (4 bytes). Instead of using two instructions to
shift the ID by 4 first and then the addition, we can use one
ADDX4 instruction to achieve the same result.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
pull/88739/head
Daniel Leung 3 months ago committed by Benjamin Cabé
parent
commit
9cadc8cbec
  1. 3
      arch/xtensa/core/userspace.S

3
arch/xtensa/core/userspace.S

@ -119,8 +119,7 @@ _not_checking_user_context:
_id_ok: _id_ok:
/* Find the function handler for the given syscall id. */ /* Find the function handler for the given syscall id. */
movi a3, _k_syscall_table movi a3, _k_syscall_table
slli a2, a2, 2 addx4 a2, a2, a3
add a2, a2, a3
l32i a2, a2, 0 l32i a2, a2, 0
#if XCHAL_HAVE_THREADPTR #if XCHAL_HAVE_THREADPTR

Loading…
Cancel
Save