diff options
Diffstat (limited to 'arch/cris/arch-v10/kernel/signal.c')
-rw-r--r-- | arch/cris/arch-v10/kernel/signal.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index e16f8f297f61..0bb477c13a4e 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #define DEBUG_SIG 0 | 32 | #define DEBUG_SIG 0 |
33 | 33 | ||
34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
35 | |||
36 | /* a syscall in Linux/CRIS is a break 13 instruction which is 2 bytes */ | 34 | /* a syscall in Linux/CRIS is a break 13 instruction which is 2 bytes */ |
37 | /* manipulate regs so that upon return, it will be re-executed */ | 35 | /* manipulate regs so that upon return, it will be re-executed */ |
38 | 36 | ||
@@ -176,7 +174,6 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, | |||
176 | sizeof(frame->extramask)))) | 174 | sizeof(frame->extramask)))) |
177 | goto badframe; | 175 | goto badframe; |
178 | 176 | ||
179 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
180 | set_current_blocked(&set); | 177 | set_current_blocked(&set); |
181 | 178 | ||
182 | if (restore_sigcontext(regs, &frame->sc)) | 179 | if (restore_sigcontext(regs, &frame->sc)) |
@@ -212,7 +209,6 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, | |||
212 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 209 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
213 | goto badframe; | 210 | goto badframe; |
214 | 211 | ||
215 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
216 | set_current_blocked(&set); | 212 | set_current_blocked(&set); |
217 | 213 | ||
218 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 214 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
@@ -415,10 +411,11 @@ give_sigsegv: | |||
415 | * OK, we're invoking a handler | 411 | * OK, we're invoking a handler |
416 | */ | 412 | */ |
417 | 413 | ||
418 | static inline int handle_signal(int canrestart, unsigned long sig, | 414 | static inline void handle_signal(int canrestart, unsigned long sig, |
419 | siginfo_t *info, struct k_sigaction *ka, | 415 | siginfo_t *info, struct k_sigaction *ka, |
420 | sigset_t *oldset, struct pt_regs *regs) | 416 | struct pt_regs *regs) |
421 | { | 417 | { |
418 | sigset_t *oldset = sigmask_to_save(); | ||
422 | int ret; | 419 | int ret; |
423 | 420 | ||
424 | /* Are we from a system call? */ | 421 | /* Are we from a system call? */ |
@@ -456,9 +453,7 @@ static inline int handle_signal(int canrestart, unsigned long sig, | |||
456 | ret = setup_frame(sig, ka, oldset, regs); | 453 | ret = setup_frame(sig, ka, oldset, regs); |
457 | 454 | ||
458 | if (ret == 0) | 455 | if (ret == 0) |
459 | block_sigmask(ka, sig); | 456 | signal_delivered(sig, info, ka, regs, 0); |
460 | |||
461 | return ret; | ||
462 | } | 457 | } |
463 | 458 | ||
464 | /* | 459 | /* |
@@ -478,7 +473,6 @@ void do_signal(int canrestart, struct pt_regs *regs) | |||
478 | siginfo_t info; | 473 | siginfo_t info; |
479 | int signr; | 474 | int signr; |
480 | struct k_sigaction ka; | 475 | struct k_sigaction ka; |
481 | sigset_t *oldset; | ||
482 | 476 | ||
483 | /* | 477 | /* |
484 | * We want the common case to go fast, which | 478 | * We want the common case to go fast, which |
@@ -489,23 +483,10 @@ void do_signal(int canrestart, struct pt_regs *regs) | |||
489 | if (!user_mode(regs)) | 483 | if (!user_mode(regs)) |
490 | return; | 484 | return; |
491 | 485 | ||
492 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
493 | oldset = ¤t->saved_sigmask; | ||
494 | else | ||
495 | oldset = ¤t->blocked; | ||
496 | |||
497 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 486 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
498 | if (signr > 0) { | 487 | if (signr > 0) { |
499 | /* Whee! Actually deliver the signal. */ | 488 | /* Whee! Actually deliver the signal. */ |
500 | if (handle_signal(canrestart, signr, &info, &ka, | 489 | handle_signal(canrestart, signr, &info, &ka, regs); |
501 | oldset, regs)) { | ||
502 | /* a signal was successfully delivered; the saved | ||
503 | * sigmask will have been stored in the signal frame, | ||
504 | * and will be restored by sigreturn, so we can simply | ||
505 | * clear the TIF_RESTORE_SIGMASK flag */ | ||
506 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
507 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
508 | } | ||
509 | return; | 490 | return; |
510 | } | 491 | } |
511 | 492 | ||
@@ -525,8 +506,5 @@ void do_signal(int canrestart, struct pt_regs *regs) | |||
525 | 506 | ||
526 | /* if there's no signal to deliver, we just put the saved sigmask | 507 | /* if there's no signal to deliver, we just put the saved sigmask |
527 | * back */ | 508 | * back */ |
528 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 509 | restore_saved_sigmask(); |
529 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
530 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
531 | } | ||
532 | } | 510 | } |