aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm/fault.c')
-rw-r--r--arch/sh/mm/fault.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 9207da67ff8a..c878faa4ae46 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -15,43 +15,11 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/kdebug.h>
19#include <asm/system.h> 18#include <asm/system.h>
20#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
21#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
22#include <asm/kgdb.h> 21#include <asm/kgdb.h>
23 22
24#ifdef CONFIG_KPROBES
25ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
26
27/* Hook to register for page fault notifications */
28int register_page_fault_notifier(struct notifier_block *nb)
29{
30 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
31}
32
33int unregister_page_fault_notifier(struct notifier_block *nb)
34{
35 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb);
36}
37
38static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,
39 int trap, int sig)
40{
41 struct die_args args = {
42 .regs = regs,
43 .trapnr = trap,
44 };
45 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
46}
47#else
48static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,
49 int trap, int sig)
50{
51 return NOTIFY_DONE;
52}
53#endif
54
55/* 23/*
56 * This routine handles page faults. It determines the address, 24 * This routine handles page faults. It determines the address,
57 * and the problem, and then passes it off to one of the appropriate 25 * and the problem, and then passes it off to one of the appropriate
@@ -69,11 +37,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
69 siginfo_t info; 37 siginfo_t info;
70 38
71 trace_hardirqs_on(); 39 trace_hardirqs_on();
72
73 if (notify_page_fault(DIE_PAGE_FAULT, regs,
74 writeaccess, SIGSEGV) == NOTIFY_STOP)
75 return;
76
77 local_irq_enable(); 40 local_irq_enable();
78 41
79#ifdef CONFIG_SH_KGDB 42#ifdef CONFIG_SH_KGDB
@@ -285,7 +248,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
285 pte_t *pte; 248 pte_t *pte;
286 pte_t entry; 249 pte_t entry;
287 struct mm_struct *mm = current->mm; 250 struct mm_struct *mm = current->mm;
288 spinlock_t *ptl; 251 spinlock_t *ptl = NULL;
289 int ret = 1; 252 int ret = 1;
290 253
291#ifdef CONFIG_SH_KGDB 254#ifdef CONFIG_SH_KGDB