aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/mm/fault.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/h8300/mm/fault.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/h8300/mm/fault.c')
-rw-r--r--arch/h8300/mm/fault.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/h8300/mm/fault.c b/arch/h8300/mm/fault.c
new file mode 100644
index 000000000000..29e9af9f0e6a
--- /dev/null
+++ b/arch/h8300/mm/fault.c
@@ -0,0 +1,58 @@
1/*
2 * linux/arch/h8300/mm/fault.c
3 *
4 * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
5 * Copyright (C) 2000 Lineo, Inc. (www.lineo.com)
6 *
7 * Based on:
8 *
9 * linux/arch/m68knommu/mm/fault.c
10 * linux/arch/m68k/mm/fault.c
11 *
12 * Copyright (C) 1995 Hamish Macdonald
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
23extern void die_if_kernel(char *, struct pt_regs *, long);
24
25/*
26 * This routine handles page faults. It determines the problem, and
27 * then passes it off to one of the appropriate routines.
28 *
29 * error_code:
30 * bit 0 == 0 means no page found, 1 means protection fault
31 * bit 1 == 0 means read, 1 means write
32 *
33 * If this routine detects a bad access, it returns 1, otherwise it
34 * returns 0.
35 */
36asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
37 unsigned long error_code)
38{
39#ifdef DEBUG
40 printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n",
41 regs->sr, regs->pc, address, error_code);
42#endif
43
44/*
45 * Oops. The kernel tried to access some bad page. We'll have to
46 * terminate things with extreme prejudice.
47 */
48 if ((unsigned long) address < PAGE_SIZE) {
49 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
50 } else
51 printk(KERN_ALERT "Unable to handle kernel access");
52 printk(" at virtual address %08lx\n",address);
53 die_if_kernel("Oops", regs, error_code);
54 do_exit(SIGKILL);
55
56 return 1;
57}
58