aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/fault-nommu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-03 18:07:10 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-03 18:07:10 -0400
commit34bac238cc13cdb57f3b353b6e5ed3eae2cff158 (patch)
tree3fff52deec8671a5599bde9e711f166a7c92d693 /arch/sh/mm/fault-nommu.c
parent247284481ca40288bd120cf0707681c3bdbee78f (diff)
parentcc6f33db30c4fcf7915270619e81a91d6190b6c8 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23: sh: fix defconfigs for sh7751r boards sh: fix cf support on r2d boards sh: update r2d defconfig sh: update snapgear defconfig. sh: Fix SH-X3 FPU exception handling. sh: Fix pgd mismatch from cached TTB in unhandled fault. sh: Don't include fault-nommu on SH-2/SH-2A. sh: Fix irqflags tracing for SH-3/4 nommu. sh: Fix lockdep debugging oops on SH-3/4.
Diffstat (limited to 'arch/sh/mm/fault-nommu.c')
-rw-r--r--arch/sh/mm/fault-nommu.c47
1 files changed, 15 insertions, 32 deletions
diff --git a/arch/sh/mm/fault-nommu.c b/arch/sh/mm/fault-nommu.c
index 923cb456819b..c6f5b51ec2c7 100644
--- a/arch/sh/mm/fault-nommu.c
+++ b/arch/sh/mm/fault-nommu.c
@@ -1,47 +1,33 @@
1/* 1/*
2 * arch/sh/mm/fault-nommu.c 2 * arch/sh/mm/fault-nommu.c
3 * 3 *
4 * Copyright (C) 2002 Paul Mundt 4 * Copyright (C) 2002 - 2007 Paul Mundt
5 * 5 *
6 * Based on linux/arch/sh/mm/fault.c: 6 * Based on linux/arch/sh/mm/fault.c:
7 * Copyright (C) 1999 Niibe Yutaka 7 * Copyright (C) 1999 Niibe Yutaka
8 * 8 *
9 * Released under the terms of the GNU GPL v2.0. 9 * Released under the terms of the GNU GPL v2.0.
10 */ 10 */
11
12#include <linux/signal.h>
13#include <linux/sched.h>
14#include <linux/kernel.h> 11#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>
20#include <linux/mm.h> 12#include <linux/mm.h>
21#include <linux/smp.h> 13#include <linux/hardirq.h>
22#include <linux/interrupt.h> 14#include <linux/kprobes.h>
23
24#include <asm/system.h> 15#include <asm/system.h>
25#include <asm/io.h> 16#include <asm/ptrace.h>
26#include <asm/uaccess.h>
27#include <asm/pgalloc.h>
28#include <asm/mmu_context.h>
29#include <asm/cacheflush.h>
30
31#if defined(CONFIG_SH_KGDB)
32#include <asm/kgdb.h> 17#include <asm/kgdb.h>
33#endif
34
35extern void die(const char *,struct pt_regs *,long);
36 18
37/* 19/*
38 * This routine handles page faults. It determines the address, 20 * This routine handles page faults. It determines the address,
39 * and the problem, and then passes it off to one of the appropriate 21 * and the problem, and then passes it off to one of the appropriate
40 * routines. 22 * routines.
41 */ 23 */
42asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, 24asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
43 unsigned long address) 25 unsigned long writeaccess,
26 unsigned long address)
44{ 27{
28 trace_hardirqs_on();
29 local_irq_enable();
30
45#if defined(CONFIG_SH_KGDB) 31#if defined(CONFIG_SH_KGDB)
46 if (kgdb_nofault && kgdb_bus_err_hook) 32 if (kgdb_nofault && kgdb_bus_err_hook)
47 kgdb_bus_err_hook(); 33 kgdb_bus_err_hook();
@@ -65,17 +51,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
65 do_exit(SIGKILL); 51 do_exit(SIGKILL);
66} 52}
67 53
68asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess, 54asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
69 unsigned long address) 55 unsigned long writeaccess,
56 unsigned long address)
70{ 57{
71#if defined(CONFIG_SH_KGDB) 58#if defined(CONFIG_SH_KGDB)
72 if (kgdb_nofault && kgdb_bus_err_hook) 59 if (kgdb_nofault && kgdb_bus_err_hook)
73 kgdb_bus_err_hook(); 60 kgdb_bus_err_hook();
74#endif 61#endif
75 62
76 if (address >= TASK_SIZE) 63 return (address >= TASK_SIZE);
77 return 1;
78
79 return 0;
80} 64}
81