aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-12-23 03:17:06 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-03 18:16:03 -0500
commitb30c7d50af95f7450f877e8172a2341785bce5ab (patch)
treeff62572b1238e723a61161fb747961c751ea1aa0
parent0aa0203fb43f04714004b2c4ad33b858e240555d (diff)
mn10300: switch to generic sigaltstack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/mn10300/Kconfig1
-rw-r--r--arch/mn10300/kernel/signal.c15
2 files changed, 3 insertions, 13 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index e70001cfa05b..cb5022029606 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -10,6 +10,7 @@ config MN10300
10 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 10 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
11 select GENERIC_CLOCKEVENTS 11 select GENERIC_CLOCKEVENTS
12 select MODULES_USE_ELF_RELA 12 select MODULES_USE_ELF_RELA
13 select GENERIC_SIGALTSTACK
13 14
14config AM33_2 15config AM33_2
15 def_bool n 16 def_bool n
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index f570b3085ef9..8223eb371e65 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -77,14 +77,6 @@ asmlinkage long sys_sigaction(int sig,
77} 77}
78 78
79/* 79/*
80 * set alternate signal stack syscall
81 */
82asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss)
83{
84 return do_sigaltstack(uss, uoss, current_frame()->sp);
85}
86
87/*
88 * do a signal return; undo the signal stack. 80 * do a signal return; undo the signal stack.
89 */ 81 */
90static int restore_sigcontext(struct pt_regs *regs, 82static int restore_sigcontext(struct pt_regs *regs,
@@ -193,8 +185,7 @@ asmlinkage long sys_rt_sigreturn(void)
193 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) 185 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0))
194 goto badframe; 186 goto badframe;
195 187
196 if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) == 188 if (restore_altstack(&frame->uc.uc_stack))
197 -EFAULT)
198 goto badframe; 189 goto badframe;
199 190
200 return d0; 191 return d0;
@@ -359,9 +350,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
359 /* create the ucontext. */ 350 /* create the ucontext. */
360 if (__put_user(0, &frame->uc.uc_flags) || 351 if (__put_user(0, &frame->uc.uc_flags) ||
361 __put_user(0, &frame->uc.uc_link) || 352 __put_user(0, &frame->uc.uc_link) ||
362 __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || 353 __save_altstack(&frame->uc.uc_stack, regs->sp) ||
363 __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags) ||
364 __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size) ||
365 setup_sigcontext(&frame->uc.uc_mcontext, 354 setup_sigcontext(&frame->uc.uc_mcontext,
366 &frame->fpuctx, regs, set->sig[0]) || 355 &frame->fpuctx, regs, set->sig[0]) ||
367 __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) 356 __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)))