aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 14:53:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 14:53:44 -0400
commit86c47b70f62a7072d441ba212aab33c2f82627c2 (patch)
treed03988bd2226966352bb7f3c2e82ff545353d2c4 /arch/m32r
parent1193755ac6328ad240ba987e6ec41d5e8baf0680 (diff)
parent44fbbb3dc687c9709a6f2236197316e5c79ab1eb (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull third pile of signal handling patches from Al Viro: "This time it's mostly helpers and conversions to them; there's a lot of stuff remaining in the tree, but that'll either go in -rc2 (isolated bug fixes, ideally via arch maintainers' trees) or will sit there until the next cycle." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: x86: get rid of calling do_notify_resume() when returning to kernel mode blackfin: check __get_user() return value whack-a-mole with TIF_FREEZE FRV: Optimise the system call exit path in entry.S [ver #2] FRV: Shrink TIF_WORK_MASK [ver #2] FRV: Prevent syscall exit tracing and notify_resume at end of kernel exceptions new helper: signal_delivered() powerpc: get rid of restore_sigmask() most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set set_restore_sigmask() is never called without SIGPENDING (and never should be) TIF_RESTORE_SIGMASK can be set only when TIF_SIGPENDING is set don't call try_to_freeze() from do_signal() pull clearing RESTORE_SIGMASK into block_sigmask() sh64: failure to build sigframe != signal without handler openrisc: tracehook_signal_handler() is supposed to be called on success new helper: sigmask_to_save() new helper: restore_saved_sigmask() new helpers: {clear,test,test_and_clear}_restore_sigmask() HAVE_RESTORE_SIGMASK is defined on all architectures now
Diffstat (limited to 'arch/m32r')
-rw-r--r--arch/m32r/kernel/signal.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 64804f1f5141..f3fb2c029cfc 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -28,8 +28,6 @@
28 28
29#define DEBUG_SIG 0 29#define DEBUG_SIG 0
30 30
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32
33asmlinkage int 31asmlinkage int
34sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 32sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
35 unsigned long r2, unsigned long r3, unsigned long r4, 33 unsigned long r2, unsigned long r3, unsigned long r4,
@@ -111,7 +109,6 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
111 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 109 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
112 goto badframe; 110 goto badframe;
113 111
114 sigdelsetmask(&set, ~_BLOCKABLE);
115 set_current_blocked(&set); 112 set_current_blocked(&set);
116 113
117 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) 114 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
@@ -267,9 +264,9 @@ static int prev_insn(struct pt_regs *regs)
267 * OK, we're invoking a handler 264 * OK, we're invoking a handler
268 */ 265 */
269 266
270static int 267static void
271handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 268handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
272 sigset_t *oldset, struct pt_regs *regs) 269 struct pt_regs *regs)
273{ 270{
274 /* Are we from a system call? */ 271 /* Are we from a system call? */
275 if (regs->syscall_nr >= 0) { 272 if (regs->syscall_nr >= 0) {
@@ -294,11 +291,10 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
294 } 291 }
295 292
296 /* Set up the stack frame */ 293 /* Set up the stack frame */
297 if (setup_rt_frame(sig, ka, info, oldset, regs)) 294 if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs))
298 return -EFAULT; 295 return;
299 296
300 block_sigmask(ka, sig); 297 signal_delivered(sig, info, ka, regs, 0);
301 return 0;
302} 298}
303 299
304/* 300/*
@@ -311,7 +307,6 @@ static void do_signal(struct pt_regs *regs)
311 siginfo_t info; 307 siginfo_t info;
312 int signr; 308 int signr;
313 struct k_sigaction ka; 309 struct k_sigaction ka;
314 sigset_t *oldset;
315 310
316 /* 311 /*
317 * We want the common case to go fast, which 312 * We want the common case to go fast, which
@@ -322,14 +317,6 @@ static void do_signal(struct pt_regs *regs)
322 if (!user_mode(regs)) 317 if (!user_mode(regs))
323 return; 318 return;
324 319
325 if (try_to_freeze())
326 goto no_signal;
327
328 if (test_thread_flag(TIF_RESTORE_SIGMASK))
329 oldset = &current->saved_sigmask;
330 else
331 oldset = &current->blocked;
332
333 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 320 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
334 if (signr > 0) { 321 if (signr > 0) {
335 /* Re-enable any watchpoints before delivering the 322 /* Re-enable any watchpoints before delivering the
@@ -339,13 +326,11 @@ static void do_signal(struct pt_regs *regs)
339 */ 326 */
340 327
341 /* Whee! Actually deliver the signal. */ 328 /* Whee! Actually deliver the signal. */
342 if (handle_signal(signr, &ka, &info, oldset, regs) == 0) 329 handle_signal(signr, &ka, &info, regs);
343 clear_thread_flag(TIF_RESTORE_SIGMASK);
344 330
345 return; 331 return;
346 } 332 }
347 333
348 no_signal:
349 /* Did we come from a system call? */ 334 /* Did we come from a system call? */
350 if (regs->syscall_nr >= 0) { 335 if (regs->syscall_nr >= 0) {
351 /* Restart the system call - no handlers present */ 336 /* Restart the system call - no handlers present */
@@ -360,10 +345,7 @@ static void do_signal(struct pt_regs *regs)
360 prev_insn(regs); 345 prev_insn(regs);
361 } 346 }
362 } 347 }
363 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 348 restore_saved_sigmask();
364 clear_thread_flag(TIF_RESTORE_SIGMASK);
365 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
366 }
367} 349}
368 350
369/* 351/*