diff options
author | Linus Torvalds | 2007-05-17 06:20:28 +0200 |
---|---|---|
committer | Linus Torvalds | 2007-05-17 06:20:28 +0200 |
commit | 36dbe4d6bffb90fcb2663ac50af00a942412e246 (patch) | |
tree | 4d24a2165620fa8fad0454299a8f5412555bba61 /arch/avr32/mm | |
parent | Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
parent | [AVR32] Implement platform hooks for atmel_lcdfb driver (diff) | |
download | kernel-qcow2-linux-36dbe4d6bffb90fcb2663ac50af00a942412e246.tar.gz kernel-qcow2-linux-36dbe4d6bffb90fcb2663ac50af00a942412e246.tar.xz kernel-qcow2-linux-36dbe4d6bffb90fcb2663ac50af00a942412e246.zip |
Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32
* 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32:
[AVR32] Implement platform hooks for atmel_lcdfb driver
[AVR32] Wire up signalfd, timerfd and eventfd
[AVR32] optimize pagefault path
[AVR32] Remove bogus comment in arch/avr32/kernel/irq.c
Diffstat (limited to 'arch/avr32/mm')
-rw-r--r-- | arch/avr32/mm/fault.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c index 88b00b15970f..e011f1ce1875 100644 --- a/arch/avr32/mm/fault.c +++ b/arch/avr32/mm/fault.c @@ -12,41 +12,30 @@ #include <linux/mm.h> #include <linux/module.h> #include <linux/pagemap.h> - #include <linux/kdebug.h> +#include <linux/kprobes.h> + #include <asm/mmu_context.h> #include <asm/sysreg.h> #include <asm/tlb.h> #include <asm/uaccess.h> #ifdef CONFIG_KPROBES -ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); - -/* Hook to register for page fault notifications */ -int register_page_fault_notifier(struct notifier_block *nb) +static inline int notify_page_fault(struct pt_regs *regs, int trap) { - return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); -} + int ret = 0; -int unregister_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); -} + if (!user_mode(regs)) { + if (kprobe_running() && kprobe_fault_handler(regs, trap)) + ret = 1; + } -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .trapnr = trap, - }; - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args); + return ret; } #else -static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, - int trap, int sig) +static inline int notify_page_fault(struct pt_regs *regs, int trap) { - return NOTIFY_DONE; + return 0; } #endif @@ -76,8 +65,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs) long signr; int code; - if (notify_page_fault(DIE_PAGE_FAULT, regs, - ecr, SIGSEGV) == NOTIFY_STOP) + if (notify_page_fault(regs, ecr)) return; address = sysreg_read(TLBEAR); |