diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 21:42:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 23:52:30 -0400 |
commit | 68f3f16d9ad0f1e28ab3fd0001ab5798c41f15a3 (patch) | |
tree | fd023109413f5eb28b364663fdf4bf2eabca47d4 /arch/cris | |
parent | bf67f3a5c456a18f2e8d062f7e88506ef2cd9837 (diff) |
new helper: sigsuspend()
guts of saved_sigmask-based sigsuspend/rt_sigsuspend. Takes
kernel sigset_t *.
Open-coded instances replaced with calling it.
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 | 16 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 289c584ba499..170f4970d590 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -48,19 +48,11 @@ void do_signal(int canrestart, struct pt_regs *regs); | |||
48 | * dummy arguments to be able to reach the regs argument. (Note that this | 48 | * dummy arguments to be able to reach the regs argument. (Note that this |
49 | * arrangement relies on old_sigset_t occupying one register.) | 49 | * arrangement relies on old_sigset_t occupying one register.) |
50 | */ | 50 | */ |
51 | int sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, | 51 | int sys_sigsuspend(old_sigset_t mask) |
52 | long srp, struct pt_regs *regs) | ||
53 | { | 52 | { |
54 | mask &= _BLOCKABLE; | 53 | sigset_t blocked; |
55 | spin_lock_irq(¤t->sighand->siglock); | 54 | siginitset(&blocked, mask); |
56 | current->saved_sigmask = current->blocked; | 55 | return sigsuspend(&blocked); |
57 | siginitset(¤t->blocked, mask); | ||
58 | recalc_sigpending(); | ||
59 | spin_unlock_irq(¤t->sighand->siglock); | ||
60 | current->state = TASK_INTERRUPTIBLE; | ||
61 | schedule(); | ||
62 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
63 | return -ERESTARTNOHAND; | ||
64 | } | 56 | } |
65 | 57 | ||
66 | int sys_sigaction(int sig, const struct old_sigaction __user *act, | 58 | int sys_sigaction(int sig, const struct old_sigaction __user *act, |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index ce4ab1a5552c..e09083208cb6 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -59,19 +59,11 @@ void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, | |||
59 | * dummy arguments to be able to reach the regs argument. | 59 | * dummy arguments to be able to reach the regs argument. |
60 | */ | 60 | */ |
61 | int | 61 | int |
62 | sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, | 62 | sys_sigsuspend(old_sigset_t mask) |
63 | long srp, struct pt_regs *regs) | ||
64 | { | 63 | { |
65 | mask &= _BLOCKABLE; | 64 | sigset_t blocked; |
66 | spin_lock_irq(¤t->sighand->siglock); | 65 | siginitset(&blocked, mask); |
67 | current->saved_sigmask = current->blocked; | 66 | return sigsuspend(&blocked); |
68 | siginitset(¤t->blocked, mask); | ||
69 | recalc_sigpending(); | ||
70 | spin_unlock_irq(¤t->sighand->siglock); | ||
71 | current->state = TASK_INTERRUPTIBLE; | ||
72 | schedule(); | ||
73 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
74 | return -ERESTARTNOHAND; | ||
75 | } | 67 | } |
76 | 68 | ||
77 | int | 69 | int |