diff options
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/Makefile | 4 | ||||
-rw-r--r-- | arch/sh/mm/fault-nommu.c | 47 | ||||
-rw-r--r-- | arch/sh/mm/fault.c | 3 |
3 files changed, 19 insertions, 35 deletions
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index d677d7f3afc1..4061e89d84d0 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile | |||
@@ -8,7 +8,9 @@ obj-$(CONFIG_CPU_SH2) += cache-sh2.o | |||
8 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o | 8 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o |
9 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o | 9 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o |
10 | 10 | ||
11 | mmu-y := fault-nommu.o tlb-nommu.o pg-nommu.o | 11 | mmu-y := tlb-nommu.o pg-nommu.o |
12 | mmu-$(CONFIG_CPU_SH3) += fault-nommu.o | ||
13 | mmu-$(CONFIG_CPU_SH4) += fault-nommu.o | ||
12 | mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ | 14 | mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ |
13 | ioremap.o | 15 | ioremap.o |
14 | 16 | ||
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 | |||
35 | extern 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 | */ |
42 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, | 24 | asmlinkage 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 | ||
68 | asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess, | 54 | asmlinkage 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 | |||
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 964c6767dc73..04a39aa7f1f9 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c | |||
@@ -184,8 +184,7 @@ no_context: | |||
184 | printk(KERN_ALERT "pc = %08lx\n", regs->pc); | 184 | printk(KERN_ALERT "pc = %08lx\n", regs->pc); |
185 | page = (unsigned long)get_TTB(); | 185 | page = (unsigned long)get_TTB(); |
186 | if (page) { | 186 | if (page) { |
187 | page = ((__typeof__(page) *) __va(page))[address >> | 187 | page = ((__typeof__(page) *)page)[address >> PGDIR_SHIFT]; |
188 | PGDIR_SHIFT]; | ||
189 | printk(KERN_ALERT "*pde = %08lx\n", page); | 188 | printk(KERN_ALERT "*pde = %08lx\n", page); |
190 | if (page & _PAGE_PRESENT) { | 189 | if (page & _PAGE_PRESENT) { |
191 | page &= PAGE_MASK; | 190 | page &= PAGE_MASK; |