aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-02 09:59:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:58:48 -0400
commitb7f9a11a6cf1ea9ee6be3eb2b90d91327a09ad14 (patch)
tree7d5a5f469aea8ac2b3e1ab41e05a6abafcb2b694 /arch/blackfin/kernel
parent51a7b448d4134e3e8eec633435e3e8faee14a828 (diff)
new helper: sigmask_to_save()
replace boilerplate "should we use ->saved_sigmask or ->blocked?" with calls of obvious inlined helper... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/signal.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index 9d692a1277b3..7f4205ddfa4d 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -249,7 +249,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
249 */ 249 */
250static int 250static int
251handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, 251handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
252 sigset_t *oldset, struct pt_regs *regs) 252 struct pt_regs *regs)
253{ 253{
254 int ret; 254 int ret;
255 255
@@ -259,7 +259,7 @@ handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
259 handle_restart(regs, ka, 1); 259 handle_restart(regs, ka, 1);
260 260
261 /* set up the stack frame */ 261 /* set up the stack frame */
262 ret = setup_rt_frame(sig, ka, info, oldset, regs); 262 ret = setup_rt_frame(sig, ka, info, sigmask_to_save(), regs);
263 263
264 if (ret == 0) 264 if (ret == 0)
265 block_sigmask(ka, sig); 265 block_sigmask(ka, sig);
@@ -281,22 +281,16 @@ asmlinkage void do_signal(struct pt_regs *regs)
281 siginfo_t info; 281 siginfo_t info;
282 int signr; 282 int signr;
283 struct k_sigaction ka; 283 struct k_sigaction ka;
284 sigset_t *oldset;
285 284
286 current->thread.esp0 = (unsigned long)regs; 285 current->thread.esp0 = (unsigned long)regs;
287 286
288 if (try_to_freeze()) 287 if (try_to_freeze())
289 goto no_signal; 288 goto no_signal;
290 289
291 if (test_thread_flag(TIF_RESTORE_SIGMASK))
292 oldset = &current->saved_sigmask;
293 else
294 oldset = &current->blocked;
295
296 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 290 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
297 if (signr > 0) { 291 if (signr > 0) {
298 /* Whee! Actually deliver the signal. */ 292 /* Whee! Actually deliver the signal. */
299 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { 293 if (handle_signal(signr, &info, &ka, regs) == 0) {
300 /* a signal was successfully delivered; the saved 294 /* a signal was successfully delivered; the saved
301 * sigmask will have been stored in the signal frame, 295 * sigmask will have been stored in the signal frame,
302 * and will be restored by sigreturn, so we can simply 296 * and will be restored by sigreturn, so we can simply