From fe76141671c3025cd0da7cfafb6d8945bbe0735b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 23 Dec 2012 02:13:57 -0500 Subject: frv: switch to generic sigaltstack Signed-off-by: Al Viro --- arch/frv/Kconfig | 1 + arch/frv/kernel/signal.c | 13 ++----------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'arch/frv') diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 9d262645f66..8aaf1a17427 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -12,6 +12,7 @@ config FRV select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_CPU_DEVICES select ARCH_WANT_IPC_PARSE_VERSION + select GENERIC_SIGALTSTACK config ZONE_DMA bool diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 535810a3217..445156d2d30 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c @@ -74,13 +74,6 @@ asmlinkage int sys_sigaction(int sig, return ret; } -asmlinkage -int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) -{ - return do_sigaltstack(uss, uoss, __frame->sp); -} - - /* * Do a signal return; undo the signal stack. */ @@ -173,7 +166,7 @@ asmlinkage int sys_rt_sigreturn(void) if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) goto badframe; - if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT) + if (restore_altstack(&frame->uc.uc_stack)) goto badframe; return gr8; @@ -345,9 +338,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, /* Create the ucontext. */ if (__put_user(0, &frame->uc.uc_flags) || __put_user(NULL, &frame->uc.uc_link) || - __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || - __put_user(sas_ss_flags(__frame->sp), &frame->uc.uc_stack.ss_flags) || - __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size)) + __save_altstack(&frame->uc.uc_stack, __frame->sp)) goto give_sigsegv; if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0])) -- cgit v1.2.3 From 39e08a9bae71a16ab0549b87b4e7207ae0d550ad Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 25 Dec 2012 16:27:55 -0500 Subject: frv: switch to generic old sigsuspend Signed-off-by: Al Viro --- arch/frv/Kconfig | 1 + arch/frv/kernel/signal.c | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'arch/frv') diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 8aaf1a17427..683ab5c9023 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -13,6 +13,7 @@ config FRV select GENERIC_CPU_DEVICES select ARCH_WANT_IPC_PARSE_VERSION select GENERIC_SIGALTSTACK + select OLD_SIGSUSPEND3 config ZONE_DMA bool diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 445156d2d30..771756b7a7e 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c @@ -32,16 +32,6 @@ struct fdpic_func_descriptor { unsigned long GOT; }; -/* - * Atomically swap in the new signal mask, and wait for a signal. - */ -asmlinkage int sys_sigsuspend(int history0, int history1, old_sigset_t mask) -{ - sigset_t blocked; - siginitset(&blocked, mask); - return sigsuspend(&blocked); -} - asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, struct old_sigaction __user *oact) -- cgit v1.2.3 From 177b6703f62f991ca250768e23398b21f7700f91 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 25 Dec 2012 19:30:17 -0500 Subject: frv: switch to generic old sigaction() Signed-off-by: Al Viro --- arch/frv/Kconfig | 1 + arch/frv/include/asm/signal.h | 7 ------- arch/frv/kernel/signal.c | 32 -------------------------------- 3 files changed, 1 insertion(+), 39 deletions(-) (limited to 'arch/frv') diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 683ab5c9023..e3f8ffdd4e7 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -14,6 +14,7 @@ config FRV select ARCH_WANT_IPC_PARSE_VERSION select GENERIC_SIGALTSTACK select OLD_SIGSUSPEND3 + select OLD_SIGACTION config ZONE_DMA bool diff --git a/arch/frv/include/asm/signal.h b/arch/frv/include/asm/signal.h index 599500a3102..eca0abcb79d 100644 --- a/arch/frv/include/asm/signal.h +++ b/arch/frv/include/asm/signal.h @@ -3,11 +3,4 @@ #include -struct old_sigaction { - __sighandler_t sa_handler; - old_sigset_t sa_mask; - unsigned long sa_flags; - __sigrestore_t sa_restorer; -}; - #endif /* _ASM_SIGNAL_H */ diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 771756b7a7e..d822700d4f1 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c @@ -32,38 +32,6 @@ struct fdpic_func_descriptor { unsigned long GOT; }; -asmlinkage int sys_sigaction(int sig, - const struct old_sigaction __user *act, - struct old_sigaction __user *oact) -{ - struct k_sigaction new_ka, old_ka; - int ret; - - if (act) { - old_sigset_t mask; - if (!access_ok(VERIFY_READ, act, sizeof(*act)) || - __get_user(new_ka.sa.sa_handler, &act->sa_handler) || - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || - __get_user(new_ka.sa.sa_flags, &act->sa_flags) || - __get_user(mask, &act->sa_mask)) - return -EFAULT; - siginitset(&new_ka.sa.sa_mask, mask); - } - - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); - - if (!ret && oact) { - if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || - __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) - return -EFAULT; - } - - return ret; -} - /* * Do a signal return; undo the signal stack. */ -- cgit v1.2.3 From d64008a8f30e0b381b292788ec6f3ee509b3bb40 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 25 Nov 2012 23:12:10 -0500 Subject: burying unused conditionals __ARCH_WANT_SYS_RT_SIGACTION, __ARCH_WANT_SYS_RT_SIGSUSPEND, __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND, __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL - not used anymore CONFIG_GENERIC_{SIGALTSTACK,COMPAT_RT_SIG{ACTION,QUEUEINFO,PENDING,PROCMASK}} - can be assumed always set. --- arch/frv/Kconfig | 1 - arch/frv/include/asm/unistd.h | 2 -- 2 files changed, 3 deletions(-) (limited to 'arch/frv') diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index e3f8ffdd4e7..b7465cd3dbb 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -12,7 +12,6 @@ config FRV select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_CPU_DEVICES select ARCH_WANT_IPC_PARSE_VERSION - select GENERIC_SIGALTSTACK select OLD_SIGSUSPEND3 select OLD_SIGACTION diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h index d685da17f5f..4cfcc7bba25 100644 --- a/arch/frv/include/asm/unistd.h +++ b/arch/frv/include/asm/unistd.h @@ -27,8 +27,6 @@ #define __ARCH_WANT_SYS_OLDUMOUNT /* #define __ARCH_WANT_SYS_SIGPENDING */ #define __ARCH_WANT_SYS_SIGPROCMASK -#define __ARCH_WANT_SYS_RT_SIGACTION -#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_CLONE -- cgit v1.2.3