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/pgtable.h>
21
22
23
24
25
26
27
28
29
30
31
32
33asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
34 unsigned long error_code)
35{
36#ifdef DEBUG
37 printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n",
38 regs->sr, regs->pc, address, error_code);
39#endif
40
41
42
43
44
45 if ((unsigned long) address < PAGE_SIZE) {
46 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
47 } else
48 printk(KERN_ALERT "Unable to handle kernel access");
49 printk(" at virtual address %08lx\n",address);
50 if (!user_mode(regs))
51 die("Oops", regs, error_code);
52 do_exit(SIGKILL);
53
54 return 1;
55}
56
57