diff options
Diffstat (limited to 'arch/powerpc/kernel/signal.c')
-rw-r--r-- | arch/powerpc/kernel/signal.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index bfc3ec1382fb..5c023c9cf16e 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -51,16 +51,6 @@ void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
51 | return (void __user *)newsp; | 51 | return (void __user *)newsp; |
52 | } | 52 | } |
53 | 53 | ||
54 | |||
55 | /* | ||
56 | * Restore the user process's signal mask | ||
57 | */ | ||
58 | void restore_sigmask(sigset_t *set) | ||
59 | { | ||
60 | sigdelsetmask(set, ~_BLOCKABLE); | ||
61 | set_current_blocked(set); | ||
62 | } | ||
63 | |||
64 | static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | 54 | static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, |
65 | int has_handler) | 55 | int has_handler) |
66 | { | 56 | { |
@@ -114,30 +104,21 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | |||
114 | 104 | ||
115 | static int do_signal(struct pt_regs *regs) | 105 | static int do_signal(struct pt_regs *regs) |
116 | { | 106 | { |
117 | sigset_t *oldset; | 107 | sigset_t *oldset = sigmask_to_save(); |
118 | siginfo_t info; | 108 | siginfo_t info; |
119 | int signr; | 109 | int signr; |
120 | struct k_sigaction ka; | 110 | struct k_sigaction ka; |
121 | int ret; | 111 | int ret; |
122 | int is32 = is_32bit_task(); | 112 | int is32 = is_32bit_task(); |
123 | 113 | ||
124 | if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK) | ||
125 | oldset = ¤t->saved_sigmask; | ||
126 | else | ||
127 | oldset = ¤t->blocked; | ||
128 | |||
129 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 114 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
130 | 115 | ||
131 | /* Is there any syscall restart business here ? */ | 116 | /* Is there any syscall restart business here ? */ |
132 | check_syscall_restart(regs, &ka, signr > 0); | 117 | check_syscall_restart(regs, &ka, signr > 0); |
133 | 118 | ||
134 | if (signr <= 0) { | 119 | if (signr <= 0) { |
135 | struct thread_info *ti = current_thread_info(); | ||
136 | /* No signal to deliver -- put the saved sigmask back */ | 120 | /* No signal to deliver -- put the saved sigmask back */ |
137 | if (ti->local_flags & _TLF_RESTORE_SIGMASK) { | 121 | restore_saved_sigmask(); |
138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
140 | } | ||
141 | regs->trap = 0; | 122 | regs->trap = 0; |
142 | return 0; /* no signals delivered */ | 123 | return 0; /* no signals delivered */ |
143 | } | 124 | } |
@@ -167,18 +148,7 @@ static int do_signal(struct pt_regs *regs) | |||
167 | 148 | ||
168 | regs->trap = 0; | 149 | regs->trap = 0; |
169 | if (ret) { | 150 | if (ret) { |
170 | block_sigmask(&ka, signr); | 151 | signal_delivered(signr, &info, &ka, regs, |
171 | |||
172 | /* | ||
173 | * A signal was successfully delivered; the saved sigmask is in | ||
174 | * its frame, and we can clear the TLF_RESTORE_SIGMASK flag. | ||
175 | */ | ||
176 | current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
177 | |||
178 | /* | ||
179 | * Let tracing know that we've done the handler setup. | ||
180 | */ | ||
181 | tracehook_signal_handler(signr, &info, &ka, regs, | ||
182 | test_thread_flag(TIF_SINGLESTEP)); | 152 | test_thread_flag(TIF_SINGLESTEP)); |
183 | } | 153 | } |
184 | 154 | ||