aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/h8300/Kconfig4
-rw-r--r--arch/h8300/include/asm/bug.h4
-rw-r--r--arch/h8300/include/asm/system.h2
-rw-r--r--arch/h8300/kernel/module.c3
-rw-r--r--arch/h8300/kernel/traps.c17
-rw-r--r--arch/h8300/mm/fault.c5
6 files changed, 25 insertions, 10 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 107cb5bb9f39..c7966746fbfe 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -62,6 +62,10 @@ config GENERIC_TIME
62 bool 62 bool
63 default y 63 default y
64 64
65config GENERIC_BUG
66 bool
67 depends on BUG
68
65config TIME_LOW_RES 69config TIME_LOW_RES
66 bool 70 bool
67 default y 71 default y
diff --git a/arch/h8300/include/asm/bug.h b/arch/h8300/include/asm/bug.h
index edddf5b086e5..887c19773185 100644
--- a/arch/h8300/include/asm/bug.h
+++ b/arch/h8300/include/asm/bug.h
@@ -1,4 +1,8 @@
1#ifndef _H8300_BUG_H 1#ifndef _H8300_BUG_H
2#define _H8300_BUG_H 2#define _H8300_BUG_H
3
4/* always true */
5#define is_valid_bugaddr(addr) (1)
6
3#include <asm-generic/bug.h> 7#include <asm-generic/bug.h>
4#endif 8#endif
diff --git a/arch/h8300/include/asm/system.h b/arch/h8300/include/asm/system.h
index 4b8e475908ae..d98d97685f06 100644
--- a/arch/h8300/include/asm/system.h
+++ b/arch/h8300/include/asm/system.h
@@ -155,4 +155,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
155 155
156#define arch_align_stack(x) (x) 156#define arch_align_stack(x) (x)
157 157
158void die(char *str, struct pt_regs *fp, unsigned long err);
159
158#endif /* _H8300_SYSTEM_H */ 160#endif /* _H8300_SYSTEM_H */
diff --git a/arch/h8300/kernel/module.c b/arch/h8300/kernel/module.c
index 4fd7138a6e03..cfc9127d2ced 100644
--- a/arch/h8300/kernel/module.c
+++ b/arch/h8300/kernel/module.c
@@ -114,9 +114,10 @@ int module_finalize(const Elf_Ehdr *hdr,
114 const Elf_Shdr *sechdrs, 114 const Elf_Shdr *sechdrs,
115 struct module *me) 115 struct module *me)
116{ 116{
117 return 0; 117 return module_bug_finalize(hdr, sechdrs, me);
118} 118}
119 119
120void module_arch_cleanup(struct module *mod) 120void module_arch_cleanup(struct module *mod)
121{ 121{
122 module_bug_cleanup(mod);
122} 123}
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c
index f8f7d7ea97f1..3c0b66bc669e 100644
--- a/arch/h8300/kernel/traps.c
+++ b/arch/h8300/kernel/traps.c
@@ -20,12 +20,14 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/bug.h>
23 24
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/irq.h> 26#include <asm/irq.h>
26#include <asm/traps.h> 27#include <asm/traps.h>
27#include <asm/page.h> 28#include <asm/page.h>
28#include <asm/gpio.h> 29
30static DEFINE_SPINLOCK(die_lock);
29 31
30/* 32/*
31 * this must be called very early as the kernel might 33 * this must be called very early as the kernel might
@@ -94,16 +96,19 @@ static void dump(struct pt_regs *fp)
94 printk("\n\n"); 96 printk("\n\n");
95} 97}
96 98
97void die_if_kernel (char *str, struct pt_regs *fp, int nr) 99void die(char *str, struct pt_regs *fp, unsigned long err)
98{ 100{
99 extern int console_loglevel; 101 static int diecount;
100 102
101 if (!(fp->ccr & PS_S)) 103 oops_enter();
102 return;
103 104
104 console_loglevel = 15; 105 console_verbose();
106 spin_lock_irq(&die_lock);
107 report_bug(fp->pc, fp);
108 printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, ++diecount);
105 dump(fp); 109 dump(fp);
106 110
111 spin_unlock_irq(&die_lock);
107 do_exit(SIGSEGV); 112 do_exit(SIGSEGV);
108} 113}
109 114
diff --git a/arch/h8300/mm/fault.c b/arch/h8300/mm/fault.c
index 29e9af9f0e6a..1d092abebf03 100644
--- a/arch/h8300/mm/fault.c
+++ b/arch/h8300/mm/fault.c
@@ -20,8 +20,6 @@
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22 22
23extern void die_if_kernel(char *, struct pt_regs *, long);
24
25/* 23/*
26 * This routine handles page faults. It determines the problem, and 24 * This routine handles page faults. It determines the problem, and
27 * then passes it off to one of the appropriate routines. 25 * then passes it off to one of the appropriate routines.
@@ -50,7 +48,8 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
50 } else 48 } else
51 printk(KERN_ALERT "Unable to handle kernel access"); 49 printk(KERN_ALERT "Unable to handle kernel access");
52 printk(" at virtual address %08lx\n",address); 50 printk(" at virtual address %08lx\n",address);
53 die_if_kernel("Oops", regs, error_code); 51 if (!user_mode(regs))
52 die("Oops", regs, error_code);
54 do_exit(SIGKILL); 53 do_exit(SIGKILL);
55 54
56 return 1; 55 return 1;