diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/Kconfig | 1 | ||||
-rw-r--r-- | arch/sh/include/asm/syscalls_32.h | 3 | ||||
-rw-r--r-- | arch/sh/kernel/signal_32.c | 20 | ||||
-rw-r--r-- | arch/sh/kernel/signal_64.c | 19 |
4 files changed, 5 insertions, 38 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index babc2b826c5c..fb4a212c1bc4 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -40,6 +40,7 @@ config SUPERH | |||
40 | select GENERIC_STRNLEN_USER | 40 | select GENERIC_STRNLEN_USER |
41 | select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER | 41 | select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER |
42 | select MODULES_USE_ELF_RELA | 42 | select MODULES_USE_ELF_RELA |
43 | select GENERIC_SIGALTSTACK | ||
43 | help | 44 | help |
44 | The SuperH is a RISC processor targeted for use in embedded systems | 45 | The SuperH is a RISC processor targeted for use in embedded systems |
45 | and consumer electronics; it was also used in the Sega Dreamcast | 46 | and consumer electronics; it was also used in the Sega Dreamcast |
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h index cc25485996bb..77e2054d678e 100644 --- a/arch/sh/include/asm/syscalls_32.h +++ b/arch/sh/include/asm/syscalls_32.h | |||
@@ -12,9 +12,6 @@ struct pt_regs; | |||
12 | asmlinkage int sys_sigsuspend(old_sigset_t mask); | 12 | asmlinkage int sys_sigsuspend(old_sigset_t mask); |
13 | asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, | 13 | asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, |
14 | struct old_sigaction __user *oact); | 14 | struct old_sigaction __user *oact); |
15 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
16 | unsigned long r6, unsigned long r7, | ||
17 | struct pt_regs __regs); | ||
18 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | 15 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, |
19 | unsigned long r6, unsigned long r7, | 16 | unsigned long r6, unsigned long r7, |
20 | struct pt_regs __regs); | 17 | struct pt_regs __regs); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 2f1f65356c0c..e540d07dd5c5 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -89,17 +89,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
89 | return ret; | 89 | return ret; |
90 | } | 90 | } |
91 | 91 | ||
92 | asmlinkage int | ||
93 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
94 | unsigned long r6, unsigned long r7, | ||
95 | struct pt_regs __regs) | ||
96 | { | ||
97 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
98 | |||
99 | return do_sigaltstack(uss, uoss, regs->regs[15]); | ||
100 | } | ||
101 | |||
102 | |||
103 | /* | 92 | /* |
104 | * Do a signal return; undo the signal stack. | 93 | * Do a signal return; undo the signal stack. |
105 | */ | 94 | */ |
@@ -257,8 +246,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
257 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 246 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
258 | goto badframe; | 247 | goto badframe; |
259 | 248 | ||
260 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, | 249 | if (restore_altstack(&frame->uc.uc_stack)) |
261 | regs->regs[15]) == -EFAULT) | ||
262 | goto badframe; | 250 | goto badframe; |
263 | 251 | ||
264 | return r0; | 252 | return r0; |
@@ -423,11 +411,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
423 | /* Create the ucontext. */ | 411 | /* Create the ucontext. */ |
424 | err |= __put_user(0, &frame->uc.uc_flags); | 412 | err |= __put_user(0, &frame->uc.uc_flags); |
425 | err |= __put_user(NULL, &frame->uc.uc_link); | 413 | err |= __put_user(NULL, &frame->uc.uc_link); |
426 | err |= __put_user((void *)current->sas_ss_sp, | 414 | err |= __save_altstack(&frame->uc.uc_stack, regs->regs[15]); |
427 | &frame->uc.uc_stack.ss_sp); | ||
428 | err |= __put_user(sas_ss_flags(regs->regs[15]), | ||
429 | &frame->uc.uc_stack.ss_flags); | ||
430 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
431 | err |= setup_sigcontext(&frame->uc.uc_mcontext, | 415 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
432 | regs, set->sig[0]); | 416 | regs, set->sig[0]); |
433 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 417 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index d867cd95a622..0fba66e2b202 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -170,15 +170,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
170 | return ret; | 170 | return ret; |
171 | } | 171 | } |
172 | 172 | ||
173 | asmlinkage int | ||
174 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
175 | unsigned long r4, unsigned long r5, unsigned long r6, | ||
176 | unsigned long r7, | ||
177 | struct pt_regs * regs) | ||
178 | { | ||
179 | return do_sigaltstack(uss, uoss, REF_REG_SP); | ||
180 | } | ||
181 | |||
182 | /* | 173 | /* |
183 | * Do a signal return; undo the signal stack. | 174 | * Do a signal return; undo the signal stack. |
184 | */ | 175 | */ |
@@ -364,9 +355,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, | |||
364 | goto badframe; | 355 | goto badframe; |
365 | regs->pc -= 4; | 356 | regs->pc -= 4; |
366 | 357 | ||
367 | /* It is more difficult to avoid calling this function than to | 358 | if (restore_altstack(&frame->uc.uc_stack)) |
368 | call it and ignore errors. */ | ||
369 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, REF_REG_SP) == -EFAULT) | ||
370 | goto badframe; | 359 | goto badframe; |
371 | 360 | ||
372 | return (int) ret; | 361 | return (int) ret; |
@@ -560,11 +549,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
560 | /* Create the ucontext. */ | 549 | /* Create the ucontext. */ |
561 | err |= __put_user(0, &frame->uc.uc_flags); | 550 | err |= __put_user(0, &frame->uc.uc_flags); |
562 | err |= __put_user(0, &frame->uc.uc_link); | 551 | err |= __put_user(0, &frame->uc.uc_link); |
563 | err |= __put_user((void *)current->sas_ss_sp, | 552 | err |= __save_altstack(&frame->uc.uc_stack, regs->regs[REG_SP]); |
564 | &frame->uc.uc_stack.ss_sp); | ||
565 | err |= __put_user(sas_ss_flags(regs->regs[REG_SP]), | ||
566 | &frame->uc.uc_stack.ss_flags); | ||
567 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
568 | err |= setup_sigcontext(&frame->uc.uc_mcontext, | 553 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
569 | regs, set->sig[0]); | 554 | regs, set->sig[0]); |
570 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 555 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |