]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
h8300: GENERIC_BUG support
authorYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 16 Oct 2008 05:01:17 +0000 (22:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Oct 2008 18:21:29 +0000 (11:21 -0700)
CONFIG_GENERIC_BUG support.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/h8300/Kconfig
arch/h8300/include/asm/bug.h
arch/h8300/include/asm/system.h
arch/h8300/kernel/module.c
arch/h8300/kernel/traps.c
arch/h8300/mm/fault.c

index 107cb5bb9f39f0b99a3ba2a0841d0a373a19dfbf..c7966746fbfec582938b77a37baaed384d1b0ec2 100644 (file)
@@ -62,6 +62,10 @@ config GENERIC_TIME
        bool
        default y
 
+config GENERIC_BUG
+        bool
+        depends on BUG
+
 config TIME_LOW_RES
        bool
        default y
index edddf5b086e5f447fa2117103015e6714d8a3786..887c19773185d2da7442fb81b5090a0742de571b 100644 (file)
@@ -1,4 +1,8 @@
 #ifndef _H8300_BUG_H
 #define _H8300_BUG_H
+
+/* always true */
+#define is_valid_bugaddr(addr) (1)
+
 #include <asm-generic/bug.h>
 #endif
index 4b8e475908ae0c9eab94c5ac55cb7e2c36216000..d98d97685f068da986c8639bd29953d94a8ceb8d 100644 (file)
@@ -155,4 +155,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 
 #define arch_align_stack(x) (x)
 
+void die(char *str, struct pt_regs *fp, unsigned long err);
+
 #endif /* _H8300_SYSTEM_H */
index 4fd7138a6e03d01217d92517d83fb58f531cd9d1..cfc9127d2cede26312fcaef364a35d6be0c95080 100644 (file)
@@ -114,9 +114,10 @@ int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
 {
-       return 0;
+       return module_bug_finalize(hdr, sechdrs, me);
 }
 
 void module_arch_cleanup(struct module *mod)
 {
+       module_bug_cleanup(mod);
 }
index f8f7d7ea97f17298522e599d22ce4e388cc5009a..3c0b66bc669eca40ced007cccb5d2ce5d6695904 100644 (file)
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/bug.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
 #include <asm/page.h>
-#include <asm/gpio.h>
+
+static DEFINE_SPINLOCK(die_lock);
 
 /*
  * this must be called very early as the kernel might
@@ -94,16 +96,19 @@ static void dump(struct pt_regs *fp)
        printk("\n\n");
 }
 
-void die_if_kernel (char *str, struct pt_regs *fp, int nr)
+void die(char *str, struct pt_regs *fp, unsigned long err)
 {
-       extern int console_loglevel;
+       static int diecount;
 
-       if (!(fp->ccr & PS_S))
-               return;
+       oops_enter();
 
-       console_loglevel = 15;
+       console_verbose();
+       spin_lock_irq(&die_lock);
+       report_bug(fp->pc, fp);
+       printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, ++diecount);
        dump(fp);
 
+       spin_unlock_irq(&die_lock);
        do_exit(SIGSEGV);
 }
 
index 29e9af9f0e6a71942178bb9daff5f997e733060a..1d092abebf03bcfbeabfbe41f67b99cb1260e58e 100644 (file)
@@ -20,8 +20,6 @@
 #include <asm/system.h>
 #include <asm/pgtable.h>
 
-extern void die_if_kernel(char *, struct pt_regs *, long);
-
 /*
  * This routine handles page faults.  It determines the problem, and
  * 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,
        } else
                printk(KERN_ALERT "Unable to handle kernel access");
        printk(" at virtual address %08lx\n",address);
-       die_if_kernel("Oops", regs, error_code);
+       if (!user_mode(regs))
+               die("Oops", regs, error_code);
        do_exit(SIGKILL);
 
        return 1;