aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/signal.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-04-28 03:30:37 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-14 08:31:33 -0400
commit7a10174eeafe737f3ccfcece5bdff749c3b044e0 (patch)
tree96d3139ed19153e3369683d6b71cd74852fd1ef5 /arch/powerpc/kernel/signal.c
parent140b932f8cb6cced10b96860651a198b1b89cbb9 (diff)
[POWERPC] Define and use TLF_RESTORE_SIGMASK
Replace TIF_RESTORE_SIGMASK with TLF_RESTORE_SIGMASK and define our own set_restore_sigmask() function. This saves the costly SMP-safe set_bit operation, which we do not need for the sigmask flag since TIF_SIGPENDING always has to be set too. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal.c')
-rw-r--r--arch/powerpc/kernel/signal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index a65a44fbe523..ad55488939c3 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -120,7 +120,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
120 int ret; 120 int ret;
121 int is32 = is_32bit_task(); 121 int is32 = is_32bit_task();
122 122
123 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 123 if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
124 oldset = &current->saved_sigmask; 124 oldset = &current->saved_sigmask;
125 else if (!oldset) 125 else if (!oldset)
126 oldset = &current->blocked; 126 oldset = &current->blocked;
@@ -131,9 +131,10 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
131 check_syscall_restart(regs, &ka, signr > 0); 131 check_syscall_restart(regs, &ka, signr > 0);
132 132
133 if (signr <= 0) { 133 if (signr <= 0) {
134 struct thread_info *ti = current_thread_info();
134 /* No signal to deliver -- put the saved sigmask back */ 135 /* No signal to deliver -- put the saved sigmask back */
135 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 136 if (ti->local_flags & _TLF_RESTORE_SIGMASK) {
136 clear_thread_flag(TIF_RESTORE_SIGMASK); 137 ti->local_flags &= ~_TLF_RESTORE_SIGMASK;
137 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 138 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
138 } 139 }
139 return 0; /* no signals delivered */ 140 return 0; /* no signals delivered */
@@ -169,10 +170,9 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
169 170
170 /* 171 /*
171 * A signal was successfully delivered; the saved sigmask is in 172 * A signal was successfully delivered; the saved sigmask is in
172 * its frame, and we can clear the TIF_RESTORE_SIGMASK flag. 173 * its frame, and we can clear the TLF_RESTORE_SIGMASK flag.
173 */ 174 */
174 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 175 current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
175 clear_thread_flag(TIF_RESTORE_SIGMASK);
176 } 176 }
177 177
178 return ret; 178 return ret;