diff options
Diffstat (limited to 'arch/tile/kernel/signal.c')
-rw-r--r-- | arch/tile/kernel/signal.c | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c index f79d4b88c747..e29b0553211d 100644 --- a/arch/tile/kernel/signal.c +++ b/arch/tile/kernel/signal.c | |||
@@ -37,8 +37,6 @@ | |||
37 | 37 | ||
38 | #define DEBUG_SIG 0 | 38 | #define DEBUG_SIG 0 |
39 | 39 | ||
40 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
41 | |||
42 | SYSCALL_DEFINE3(sigaltstack, const stack_t __user *, uss, | 40 | SYSCALL_DEFINE3(sigaltstack, const stack_t __user *, uss, |
43 | stack_t __user *, uoss, struct pt_regs *, regs) | 41 | stack_t __user *, uoss, struct pt_regs *, regs) |
44 | { | 42 | { |
@@ -96,7 +94,6 @@ SYSCALL_DEFINE1(rt_sigreturn, struct pt_regs *, regs) | |||
96 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 94 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
97 | goto badframe; | 95 | goto badframe; |
98 | 96 | ||
99 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
100 | set_current_blocked(&set); | 97 | set_current_blocked(&set); |
101 | 98 | ||
102 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 99 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
@@ -242,10 +239,11 @@ give_sigsegv: | |||
242 | * OK, we're invoking a handler | 239 | * OK, we're invoking a handler |
243 | */ | 240 | */ |
244 | 241 | ||
245 | static int handle_signal(unsigned long sig, siginfo_t *info, | 242 | static void handle_signal(unsigned long sig, siginfo_t *info, |
246 | struct k_sigaction *ka, sigset_t *oldset, | 243 | struct k_sigaction *ka, |
247 | struct pt_regs *regs) | 244 | struct pt_regs *regs) |
248 | { | 245 | { |
246 | sigset_t *oldset = sigmask_to_save(); | ||
249 | int ret; | 247 | int ret; |
250 | 248 | ||
251 | /* Are we from a system call? */ | 249 | /* Are we from a system call? */ |
@@ -278,15 +276,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info, | |||
278 | else | 276 | else |
279 | #endif | 277 | #endif |
280 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | 278 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
281 | if (ret == 0) { | 279 | if (ret) |
282 | /* This code is only called from system calls or from | 280 | return; |
283 | * the work_pending path in the return-to-user code, and | 281 | signal_delivered(sig, info, ka, regs, 0); |
284 | * either way we can re-enable interrupts unconditionally. | ||
285 | */ | ||
286 | block_sigmask(ka, sig); | ||
287 | } | ||
288 | |||
289 | return ret; | ||
290 | } | 282 | } |
291 | 283 | ||
292 | /* | 284 | /* |
@@ -299,7 +291,6 @@ void do_signal(struct pt_regs *regs) | |||
299 | siginfo_t info; | 291 | siginfo_t info; |
300 | int signr; | 292 | int signr; |
301 | struct k_sigaction ka; | 293 | struct k_sigaction ka; |
302 | sigset_t *oldset; | ||
303 | 294 | ||
304 | /* | 295 | /* |
305 | * i386 will check if we're coming from kernel mode and bail out | 296 | * i386 will check if we're coming from kernel mode and bail out |
@@ -308,24 +299,10 @@ void do_signal(struct pt_regs *regs) | |||
308 | * helpful, we can reinstate the check on "!user_mode(regs)". | 299 | * helpful, we can reinstate the check on "!user_mode(regs)". |
309 | */ | 300 | */ |
310 | 301 | ||
311 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) | ||
312 | oldset = ¤t->saved_sigmask; | ||
313 | else | ||
314 | oldset = ¤t->blocked; | ||
315 | |||
316 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 302 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
317 | if (signr > 0) { | 303 | if (signr > 0) { |
318 | /* Whee! Actually deliver the signal. */ | 304 | /* Whee! Actually deliver the signal. */ |
319 | if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { | 305 | handle_signal(signr, &info, &ka, regs); |
320 | /* | ||
321 | * A signal was successfully delivered; the saved | ||
322 | * sigmask will have been stored in the signal frame, | ||
323 | * and will be restored by sigreturn, so we can simply | ||
324 | * clear the TS_RESTORE_SIGMASK flag. | ||
325 | */ | ||
326 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
327 | } | ||
328 | |||
329 | goto done; | 306 | goto done; |
330 | } | 307 | } |
331 | 308 | ||
@@ -350,10 +327,7 @@ void do_signal(struct pt_regs *regs) | |||
350 | } | 327 | } |
351 | 328 | ||
352 | /* If there's no signal to deliver, just put the saved sigmask back. */ | 329 | /* If there's no signal to deliver, just put the saved sigmask back. */ |
353 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) { | 330 | restore_saved_sigmask(); |
354 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
355 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
356 | } | ||
357 | 331 | ||
358 | done: | 332 | done: |
359 | /* Avoid double syscall restart if there are nested signals. */ | 333 | /* Avoid double syscall restart if there are nested signals. */ |