Skip to content

Commit 9d9043f

Browse files
committed
xtensa: clean up system_call/xtensa_rt_sigreturn interaction
system_call assembly code always pushes pointer to struct pt_regs as the last additional parameter for all system calls. The only user of this feature is xtensa_rt_sigreturn. Avoid this special case. Define xtensa_rt_sigreturn as accepting no argiments. Use current_pt_regs to get pointer to struct pt_regs in xtensa_rt_sigreturn. Don't pass additional parameter from system_call code. Signed-off-by: Max Filippov <[email protected]>
1 parent 02ce94c commit 9d9043f

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

arch/xtensa/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
7979
regs->areg[reg[i]] = args[i];
8080
}
8181

82-
asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
82+
asmlinkage long xtensa_rt_sigreturn(void);
8383
asmlinkage long xtensa_shmat(int, char __user *, int);
8484
asmlinkage long xtensa_fadvise64_64(int, int,
8585
unsigned long long, unsigned long long);

arch/xtensa/kernel/entry.S

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,8 +1876,7 @@ ENDPROC(fast_store_prohibited)
18761876

18771877
ENTRY(system_call)
18781878

1879-
/* reserve 4 bytes on stack for function parameter */
1880-
abi_entry(4)
1879+
abi_entry_default
18811880

18821881
/* regs->syscall = regs->areg[2] */
18831882

@@ -1915,22 +1914,19 @@ ENTRY(system_call)
19151914
l32i a10, a2, PT_AREG8
19161915
l32i a11, a2, PT_AREG9
19171916

1918-
/* Pass one additional argument to the syscall: pt_regs (on stack) */
1919-
s32i a2, a1, 0
1920-
19211917
callx4 a4
19221918

19231919
1: /* regs->areg[2] = return_value */
19241920

19251921
s32i a6, a2, PT_AREG2
19261922
bnez a3, 1f
19271923
.Lsyscall_exit:
1928-
abi_ret(4)
1924+
abi_ret_default
19291925

19301926
1:
19311927
mov a6, a2
19321928
call4 do_syscall_trace_leave
1933-
abi_ret(4)
1929+
abi_ret_default
19341930

19351931
ENDPROC(system_call)
19361932

arch/xtensa/kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ restore_sigcontext(struct pt_regs *regs, struct rt_sigframe __user *frame)
236236
* Do a signal return; undo the signal stack.
237237
*/
238238

239-
asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3,
240-
long a4, long a5, struct pt_regs *regs)
239+
asmlinkage long xtensa_rt_sigreturn(void)
241240
{
241+
struct pt_regs *regs = current_pt_regs();
242242
struct rt_sigframe __user *frame;
243243
sigset_t set;
244244
int ret;

0 commit comments

Comments
 (0)