aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm/fault.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-17 08:23:04 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-17 08:23:04 -0400
commit5cf4cf65a8ccca44ec9b357ebdb2b517269d7e8a (patch)
treebeba3ecc27c64e0c22b1a21201f1999afe9834f2 /arch/ia64/mm/fault.c
parent55d3ecab2d16be3525ba24a96ba3a67692af1f09 (diff)
parentb2cd64153b94473f6bd82448a68b8e8c041676ea (diff)
Merge branch 'master' of /home/trondmy/repositories/git/linux-2.6/
Diffstat (limited to 'arch/ia64/mm/fault.c')
-rw-r--r--arch/ia64/mm/fault.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 21658e02116c..b87f785c2416 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -19,36 +19,24 @@
19extern void die (char *, struct pt_regs *, long); 19extern void die (char *, struct pt_regs *, long);
20 20
21#ifdef CONFIG_KPROBES 21#ifdef CONFIG_KPROBES
22ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 22static inline int notify_page_fault(struct pt_regs *regs, int trap)
23
24/* Hook to register for page fault notifications */
25int register_page_fault_notifier(struct notifier_block *nb)
26{
27 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
28}
29
30int unregister_page_fault_notifier(struct notifier_block *nb)
31{ 23{
32 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 24 int ret = 0;
33} 25
26 if (!user_mode(regs)) {
27 /* kprobe_running() needs smp_processor_id() */
28 preempt_disable();
29 if (kprobe_running() && kprobes_fault_handler(regs, trap))
30 ret = 1;
31 preempt_enable();
32 }
34 33
35static inline int notify_page_fault(enum die_val val, const char *str, 34 return ret;
36 struct pt_regs *regs, long err, int trap, int sig)
37{
38 struct die_args args = {
39 .regs = regs,
40 .str = str,
41 .err = err,
42 .trapnr = trap,
43 .signr = sig
44 };
45 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
46} 35}
47#else 36#else
48static inline int notify_page_fault(enum die_val val, const char *str, 37static inline int notify_page_fault(struct pt_regs *regs, int trap)
49 struct pt_regs *regs, long err, int trap, int sig)
50{ 38{
51 return NOTIFY_DONE; 39 return 0;
52} 40}
53#endif 41#endif
54 42
@@ -117,8 +105,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
117 /* 105 /*
118 * This is to handle the kprobes on user space access instructions 106 * This is to handle the kprobes on user space access instructions
119 */ 107 */
120 if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, 108 if (notify_page_fault(regs, TRAP_BRKPT))
121 SIGSEGV) == NOTIFY_STOP)
122 return; 109 return;
123 110
124 down_read(&mm->mmap_sem); 111 down_read(&mm->mmap_sem);