diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-02 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:48 -0400 |
commit | b7f9a11a6cf1ea9ee6be3eb2b90d91327a09ad14 (patch) | |
tree | 7d5a5f469aea8ac2b3e1ab41e05a6abafcb2b694 /arch/sparc | |
parent | 51a7b448d4134e3e8eec633435e3e8faee14a828 (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/sparc')
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 11 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 7 |
2 files changed, 4 insertions, 14 deletions
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 9dd97d2e171e..5d74410c787b 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -451,8 +451,9 @@ sigsegv: | |||
451 | 451 | ||
452 | static inline int | 452 | static inline int |
453 | handle_signal(unsigned long signr, struct k_sigaction *ka, | 453 | handle_signal(unsigned long signr, struct k_sigaction *ka, |
454 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) | 454 | siginfo_t *info, struct pt_regs *regs) |
455 | { | 455 | { |
456 | sigset_t *oldset = sigmask_to_save(); | ||
456 | int err; | 457 | int err; |
457 | 458 | ||
458 | if (ka->sa.sa_flags & SA_SIGINFO) | 459 | if (ka->sa.sa_flags & SA_SIGINFO) |
@@ -498,7 +499,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
498 | { | 499 | { |
499 | struct k_sigaction ka; | 500 | struct k_sigaction ka; |
500 | int restart_syscall; | 501 | int restart_syscall; |
501 | sigset_t *oldset; | ||
502 | siginfo_t info; | 502 | siginfo_t info; |
503 | int signr; | 503 | int signr; |
504 | 504 | ||
@@ -523,11 +523,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
523 | if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C)) | 523 | if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C)) |
524 | regs->u_regs[UREG_G6] = orig_i0; | 524 | regs->u_regs[UREG_G6] = orig_i0; |
525 | 525 | ||
526 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
527 | oldset = ¤t->saved_sigmask; | ||
528 | else | ||
529 | oldset = ¤t->blocked; | ||
530 | |||
531 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 526 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
532 | 527 | ||
533 | /* If the debugger messes with the program counter, it clears | 528 | /* If the debugger messes with the program counter, it clears |
@@ -544,7 +539,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
544 | if (signr > 0) { | 539 | if (signr > 0) { |
545 | if (restart_syscall) | 540 | if (restart_syscall) |
546 | syscall_restart(orig_i0, regs, &ka.sa); | 541 | syscall_restart(orig_i0, regs, &ka.sa); |
547 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { | 542 | if (handle_signal(signr, &ka, &info, regs) == 0) { |
548 | /* a signal was successfully delivered; the saved | 543 | /* a signal was successfully delivered; the saved |
549 | * sigmask will have been stored in the signal frame, | 544 | * sigmask will have been stored in the signal frame, |
550 | * and will be restored by sigreturn, so we can simply | 545 | * and will be restored by sigreturn, so we can simply |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 55b820ee0ac9..088a733f83f9 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -512,7 +512,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
512 | { | 512 | { |
513 | struct k_sigaction ka; | 513 | struct k_sigaction ka; |
514 | int restart_syscall; | 514 | int restart_syscall; |
515 | sigset_t *oldset; | 515 | sigset_t *oldset = sigmask_to_save(); |
516 | siginfo_t info; | 516 | siginfo_t info; |
517 | int signr; | 517 | int signr; |
518 | 518 | ||
@@ -538,11 +538,6 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
538 | (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) | 538 | (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) |
539 | regs->u_regs[UREG_G6] = orig_i0; | 539 | regs->u_regs[UREG_G6] = orig_i0; |
540 | 540 | ||
541 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) | ||
542 | oldset = ¤t->saved_sigmask; | ||
543 | else | ||
544 | oldset = ¤t->blocked; | ||
545 | |||
546 | #ifdef CONFIG_COMPAT | 541 | #ifdef CONFIG_COMPAT |
547 | if (test_thread_flag(TIF_32BIT)) { | 542 | if (test_thread_flag(TIF_32BIT)) { |
548 | extern void do_signal32(sigset_t *, struct pt_regs *); | 543 | extern void do_signal32(sigset_t *, struct pt_regs *); |