2 * arch/sh/mm/fault-nommu.c
4 * Copyright (C) 2002 Paul Mundt
6 * Based on linux/arch/sh/mm/fault.c:
7 * Copyright (C) 1999 Niibe Yutaka
9 * Released under the terms of the GNU GPL v2.0.
12 #include <linux/signal.h>
13 #include <linux/sched.h>
14 #include <linux/kernel.h>
15 #include <linux/errno.h>
16 #include <linux/string.h>
17 #include <linux/types.h>
18 #include <linux/ptrace.h>
19 #include <linux/mman.h>
21 #include <linux/smp.h>
22 #include <linux/smp_lock.h>
23 #include <linux/interrupt.h>
25 #include <asm/system.h>
27 #include <asm/uaccess.h>
28 #include <asm/pgalloc.h>
29 #include <asm/mmu_context.h>
30 #include <asm/cacheflush.h>
32 #if defined(CONFIG_SH_KGDB)
36 extern void die(const char *,struct pt_regs *,long);
39 * This routine handles page faults. It determines the address,
40 * and the problem, and then passes it off to one of the appropriate
43 asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
44 unsigned long address)
46 #if defined(CONFIG_SH_KGDB)
47 if (kgdb_nofault && kgdb_bus_err_hook)
52 * Oops. The kernel tried to access some bad page. We'll have to
53 * terminate things with extreme prejudice.
56 if (address < PAGE_SIZE) {
57 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
59 printk(KERN_ALERT "Unable to handle kernel paging request");
62 printk(" at virtual address %08lx\n", address);
63 printk(KERN_ALERT "pc = %08lx\n", regs->pc);
65 die("Oops", regs, writeaccess);
69 asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
70 unsigned long address)
72 #if defined(CONFIG_SH_KGDB)
73 if (kgdb_nofault && kgdb_bus_err_hook)
77 if (address >= TASK_SIZE)