aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/signal.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-24 06:01:48 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-24 06:01:48 -0400
commit238468b2ac76020c192a7402c92df5097916bf4a (patch)
treea951be34bc3a1d2d3a7d6de98c2100e4296e7bd9 /arch/sparc64/kernel/signal.c
parent8243e40acb087fcd9e7609333f0b0551391f49fc (diff)
[SPARC64]: Use trap type stored in pt_regs to handle syscall restart.
Now that we can check the trap type directly, we don't need the funny restart_syscall indication from the trap return paths. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/signal.c')
-rw-r--r--arch/sparc64/kernel/signal.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 1c47009eb5ec..b959597201ed 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -510,15 +510,20 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
510 * want to handle. Thus you cannot kill init even with a SIGKILL even by 510 * want to handle. Thus you cannot kill init even with a SIGKILL even by
511 * mistake. 511 * mistake.
512 */ 512 */
513static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_syscall) 513static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
514{ 514{
515 siginfo_t info;
516 struct signal_deliver_cookie cookie; 515 struct signal_deliver_cookie cookie;
517 struct k_sigaction ka; 516 struct k_sigaction ka;
518 int signr;
519 sigset_t *oldset; 517 sigset_t *oldset;
518 siginfo_t info;
519 int signr, tt;
520 520
521 cookie.restart_syscall = restart_syscall; 521 tt = regs->magic & 0x1ff;
522 if (tt == 0x110 || tt == 0x111 || tt == 0x16d) {
523 regs->magic &= ~0x1ff;
524 cookie.restart_syscall = 1;
525 } else
526 cookie.restart_syscall = 0;
522 cookie.orig_i0 = orig_i0; 527 cookie.orig_i0 = orig_i0;
523 528
524 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 529 if (test_thread_flag(TIF_RESTORE_SIGMASK))
@@ -529,9 +534,8 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_s
529#ifdef CONFIG_SPARC32_COMPAT 534#ifdef CONFIG_SPARC32_COMPAT
530 if (test_thread_flag(TIF_32BIT)) { 535 if (test_thread_flag(TIF_32BIT)) {
531 extern void do_signal32(sigset_t *, struct pt_regs *, 536 extern void do_signal32(sigset_t *, struct pt_regs *,
532 unsigned long, int); 537 struct signal_deliver_cookie *);
533 do_signal32(oldset, regs, orig_i0, 538 do_signal32(oldset, regs, &cookie);
534 cookie.restart_syscall);
535 return; 539 return;
536 } 540 }
537#endif 541#endif
@@ -539,7 +543,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_s
539 signr = get_signal_to_deliver(&info, &ka, regs, &cookie); 543 signr = get_signal_to_deliver(&info, &ka, regs, &cookie);
540 if (signr > 0) { 544 if (signr > 0) {
541 if (cookie.restart_syscall) 545 if (cookie.restart_syscall)
542 syscall_restart(orig_i0, regs, &ka.sa); 546 syscall_restart(cookie.orig_i0, regs, &ka.sa);
543 handle_signal(signr, &ka, &info, oldset, regs); 547 handle_signal(signr, &ka, &info, oldset, regs);
544 548
545 /* a signal was successfully delivered; the saved 549 /* a signal was successfully delivered; the saved
@@ -580,7 +584,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, int restart_s
580 unsigned long thread_info_flags) 584 unsigned long thread_info_flags)
581{ 585{
582 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) 586 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
583 do_signal(regs, orig_i0, restart_syscall); 587 do_signal(regs, orig_i0);
584} 588}
585 589
586void ptrace_signal_deliver(struct pt_regs *regs, void *cookie) 590void ptrace_signal_deliver(struct pt_regs *regs, void *cookie)