diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-09-20 23:06:43 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-20 23:06:43 -0400 |
commit | 887f1ae3bc1701604a7b5ef145e1021072675444 (patch) | |
tree | 79d2e9e0a0fa0dfe838ba06554d1960c82f8789a /arch/sh | |
parent | 4c59e2942e92d2d776bcd038604a5c3c1d56d3ac (diff) |
sh: Look up the trap vector for the page fault notifier.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/mm/fault_32.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c index 659811c179e6..ef01f45daa8a 100644 --- a/arch/sh/mm/fault_32.c +++ b/arch/sh/mm/fault_32.c | |||
@@ -21,26 +21,21 @@ | |||
21 | #include <asm/tlbflush.h> | 21 | #include <asm/tlbflush.h> |
22 | #include <asm/kgdb.h> | 22 | #include <asm/kgdb.h> |
23 | 23 | ||
24 | #ifdef CONFIG_KPROBES | ||
25 | static inline int notify_page_fault(struct pt_regs *regs, int trap) | 24 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
26 | { | 25 | { |
27 | int ret = 0; | 26 | int ret = 0; |
28 | 27 | ||
28 | #ifdef CONFIG_KPROBES | ||
29 | if (!user_mode(regs)) { | 29 | if (!user_mode(regs)) { |
30 | preempt_disable(); | 30 | preempt_disable(); |
31 | if (kprobe_running() && kprobe_fault_handler(regs, trap)) | 31 | if (kprobe_running() && kprobe_fault_handler(regs, trap)) |
32 | ret = 1; | 32 | ret = 1; |
33 | preempt_enable(); | 33 | preempt_enable(); |
34 | } | 34 | } |
35 | #endif | ||
35 | 36 | ||
36 | return ret; | 37 | return ret; |
37 | } | 38 | } |
38 | #else | ||
39 | static inline int notify_page_fault(struct pt_regs *regs, int trap) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | #endif | ||
44 | 39 | ||
45 | /* | 40 | /* |
46 | * This routine handles page faults. It determines the address, | 41 | * This routine handles page faults. It determines the address, |
@@ -58,7 +53,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
58 | int fault; | 53 | int fault; |
59 | siginfo_t info; | 54 | siginfo_t info; |
60 | 55 | ||
61 | if (notify_page_fault(regs, writeaccess)) | 56 | if (notify_page_fault(regs, lookup_exception_vector())) |
62 | return; | 57 | return; |
63 | 58 | ||
64 | #ifdef CONFIG_SH_KGDB | 59 | #ifdef CONFIG_SH_KGDB |
@@ -293,7 +288,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs, | |||
293 | pte_t *pte; | 288 | pte_t *pte; |
294 | pte_t entry; | 289 | pte_t entry; |
295 | 290 | ||
296 | if (notify_page_fault(regs, writeaccess)) | 291 | if (notify_page_fault(regs, lookup_exception_vector())) |
297 | return 0; | 292 | return 0; |
298 | 293 | ||
299 | #ifdef CONFIG_SH_KGDB | 294 | #ifdef CONFIG_SH_KGDB |