aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m32r/kernel/signal.c')
-rw-r--r--arch/m32r/kernel/signal.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 64804f1f5141..f3fb2c029cfc 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -28,8 +28,6 @@
28 28
29#define DEBUG_SIG 0 29#define DEBUG_SIG 0
30 30
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32
33asmlinkage int 31asmlinkage int
34sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 32sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
35 unsigned long r2, unsigned long r3, unsigned long r4, 33 unsigned long r2, unsigned long r3, unsigned long r4,
@@ -111,7 +109,6 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
111 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 109 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
112 goto badframe; 110 goto badframe;
113 111
114 sigdelsetmask(&set, ~_BLOCKABLE);
115 set_current_blocked(&set); 112 set_current_blocked(&set);
116 113
117 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) 114 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
@@ -267,9 +264,9 @@ static int prev_insn(struct pt_regs *regs)
267 * OK, we're invoking a handler 264 * OK, we're invoking a handler
268 */ 265 */
269 266
270static int 267static void
271handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 268handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
272 sigset_t *oldset, struct pt_regs *regs) 269 struct pt_regs *regs)
273{ 270{
274 /* Are we from a system call? */ 271 /* Are we from a system call? */
275 if (regs->syscall_nr >= 0) { 272 if (regs->syscall_nr >= 0) {
@@ -294,11 +291,10 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
294 } 291 }
295 292
296 /* Set up the stack frame */ 293 /* Set up the stack frame */
297 if (setup_rt_frame(sig, ka, info, oldset, regs)) 294 if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs))
298 return -EFAULT; 295 return;
299 296
300 block_sigmask(ka, sig); 297 signal_delivered(sig, info, ka, regs, 0);
301 return 0;
302} 298}
303 299
304/* 300/*
@@ -311,7 +307,6 @@ static void do_signal(struct pt_regs *regs)
311 siginfo_t info; 307 siginfo_t info;
312 int signr; 308 int signr;
313 struct k_sigaction ka; 309 struct k_sigaction ka;
314 sigset_t *oldset;
315 310
316 /* 311 /*
317 * We want the common case to go fast, which 312 * We want the common case to go fast, which
@@ -322,14 +317,6 @@ static void do_signal(struct pt_regs *regs)
322 if (!user_mode(regs)) 317 if (!user_mode(regs))
323 return; 318 return;
324 319
325 if (try_to_freeze())
326 goto no_signal;
327
328 if (test_thread_flag(TIF_RESTORE_SIGMASK))
329 oldset = &current->saved_sigmask;
330 else
331 oldset = &current->blocked;
332
333 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 320 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
334 if (signr > 0) { 321 if (signr > 0) {
335 /* Re-enable any watchpoints before delivering the 322 /* Re-enable any watchpoints before delivering the
@@ -339,13 +326,11 @@ static void do_signal(struct pt_regs *regs)
339 */ 326 */
340 327
341 /* Whee! Actually deliver the signal. */ 328 /* Whee! Actually deliver the signal. */
342 if (handle_signal(signr, &ka, &info, oldset, regs) == 0) 329 handle_signal(signr, &ka, &info, regs);
343 clear_thread_flag(TIF_RESTORE_SIGMASK);
344 330
345 return; 331 return;
346 } 332 }
347 333
348 no_signal:
349 /* Did we come from a system call? */ 334 /* Did we come from a system call? */
350 if (regs->syscall_nr >= 0) { 335 if (regs->syscall_nr >= 0) {
351 /* Restart the system call - no handlers present */ 336 /* Restart the system call - no handlers present */
@@ -360,10 +345,7 @@ static void do_signal(struct pt_regs *regs)
360 prev_insn(regs); 345 prev_insn(regs);
361 } 346 }
362 } 347 }
363 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 348 restore_saved_sigmask();
364 clear_thread_flag(TIF_RESTORE_SIGMASK);
365 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
366 }
367} 349}
368 350
369/* 351/*