diff options
Diffstat (limited to 'arch/sparc64/kernel/signal.c')
-rw-r--r-- | arch/sparc64/kernel/signal.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 2378482c2aab..6e4dc67d16af 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c | |||
@@ -247,7 +247,9 @@ static long _sigpause_common(old_sigset_t set) | |||
247 | 247 | ||
248 | current->state = TASK_INTERRUPTIBLE; | 248 | current->state = TASK_INTERRUPTIBLE; |
249 | schedule(); | 249 | schedule(); |
250 | set_thread_flag(TIF_RESTORE_SIGMASK); | 250 | |
251 | set_restore_sigmask(); | ||
252 | |||
251 | return -ERESTARTNOHAND; | 253 | return -ERESTARTNOHAND; |
252 | } | 254 | } |
253 | 255 | ||
@@ -537,7 +539,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
537 | } else | 539 | } else |
538 | restart_syscall = 0; | 540 | restart_syscall = 0; |
539 | 541 | ||
540 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 542 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) |
541 | oldset = ¤t->saved_sigmask; | 543 | oldset = ¤t->saved_sigmask; |
542 | else | 544 | else |
543 | oldset = ¤t->blocked; | 545 | oldset = ¤t->blocked; |
@@ -566,13 +568,12 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
566 | syscall_restart(orig_i0, regs, &ka.sa); | 568 | syscall_restart(orig_i0, regs, &ka.sa); |
567 | handle_signal(signr, &ka, &info, oldset, regs); | 569 | handle_signal(signr, &ka, &info, oldset, regs); |
568 | 570 | ||
569 | /* a signal was successfully delivered; the saved | 571 | /* A signal was successfully delivered; the saved |
570 | * sigmask will have been stored in the signal frame, | 572 | * sigmask will have been stored in the signal frame, |
571 | * and will be restored by sigreturn, so we can simply | 573 | * and will be restored by sigreturn, so we can simply |
572 | * clear the TIF_RESTORE_SIGMASK flag. | 574 | * clear the TS_RESTORE_SIGMASK flag. |
573 | */ | 575 | */ |
574 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 576 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
575 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
576 | return; | 577 | return; |
577 | } | 578 | } |
578 | if (restart_syscall && | 579 | if (restart_syscall && |
@@ -591,17 +592,17 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
591 | regs->tnpc -= 4; | 592 | regs->tnpc -= 4; |
592 | } | 593 | } |
593 | 594 | ||
594 | /* if there's no signal to deliver, we just put the saved sigmask | 595 | /* If there's no signal to deliver, we just put the saved sigmask |
595 | * back | 596 | * back |
596 | */ | 597 | */ |
597 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 598 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) { |
598 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 599 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
599 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 600 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
600 | } | 601 | } |
601 | } | 602 | } |
602 | 603 | ||
603 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags) | 604 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags) |
604 | { | 605 | { |
605 | if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) | 606 | if (thread_info_flags & _TIF_SIGPENDING) |
606 | do_signal(regs, orig_i0); | 607 | do_signal(regs, orig_i0); |
607 | } | 608 | } |