diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-24 06:01:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 06:01:48 -0400 |
commit | 238468b2ac76020c192a7402c92df5097916bf4a (patch) | |
tree | a951be34bc3a1d2d3a7d6de98c2100e4296e7bd9 /arch/sparc64/kernel/signal32.c | |
parent | 8243e40acb087fcd9e7609333f0b0551391f49fc (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/signal32.c')
-rw-r--r-- | arch/sparc64/kernel/signal32.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 74e0512f135c..43cdec64d9c9 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c | |||
@@ -982,20 +982,16 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs | |||
982 | * mistake. | 982 | * mistake. |
983 | */ | 983 | */ |
984 | void do_signal32(sigset_t *oldset, struct pt_regs * regs, | 984 | void do_signal32(sigset_t *oldset, struct pt_regs * regs, |
985 | unsigned long orig_i0, int restart_syscall) | 985 | struct signal_deliver_cookie *cookie) |
986 | { | 986 | { |
987 | siginfo_t info; | ||
988 | struct signal_deliver_cookie cookie; | ||
989 | struct k_sigaction ka; | 987 | struct k_sigaction ka; |
988 | siginfo_t info; | ||
990 | int signr; | 989 | int signr; |
991 | 990 | ||
992 | cookie.restart_syscall = restart_syscall; | 991 | signr = get_signal_to_deliver(&info, &ka, regs, cookie); |
993 | cookie.orig_i0 = orig_i0; | ||
994 | |||
995 | signr = get_signal_to_deliver(&info, &ka, regs, &cookie); | ||
996 | if (signr > 0) { | 992 | if (signr > 0) { |
997 | if (cookie.restart_syscall) | 993 | if (cookie->restart_syscall) |
998 | syscall_restart32(orig_i0, regs, &ka.sa); | 994 | syscall_restart32(cookie->orig_i0, regs, &ka.sa); |
999 | handle_signal32(signr, &ka, &info, oldset, regs); | 995 | handle_signal32(signr, &ka, &info, oldset, regs); |
1000 | 996 | ||
1001 | /* a signal was successfully delivered; the saved | 997 | /* a signal was successfully delivered; the saved |
@@ -1007,16 +1003,16 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
1007 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 1003 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
1008 | return; | 1004 | return; |
1009 | } | 1005 | } |
1010 | if (cookie.restart_syscall && | 1006 | if (cookie->restart_syscall && |
1011 | (regs->u_regs[UREG_I0] == ERESTARTNOHAND || | 1007 | (regs->u_regs[UREG_I0] == ERESTARTNOHAND || |
1012 | regs->u_regs[UREG_I0] == ERESTARTSYS || | 1008 | regs->u_regs[UREG_I0] == ERESTARTSYS || |
1013 | regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { | 1009 | regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { |
1014 | /* replay the system call when we are done */ | 1010 | /* replay the system call when we are done */ |
1015 | regs->u_regs[UREG_I0] = cookie.orig_i0; | 1011 | regs->u_regs[UREG_I0] = cookie->orig_i0; |
1016 | regs->tpc -= 4; | 1012 | regs->tpc -= 4; |
1017 | regs->tnpc -= 4; | 1013 | regs->tnpc -= 4; |
1018 | } | 1014 | } |
1019 | if (cookie.restart_syscall && | 1015 | if (cookie->restart_syscall && |
1020 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 1016 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
1021 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 1017 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
1022 | regs->tpc -= 4; | 1018 | regs->tpc -= 4; |