Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77449
b: refs/heads/master
c: 25ce1dd
h: refs/heads/master
i:
  77447: fe15b24
v: v3
  • Loading branch information
Nicolas Pitre authored and Russell King committed Jan 26, 2008
1 parent ab9d998 commit bebf198
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24ba613c9d6cad315f484e658288db152f1dc447
refs/heads/master: 25ce1dd71b8326f2542cf030f68e0e64c3d94dc1
27 changes: 27 additions & 0 deletions trunk/arch/arm/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/signal.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/kprobes.h>

#include <asm/system.h>
#include <asm/pgtable.h>
Expand All @@ -20,6 +21,29 @@

#include "fault.h"


#ifdef CONFIG_KPROBES
static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
{
int ret = 0;

if (!user_mode(regs)) {
/* kprobe_running() needs smp_processor_id() */
preempt_disable();
if (kprobe_running() && kprobe_fault_handler(regs, fsr))
ret = 1;
preempt_enable();
}

return ret;
}
#else
static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
{
return 0;
}
#endif

/*
* This is useful to dump out the page tables associated with
* 'addr' in mm 'mm'.
Expand Down Expand Up @@ -222,6 +246,9 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
struct mm_struct *mm;
int fault, sig, code;

if (notify_page_fault(regs, fsr))
return 0;

tsk = current;
mm = tsk->mm;

Expand Down

0 comments on commit bebf198

Please sign in to comment.