diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-23 03:54:43 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 18:16:27 -0500 |
commit | 0430f2f2764f9db5ee5200c3d24d1eac8a797e28 (patch) | |
tree | dc6add1a6517a1fa50b71d7d142ebc65ddafde38 /arch | |
parent | 0aa0203fb43f04714004b2c4ad33b858e240555d (diff) |
xtensa: switch to generic sigaltstack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/xtensa/Kconfig | 1 | ||||
-rw-r--r-- | arch/xtensa/include/asm/syscall.h | 1 | ||||
-rw-r--r-- | arch/xtensa/include/uapi/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/signal.c | 18 |
4 files changed, 4 insertions, 18 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 5aab1acabf1c..23cc6ae35da0 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -16,6 +16,7 @@ config XTENSA | |||
16 | select ARCH_WANT_OPTIONAL_GPIOLIB | 16 | select ARCH_WANT_OPTIONAL_GPIOLIB |
17 | select CLONE_BACKWARDS | 17 | select CLONE_BACKWARDS |
18 | select IRQ_DOMAIN | 18 | select IRQ_DOMAIN |
19 | select GENERIC_SIGALTSTACK | ||
19 | help | 20 | help |
20 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 21 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
21 | primarily for embedded systems. These processors are both | 22 | primarily for embedded systems. These processors are both |
diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h index 08a23ddac295..3673ff1f1bc5 100644 --- a/arch/xtensa/include/asm/syscall.h +++ b/arch/xtensa/include/asm/syscall.h | |||
@@ -12,7 +12,6 @@ struct pt_regs; | |||
12 | asmlinkage long xtensa_ptrace(long, long, long, long); | 12 | asmlinkage long xtensa_ptrace(long, long, long, long); |
13 | asmlinkage long xtensa_sigreturn(struct pt_regs*); | 13 | asmlinkage long xtensa_sigreturn(struct pt_regs*); |
14 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); | 14 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); |
15 | asmlinkage long xtensa_sigaltstack(struct pt_regs *regs); | ||
16 | asmlinkage long xtensa_shmat(int, char __user *, int); | 15 | asmlinkage long xtensa_shmat(int, char __user *, int); |
17 | asmlinkage long xtensa_fadvise64_64(int, int, | 16 | asmlinkage long xtensa_fadvise64_64(int, int, |
18 | unsigned long long, unsigned long long); | 17 | unsigned long long, unsigned long long); |
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index 5162418c5d90..19fac3f543a2 100644 --- a/arch/xtensa/include/uapi/asm/unistd.h +++ b/arch/xtensa/include/uapi/asm/unistd.h | |||
@@ -483,7 +483,7 @@ __SYSCALL(222, sys_ni_syscall, 0) | |||
483 | #define __NR_restart_syscall 223 | 483 | #define __NR_restart_syscall 223 |
484 | __SYSCALL(223, sys_restart_syscall, 0) | 484 | __SYSCALL(223, sys_restart_syscall, 0) |
485 | #define __NR_sigaltstack 224 | 485 | #define __NR_sigaltstack 224 |
486 | __SYSCALL(224, xtensa_sigaltstack, 2) | 486 | __SYSCALL(224, sys_sigaltstack, 2) |
487 | #define __NR_rt_sigreturn 225 | 487 | #define __NR_rt_sigreturn 225 |
488 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | 488 | __SYSCALL(225, xtensa_rt_sigreturn, 1) |
489 | #define __NR_rt_sigaction 226 | 489 | #define __NR_rt_sigaction 226 |
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index de34d6be91cd..d7590dddd084 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c | |||
@@ -265,7 +265,7 @@ asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3, | |||
265 | 265 | ||
266 | ret = regs->areg[2]; | 266 | ret = regs->areg[2]; |
267 | 267 | ||
268 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->areg[1]) == -EFAULT) | 268 | if (restore_altstack(&frame->uc.uc_stack)) |
269 | goto badframe; | 269 | goto badframe; |
270 | 270 | ||
271 | return ret; | 271 | return ret; |
@@ -368,11 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
368 | 368 | ||
369 | err |= __put_user(0, &frame->uc.uc_flags); | 369 | err |= __put_user(0, &frame->uc.uc_flags); |
370 | err |= __put_user(0, &frame->uc.uc_link); | 370 | err |= __put_user(0, &frame->uc.uc_link); |
371 | err |= __put_user((void *)current->sas_ss_sp, | 371 | err |= __save_altstack(&frame->uc.uc_stack, regs->areg[1]); |
372 | &frame->uc.uc_stack.ss_sp); | ||
373 | err |= __put_user(sas_ss_flags(regs->areg[1]), | ||
374 | &frame->uc.uc_stack.ss_flags); | ||
375 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
376 | err |= setup_sigcontext(frame, regs); | 372 | err |= setup_sigcontext(frame, regs); |
377 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 373 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
378 | 374 | ||
@@ -424,16 +420,6 @@ give_sigsegv: | |||
424 | return -EFAULT; | 420 | return -EFAULT; |
425 | } | 421 | } |
426 | 422 | ||
427 | asmlinkage long xtensa_sigaltstack(const stack_t __user *uss, | ||
428 | stack_t __user *uoss, | ||
429 | long a2, long a3, long a4, long a5, | ||
430 | struct pt_regs *regs) | ||
431 | { | ||
432 | return do_sigaltstack(uss, uoss, regs->areg[1]); | ||
433 | } | ||
434 | |||
435 | |||
436 | |||
437 | /* | 423 | /* |
438 | * Note that 'init' is a special process: it doesn't get signals it doesn't | 424 | * Note that 'init' is a special process: it doesn't get signals it doesn't |
439 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 425 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |