aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/h8300/kernel/signal.c')
-rw-r--r--arch/h8300/kernel/signal.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index e58992ad789e..fca10378701b 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -47,8 +47,6 @@
47#include <asm/traps.h> 47#include <asm/traps.h>
48#include <asm/ucontext.h> 48#include <asm/ucontext.h>
49 49
50#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
51
52/* 50/*
53 * Atomically swap in the new signal mask, and wait for a signal. 51 * Atomically swap in the new signal mask, and wait for a signal.
54 */ 52 */
@@ -186,7 +184,6 @@ asmlinkage int do_sigreturn(unsigned long __unused,...)
186 sizeof(frame->extramask)))) 184 sizeof(frame->extramask))))
187 goto badframe; 185 goto badframe;
188 186
189 sigdelsetmask(&set, ~_BLOCKABLE);
190 set_current_blocked(&set); 187 set_current_blocked(&set);
191 188
192 if (restore_sigcontext(regs, &frame->sc, &er0)) 189 if (restore_sigcontext(regs, &frame->sc, &er0))
@@ -211,7 +208,6 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused,...)
211 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 208 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
212 goto badframe; 209 goto badframe;
213 210
214 sigdelsetmask(&set, ~_BLOCKABLE);
215 set_current_blocked(&set); 211 set_current_blocked(&set);
216 212
217 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0)) 213 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0))
@@ -412,8 +408,9 @@ give_sigsegv:
412 */ 408 */
413static void 409static void
414handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 410handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
415 sigset_t *oldset, struct pt_regs * regs) 411 struct pt_regs * regs)
416{ 412{
413 sigset_t *oldset = sigmask_to_save();
417 int ret; 414 int ret;
418 /* are we from a system call? */ 415 /* are we from a system call? */
419 if (regs->orig_er0 >= 0) { 416 if (regs->orig_er0 >= 0) {
@@ -441,10 +438,8 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
441 else 438 else
442 ret = setup_frame(sig, ka, oldset, regs); 439 ret = setup_frame(sig, ka, oldset, regs);
443 440
444 if (!ret) { 441 if (!ret)
445 block_sigmask(ka, sig); 442 signal_delivered(sig, info, ka, regs, 0);
446 clear_thread_flag(TIF_RESTORE_SIGMASK);
447 }
448} 443}
449 444
450/* 445/*
@@ -457,7 +452,6 @@ statis void do_signal(struct pt_regs *regs)
457 siginfo_t info; 452 siginfo_t info;
458 int signr; 453 int signr;
459 struct k_sigaction ka; 454 struct k_sigaction ka;
460 sigset_t *oldset;
461 455
462 /* 456 /*
463 * We want the common case to go fast, which 457 * We want the common case to go fast, which
@@ -468,23 +462,14 @@ statis void do_signal(struct pt_regs *regs)
468 if ((regs->ccr & 0x10)) 462 if ((regs->ccr & 0x10))
469 return; 463 return;
470 464
471 if (try_to_freeze())
472 goto no_signal;
473
474 current->thread.esp0 = (unsigned long) regs; 465 current->thread.esp0 = (unsigned long) regs;
475 466
476 if (test_thread_flag(TIF_RESTORE_SIGMASK))
477 oldset = &current->saved_sigmask;
478 else
479 oldset = &current->blocked;
480
481 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 467 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
482 if (signr > 0) { 468 if (signr > 0) {
483 /* Whee! Actually deliver the signal. */ 469 /* Whee! Actually deliver the signal. */
484 handle_signal(signr, &info, &ka, oldset, regs); 470 handle_signal(signr, &info, &ka, regs);
485 return; 471 return;
486 } 472 }
487 no_signal:
488 /* Did we come from a system call? */ 473 /* Did we come from a system call? */
489 if (regs->orig_er0 >= 0) { 474 if (regs->orig_er0 >= 0) {
490 /* Restart the system call - no handlers present */ 475 /* Restart the system call - no handlers present */
@@ -501,8 +486,7 @@ statis void do_signal(struct pt_regs *regs)
501 } 486 }
502 487
503 /* If there's no signal to deliver, we just restore the saved mask. */ 488 /* If there's no signal to deliver, we just restore the saved mask. */
504 if (test_and_clear_thread_flag(TIF_RESTORE_SIGMASK)) 489 restore_saved_sigmask();
505 set_current_blocked(&current->saved_sigmask);
506} 490}
507 491
508asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) 492asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)