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>
This commit is contained in:
David S. Miller
2008-04-27 14:52:51 -07:00
parent 5526b7e451
commit 90888816ba
2 changed files with 25 additions and 5 deletions

View File

@ -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;