xtensa: userspace: simplify syscall trampoline a bit

There is no need to do a call4 and jx. Simply do a callx4
is enough.

Also amended the now incorrect comment about how syscall
trampoline is set up. It is now a straight call4 instead of
the old 2x call4.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2024-01-29 15:04:45 -08:00 committed by Anas Nashif
commit 857abb8276

View file

@ -122,9 +122,14 @@ _id_ok:
wur.THREADPTR a0 wur.THREADPTR a0
#endif #endif
/* Set syscall parameters. We have an initial call4 to set up the /* Set syscall parameters by moving them into place before we do
* the stack and then a new call4 for the syscall function itself. * a call4 for the syscall function itself.
* So parameters should be put as if it was a call8. * arg1 = a6
* arg2 = a3 (clobbered above, so we need to reload it)
* arg3 = a4
* arg4 = a5
* arg5 = a8
* arg6 = a9
*/ */
mov a10, a8 mov a10, a8
mov a11, a9 mov a11, a9
@ -141,7 +146,7 @@ _id_ok:
wsr.ps a0 wsr.ps a0
rsync rsync
call4 _syscall_call0 callx4 a2
/* copy return value. Lets put it in the top of stack /* copy return value. Lets put it in the top of stack
* because registers will be clobbered in * because registers will be clobbered in
@ -152,12 +157,6 @@ _id_ok:
j _syscall_returned j _syscall_returned
.align 4
_syscall_call0:
/* We want an ENTRY to set a bit in windowstart */
jx a2
_syscall_returned: _syscall_returned:
call0 xtensa_restore_high_regs call0 xtensa_restore_high_regs