1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/mman.h>
16#include <linux/mm.h>
17#include <linux/kernel.h>
18#include <linux/ptrace.h>
19
20#include <asm/system.h>
21#include <asm/pgtable.h>
22
23
24
25
26
27
28
29
30
31
32
33
34asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
35 unsigned long error_code)
36{
37#ifdef DEBUG
38 printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n",
39 regs->sr, regs->pc, address, error_code);
40#endif
41
42
43
44
45
46 if ((unsigned long) address < PAGE_SIZE) {
47 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
48 } else
49 printk(KERN_ALERT "Unable to handle kernel access");
50 printk(" at virtual address %08lx\n",address);
51 if (!user_mode(regs))
52 die("Oops", regs, error_code);
53 do_exit(SIGKILL);
54
55 return 1;
56}
57
58