diff options
Diffstat (limited to 'arch/sh/mm/fault_32.c')
-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 |