aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/signal.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-13 01:45:15 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-13 01:45:15 -0400
commit9a28dbf8af11d127bf1c644143e7882cb91515dd (patch)
tree533dfbec4fca25330956d54094cae3dbd6a8d675 /arch/sparc64/kernel/signal.c
parentfaa6cfde747ba6d37a0889cbe85881c80806d355 (diff)
sparc64: Use a TS_RESTORE_SIGMASK
This mirrors x86 changeset 5a8da0ea82db6fa9737041381079fd16f25dcce2 ("signals: x86 TS_RESTORE_SIGMASK") on sparc64. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/signal.c')
-rw-r--r--arch/sparc64/kernel/signal.c21
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 = &current->saved_sigmask; 543 oldset = &current->saved_sigmask;
542 else 544 else
543 oldset = &current->blocked; 545 oldset = &current->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, &current->saved_sigmask, NULL); 600 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
600 } 601 }
601} 602}
602 603
603void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags) 604void 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}