diff options
Diffstat (limited to 'arch/ia64/kernel/signal.c')
-rw-r--r-- | arch/ia64/kernel/signal.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index 7523501d3bc0..a199be1fe619 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #define DEBUG_SIG 0 | 31 | #define DEBUG_SIG 0 |
32 | #define STACK_ALIGN 16 /* minimal alignment for stack pointer */ | 32 | #define STACK_ALIGN 16 /* minimal alignment for stack pointer */ |
33 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
34 | 33 | ||
35 | #if _NSIG_WORDS > 1 | 34 | #if _NSIG_WORDS > 1 |
36 | # define PUT_SIGSET(k,u) __copy_to_user((u)->sig, (k)->sig, sizeof(sigset_t)) | 35 | # define PUT_SIGSET(k,u) __copy_to_user((u)->sig, (k)->sig, sizeof(sigset_t)) |
@@ -200,7 +199,6 @@ ia64_rt_sigreturn (struct sigscratch *scr) | |||
200 | if (GET_SIGSET(&set, &sc->sc_mask)) | 199 | if (GET_SIGSET(&set, &sc->sc_mask)) |
201 | goto give_sigsegv; | 200 | goto give_sigsegv; |
202 | 201 | ||
203 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
204 | set_current_blocked(&set); | 202 | set_current_blocked(&set); |
205 | 203 | ||
206 | if (restore_sigcontext(sc, scr)) | 204 | if (restore_sigcontext(sc, scr)) |
@@ -415,18 +413,13 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, | |||
415 | } | 413 | } |
416 | 414 | ||
417 | static long | 415 | static long |
418 | handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, | 416 | handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, |
419 | struct sigscratch *scr) | 417 | struct sigscratch *scr) |
420 | { | 418 | { |
421 | if (!setup_frame(sig, ka, info, oldset, scr)) | 419 | if (!setup_frame(sig, ka, info, sigmask_to_save(), scr)) |
422 | return 0; | 420 | return 0; |
423 | 421 | ||
424 | block_sigmask(ka, sig); | 422 | signal_delivered(sig, info, ka, &scr->pt, |
425 | |||
426 | /* | ||
427 | * Let tracing know that we've done the handler setup. | ||
428 | */ | ||
429 | tracehook_signal_handler(sig, info, ka, &scr->pt, | ||
430 | test_thread_flag(TIF_SINGLESTEP)); | 423 | test_thread_flag(TIF_SINGLESTEP)); |
431 | 424 | ||
432 | return 1; | 425 | return 1; |
@@ -440,7 +433,6 @@ void | |||
440 | ia64_do_signal (struct sigscratch *scr, long in_syscall) | 433 | ia64_do_signal (struct sigscratch *scr, long in_syscall) |
441 | { | 434 | { |
442 | struct k_sigaction ka; | 435 | struct k_sigaction ka; |
443 | sigset_t *oldset; | ||
444 | siginfo_t info; | 436 | siginfo_t info; |
445 | long restart = in_syscall; | 437 | long restart = in_syscall; |
446 | long errno = scr->pt.r8; | 438 | long errno = scr->pt.r8; |
@@ -453,11 +445,6 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
453 | if (!user_mode(&scr->pt)) | 445 | if (!user_mode(&scr->pt)) |
454 | return; | 446 | return; |
455 | 447 | ||
456 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) | ||
457 | oldset = ¤t->saved_sigmask; | ||
458 | else | ||
459 | oldset = ¤t->blocked; | ||
460 | |||
461 | /* | 448 | /* |
462 | * This only loops in the rare cases of handle_signal() failing, in which case we | 449 | * This only loops in the rare cases of handle_signal() failing, in which case we |
463 | * need to push through a forced SIGSEGV. | 450 | * need to push through a forced SIGSEGV. |
@@ -507,16 +494,8 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
507 | * Whee! Actually deliver the signal. If the delivery failed, we need to | 494 | * Whee! Actually deliver the signal. If the delivery failed, we need to |
508 | * continue to iterate in this loop so we can deliver the SIGSEGV... | 495 | * continue to iterate in this loop so we can deliver the SIGSEGV... |
509 | */ | 496 | */ |
510 | if (handle_signal(signr, &ka, &info, oldset, scr)) { | 497 | if (handle_signal(signr, &ka, &info, scr)) |
511 | /* | ||
512 | * A signal was successfully delivered; the saved | ||
513 | * sigmask will have been stored in the signal frame, | ||
514 | * and will be restored by sigreturn, so we can simply | ||
515 | * clear the TS_RESTORE_SIGMASK flag. | ||
516 | */ | ||
517 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
518 | return; | 498 | return; |
519 | } | ||
520 | } | 499 | } |
521 | 500 | ||
522 | /* Did we come from a system call? */ | 501 | /* Did we come from a system call? */ |
@@ -538,8 +517,5 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
538 | 517 | ||
539 | /* if there's no signal to deliver, we just put the saved sigmask | 518 | /* if there's no signal to deliver, we just put the saved sigmask |
540 | * back */ | 519 | * back */ |
541 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) { | 520 | restore_saved_sigmask(); |
542 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
543 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
544 | } | ||
545 | } | 521 | } |