diff options
Diffstat (limited to 'arch/sh/kernel/signal_64.c')
-rw-r--r-- | arch/sh/kernel/signal_64.c | 62 |
1 files changed, 2 insertions, 60 deletions
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index d867cd95a622..23d4c71c91af 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -128,58 +128,6 @@ static void do_signal(struct pt_regs *regs) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | /* | 130 | /* |
131 | * Atomically swap in the new signal mask, and wait for a signal. | ||
132 | */ | ||
133 | asmlinkage int | ||
134 | sys_sigsuspend(old_sigset_t mask) | ||
135 | { | ||
136 | sigset_t blocked; | ||
137 | siginitset(&blocked, mask); | ||
138 | return sigsuspend(&blocked); | ||
139 | } | ||
140 | |||
141 | asmlinkage int | ||
142 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
143 | struct old_sigaction __user *oact) | ||
144 | { | ||
145 | struct k_sigaction new_ka, old_ka; | ||
146 | int ret; | ||
147 | |||
148 | if (act) { | ||
149 | old_sigset_t mask; | ||
150 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
151 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
152 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
153 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
154 | __get_user(mask, &act->sa_mask)) | ||
155 | return -EFAULT; | ||
156 | siginitset(&new_ka.sa.sa_mask, mask); | ||
157 | } | ||
158 | |||
159 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
160 | |||
161 | if (!ret && oact) { | ||
162 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
163 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
164 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
165 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
166 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
167 | return -EFAULT; | ||
168 | } | ||
169 | |||
170 | return ret; | ||
171 | } | ||
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 | /* | ||
183 | * Do a signal return; undo the signal stack. | 131 | * Do a signal return; undo the signal stack. |
184 | */ | 132 | */ |
185 | struct sigframe { | 133 | struct sigframe { |
@@ -364,9 +312,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, | |||
364 | goto badframe; | 312 | goto badframe; |
365 | regs->pc -= 4; | 313 | regs->pc -= 4; |
366 | 314 | ||
367 | /* It is more difficult to avoid calling this function than to | 315 | 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; | 316 | goto badframe; |
371 | 317 | ||
372 | return (int) ret; | 318 | return (int) ret; |
@@ -560,11 +506,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
560 | /* Create the ucontext. */ | 506 | /* Create the ucontext. */ |
561 | err |= __put_user(0, &frame->uc.uc_flags); | 507 | err |= __put_user(0, &frame->uc.uc_flags); |
562 | err |= __put_user(0, &frame->uc.uc_link); | 508 | err |= __put_user(0, &frame->uc.uc_link); |
563 | err |= __put_user((void *)current->sas_ss_sp, | 509 | 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, | 510 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
569 | regs, set->sig[0]); | 511 | regs, set->sig[0]); |
570 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 512 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |