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/cris | |
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/cris')
-rw-r--r-- | arch/cris/arch-v10/kernel/signal.c | 11 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 11 |
2 files changed, 6 insertions, 16 deletions
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 06885e94e455..09a4cf4eb08a 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -417,8 +417,9 @@ give_sigsegv: | |||
417 | 417 | ||
418 | static inline int handle_signal(int canrestart, unsigned long sig, | 418 | static inline int handle_signal(int canrestart, unsigned long sig, |
419 | siginfo_t *info, struct k_sigaction *ka, | 419 | siginfo_t *info, struct k_sigaction *ka, |
420 | sigset_t *oldset, struct pt_regs *regs) | 420 | struct pt_regs *regs) |
421 | { | 421 | { |
422 | sigset_t *oldset = sigmask_to_save(); | ||
422 | int ret; | 423 | int ret; |
423 | 424 | ||
424 | /* Are we from a system call? */ | 425 | /* Are we from a system call? */ |
@@ -478,7 +479,6 @@ void do_signal(int canrestart, struct pt_regs *regs) | |||
478 | siginfo_t info; | 479 | siginfo_t info; |
479 | int signr; | 480 | int signr; |
480 | struct k_sigaction ka; | 481 | struct k_sigaction ka; |
481 | sigset_t *oldset; | ||
482 | 482 | ||
483 | /* | 483 | /* |
484 | * We want the common case to go fast, which | 484 | * We want the common case to go fast, which |
@@ -489,16 +489,11 @@ void do_signal(int canrestart, struct pt_regs *regs) | |||
489 | if (!user_mode(regs)) | 489 | if (!user_mode(regs)) |
490 | return; | 490 | return; |
491 | 491 | ||
492 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
493 | oldset = ¤t->saved_sigmask; | ||
494 | else | ||
495 | oldset = ¤t->blocked; | ||
496 | |||
497 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 492 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
498 | if (signr > 0) { | 493 | if (signr > 0) { |
499 | /* Whee! Actually deliver the signal. */ | 494 | /* Whee! Actually deliver the signal. */ |
500 | if (handle_signal(canrestart, signr, &info, &ka, | 495 | if (handle_signal(canrestart, signr, &info, &ka, |
501 | oldset, regs)) { | 496 | regs)) { |
502 | /* a signal was successfully delivered; the saved | 497 | /* a signal was successfully delivered; the saved |
503 | * sigmask will have been stored in the signal frame, | 498 | * sigmask will have been stored in the signal frame, |
504 | * and will be restored by sigreturn, so we can simply | 499 | * and will be restored by sigreturn, so we can simply |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index fe12cdca0bac..d52276ddae4b 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -437,8 +437,9 @@ give_sigsegv: | |||
437 | static inline int | 437 | static inline int |
438 | handle_signal(int canrestart, unsigned long sig, | 438 | handle_signal(int canrestart, unsigned long sig, |
439 | siginfo_t *info, struct k_sigaction *ka, | 439 | siginfo_t *info, struct k_sigaction *ka, |
440 | sigset_t *oldset, struct pt_regs * regs) | 440 | struct pt_regs * regs) |
441 | { | 441 | { |
442 | sigset_t *oldset = sigmask_to_save(); | ||
442 | int ret; | 443 | int ret; |
443 | 444 | ||
444 | /* Check if this got called from a system call. */ | 445 | /* Check if this got called from a system call. */ |
@@ -511,7 +512,6 @@ do_signal(int canrestart, struct pt_regs *regs) | |||
511 | int signr; | 512 | int signr; |
512 | siginfo_t info; | 513 | siginfo_t info; |
513 | struct k_sigaction ka; | 514 | struct k_sigaction ka; |
514 | sigset_t *oldset; | ||
515 | 515 | ||
516 | /* | 516 | /* |
517 | * The common case should go fast, which is why this point is | 517 | * The common case should go fast, which is why this point is |
@@ -521,17 +521,12 @@ do_signal(int canrestart, struct pt_regs *regs) | |||
521 | if (!user_mode(regs)) | 521 | if (!user_mode(regs)) |
522 | return; | 522 | return; |
523 | 523 | ||
524 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
525 | oldset = ¤t->saved_sigmask; | ||
526 | else | ||
527 | oldset = ¤t->blocked; | ||
528 | |||
529 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 524 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
530 | 525 | ||
531 | if (signr > 0) { | 526 | if (signr > 0) { |
532 | /* Whee! Actually deliver the signal. */ | 527 | /* Whee! Actually deliver the signal. */ |
533 | if (handle_signal(canrestart, signr, &info, &ka, | 528 | if (handle_signal(canrestart, signr, &info, &ka, |
534 | oldset, regs)) { | 529 | regs)) { |
535 | /* a signal was successfully delivered; the saved | 530 | /* a signal was successfully delivered; the saved |
536 | * sigmask will have been stored in the signal frame, | 531 | * sigmask will have been stored in the signal frame, |
537 | * and will be restored by sigreturn, so we can simply | 532 | * and will be restored by sigreturn, so we can simply |