Commit 887f1ae3 authored by Paul Mundt's avatar Paul Mundt

sh: Look up the trap vector for the page fault notifier.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4c59e294
...@@ -21,26 +21,21 @@ ...@@ -21,26 +21,21 @@
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/kgdb.h> #include <asm/kgdb.h>
#ifdef CONFIG_KPROBES
static inline int notify_page_fault(struct pt_regs *regs, int trap) static inline int notify_page_fault(struct pt_regs *regs, int trap)
{ {
int ret = 0; int ret = 0;
#ifdef CONFIG_KPROBES
if (!user_mode(regs)) { if (!user_mode(regs)) {
preempt_disable(); preempt_disable();
if (kprobe_running() && kprobe_fault_handler(regs, trap)) if (kprobe_running() && kprobe_fault_handler(regs, trap))
ret = 1; ret = 1;
preempt_enable(); preempt_enable();
} }
#endif
return ret; return ret;
} }
#else
static inline int notify_page_fault(struct pt_regs *regs, int trap)
{
return 0;
}
#endif
/* /*
* This routine handles page faults. It determines the address, * This routine handles page faults. It determines the address,
...@@ -58,7 +53,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -58,7 +53,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
int fault; int fault;
siginfo_t info; siginfo_t info;
if (notify_page_fault(regs, writeaccess)) if (notify_page_fault(regs, lookup_exception_vector()))
return; return;
#ifdef CONFIG_SH_KGDB #ifdef CONFIG_SH_KGDB
...@@ -293,7 +288,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs, ...@@ -293,7 +288,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
pte_t *pte; pte_t *pte;
pte_t entry; pte_t entry;
if (notify_page_fault(regs, writeaccess)) if (notify_page_fault(regs, lookup_exception_vector()))
return 0; return 0;
#ifdef CONFIG_SH_KGDB #ifdef CONFIG_SH_KGDB
......
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