diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-13 01:45:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-13 01:45:15 -0400 |
commit | 9a28dbf8af11d127bf1c644143e7882cb91515dd (patch) | |
tree | 533dfbec4fca25330956d54094cae3dbd6a8d675 /arch | |
parent | faa6cfde747ba6d37a0889cbe85881c80806d355 (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')
-rw-r--r-- | arch/sparc64/kernel/rtrap.S | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal.c | 21 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal32.c | 13 |
3 files changed, 20 insertions, 20 deletions
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index b9b785fd8b46..16689b2930db 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S | |||
@@ -46,7 +46,7 @@ __handle_user_windows: | |||
46 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | 46 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate |
47 | ldx [%g6 + TI_FLAGS], %l0 | 47 | ldx [%g6 + TI_FLAGS], %l0 |
48 | 48 | ||
49 | 1: andcc %l0, (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), %g0 | 49 | 1: andcc %l0, _TIF_SIGPENDING, %g0 |
50 | be,pt %xcc, __handle_user_windows_continue | 50 | be,pt %xcc, __handle_user_windows_continue |
51 | nop | 51 | nop |
52 | mov %l5, %o1 | 52 | mov %l5, %o1 |
@@ -86,7 +86,7 @@ __handle_perfctrs: | |||
86 | wrpr %g0, RTRAP_PSTATE, %pstate | 86 | wrpr %g0, RTRAP_PSTATE, %pstate |
87 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | 87 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate |
88 | ldx [%g6 + TI_FLAGS], %l0 | 88 | ldx [%g6 + TI_FLAGS], %l0 |
89 | 1: andcc %l0, (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), %g0 | 89 | 1: andcc %l0, _TIF_SIGPENDING, %g0 |
90 | 90 | ||
91 | be,pt %xcc, __handle_perfctrs_continue | 91 | be,pt %xcc, __handle_perfctrs_continue |
92 | sethi %hi(TSTATE_PEF), %o0 | 92 | sethi %hi(TSTATE_PEF), %o0 |
@@ -195,7 +195,7 @@ __handle_preemption_continue: | |||
195 | andcc %l1, %o0, %g0 | 195 | andcc %l1, %o0, %g0 |
196 | andcc %l0, _TIF_NEED_RESCHED, %g0 | 196 | andcc %l0, _TIF_NEED_RESCHED, %g0 |
197 | bne,pn %xcc, __handle_preemption | 197 | bne,pn %xcc, __handle_preemption |
198 | andcc %l0, (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), %g0 | 198 | andcc %l0, _TIF_SIGPENDING, %g0 |
199 | bne,pn %xcc, __handle_signal | 199 | bne,pn %xcc, __handle_signal |
200 | __handle_signal_continue: | 200 | __handle_signal_continue: |
201 | ldub [%g6 + TI_WSAVED], %o2 | 201 | ldub [%g6 + TI_WSAVED], %o2 |
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 | } |
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 3f19e9af3d1b..97cdd1bf4a10 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c | |||
@@ -788,13 +788,12 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
788 | syscall_restart32(orig_i0, regs, &ka.sa); | 788 | syscall_restart32(orig_i0, regs, &ka.sa); |
789 | handle_signal32(signr, &ka, &info, oldset, regs); | 789 | handle_signal32(signr, &ka, &info, oldset, regs); |
790 | 790 | ||
791 | /* a signal was successfully delivered; the saved | 791 | /* A signal was successfully delivered; the saved |
792 | * sigmask will have been stored in the signal frame, | 792 | * sigmask will have been stored in the signal frame, |
793 | * and will be restored by sigreturn, so we can simply | 793 | * and will be restored by sigreturn, so we can simply |
794 | * clear the TIF_RESTORE_SIGMASK flag. | 794 | * clear the TS_RESTORE_SIGMASK flag. |
795 | */ | 795 | */ |
796 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 796 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
797 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
798 | return; | 797 | return; |
799 | } | 798 | } |
800 | if (restart_syscall && | 799 | if (restart_syscall && |
@@ -813,11 +812,11 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
813 | regs->tnpc -= 4; | 812 | regs->tnpc -= 4; |
814 | } | 813 | } |
815 | 814 | ||
816 | /* if there's no signal to deliver, we just put the saved sigmask | 815 | /* If there's no signal to deliver, we just put the saved sigmask |
817 | * back | 816 | * back |
818 | */ | 817 | */ |
819 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 818 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) { |
820 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 819 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
821 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 820 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
822 | } | 821 | } |
823 | } | 822 | } |