2 * arch/sh/mm/fault-nommu.c
4 * Copyright (C) 2002 - 2007 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.
11 #include <linux/kernel.h>
13 #include <linux/hardirq.h>
14 #include <linux/kprobes.h>
15 #include <linux/signal.h>
16 #include <asm/system.h>
17 #include <asm/ptrace.h>
21 * This routine handles page faults. It determines the address,
22 * and the problem, and then passes it off to one of the appropriate
25 asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
26 unsigned long writeaccess,
27 unsigned long address)
32 #if defined(CONFIG_SH_KGDB)
33 if (kgdb_nofault && kgdb_bus_err_hook)
38 * Oops. The kernel tried to access some bad page. We'll have to
39 * terminate things with extreme prejudice.
42 if (address < PAGE_SIZE) {
43 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
45 printk(KERN_ALERT "Unable to handle kernel paging request");
48 printk(" at virtual address %08lx\n", address);
49 printk(KERN_ALERT "pc = %08lx\n", regs->pc);
51 die("Oops", regs, writeaccess);
55 asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
56 unsigned long writeaccess,
57 unsigned long address)
59 #if defined(CONFIG_SH_KGDB)
60 if (kgdb_nofault && kgdb_bus_err_hook)
64 return (address >= TASK_SIZE);