summaryrefslogtreecommitdiff
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-28 01:52:51 +0400
committerDavid S. Miller <davem@davemloft.net>2008-04-28 01:52:51 +0400
commit90888816ba1bf1c4eff1e7e4220c1afc802f0fd3 (patch)
tree365fd47ce0d18d04e86a83e98ac037bce5e99057 /arch/sparc64
parent5526b7e4513c66bc1c91f661dcd518d5199f8934 (diff)
downloadlinux-90888816ba1bf1c4eff1e7e4220c1afc802f0fd3.tar.xz
sparc64: Clean up handling of pt_regs trap type encoding.
If we use this from more than one place, it's better to have helpers instead of twiddling magic constants all over. Add pt_regs_trap_type(), pt_regs_clear_trap_type(), and pt_regs_is_syscall(). Use them in do_signal(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/signal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 314f51aefa0f..f2d88d8f7a42 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -513,11 +513,10 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
struct k_sigaction ka;
sigset_t *oldset;
siginfo_t info;
- int signr, tt;
+ int signr;
- tt = regs->magic & 0x1ff;
- if (tt == 0x110 || tt == 0x111 || tt == 0x16d) {
- regs->magic &= ~0x1ff;
+ if (pt_regs_is_syscall(regs)) {
+ pt_regs_clear_trap_type(regs);
cookie.restart_syscall = 1;
} else
cookie.restart_syscall = 0;