aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-09-26 04:52:35 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:35 -0400
commit474c256841074b913e76e392082373e12103a75d (patch)
tree64f6e504e68b8345b1199898c9b03a80e7becee5 /arch/i386
parent273819a2d982faace30e587b86a0683882251fe7 (diff)
[PATCH] i386: make fault notifier unconditional and export it
It's needed for external debuggers and overhead is very small. Also make the actual notifier chain they use static Cc: jbeulich@novell.com Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/mm/fault.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index f7279468323a..0ce86168a0b1 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -30,18 +30,20 @@
30 30
31extern void die(const char *,struct pt_regs *,long); 31extern void die(const char *,struct pt_regs *,long);
32 32
33#ifdef CONFIG_KPROBES 33static ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
34ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 34
35int register_page_fault_notifier(struct notifier_block *nb) 35int register_page_fault_notifier(struct notifier_block *nb)
36{ 36{
37 vmalloc_sync_all(); 37 vmalloc_sync_all();
38 return atomic_notifier_chain_register(&notify_page_fault_chain, nb); 38 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
39} 39}
40EXPORT_SYMBOL_GPL(register_page_fault_notifier);
40 41
41int unregister_page_fault_notifier(struct notifier_block *nb) 42int unregister_page_fault_notifier(struct notifier_block *nb)
42{ 43{
43 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 44 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb);
44} 45}
46EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
45 47
46static inline int notify_page_fault(enum die_val val, const char *str, 48static inline int notify_page_fault(enum die_val val, const char *str,
47 struct pt_regs *regs, long err, int trap, int sig) 49 struct pt_regs *regs, long err, int trap, int sig)
@@ -55,14 +57,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
55 }; 57 };
56 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); 58 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
57} 59}
58#else
59static inline int notify_page_fault(enum die_val val, const char *str,
60 struct pt_regs *regs, long err, int trap, int sig)
61{
62 return NOTIFY_DONE;
63}
64#endif
65
66 60
67/* 61/*
68 * Unlock any spinlocks which will prevent us from getting the 62 * Unlock any spinlocks which will prevent us from getting the