Commit 7ff3a762 authored by Eric W. Biederman's avatar Eric W. Biederman

signal/riscv: Replace do_trap_siginfo with force_sig_fault

The function force_sig_fault is just the generic version of
do_trap_siginfo with a (void __user *) instead of an unsigned long
parameter for the address.

So just use force_sig_fault to simplify the code.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <albert@sifive.com>
Cc: linux-riscv@lists.infradead.org
Suggested-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 4d6a20b1
...@@ -63,12 +63,6 @@ void die(struct pt_regs *regs, const char *str) ...@@ -63,12 +63,6 @@ void die(struct pt_regs *regs, const char *str)
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
static inline void do_trap_siginfo(int signo, int code,
unsigned long addr, struct task_struct *tsk)
{
force_sig_fault(signo, code, (void __user *)addr, tsk);
}
void do_trap(struct pt_regs *regs, int signo, int code, void do_trap(struct pt_regs *regs, int signo, int code,
unsigned long addr, struct task_struct *tsk) unsigned long addr, struct task_struct *tsk)
{ {
...@@ -81,7 +75,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, ...@@ -81,7 +75,7 @@ void do_trap(struct pt_regs *regs, int signo, int code,
show_regs(regs); show_regs(regs);
} }
do_trap_siginfo(signo, code, addr, tsk); force_sig_fault(signo, code, (void __user *)addr, tsk);
} }
static void do_trap_error(struct pt_regs *regs, int signo, int code, static void do_trap_error(struct pt_regs *regs, int signo, int code,
...@@ -143,7 +137,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs) ...@@ -143,7 +137,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
} }
#endif /* CONFIG_GENERIC_BUG */ #endif /* CONFIG_GENERIC_BUG */
do_trap_siginfo(SIGTRAP, TRAP_BRKPT, regs->sepc, current); force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc), current);
regs->sepc += 0x4; regs->sepc += 0x4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment