]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/parisc/kernel/traps.c
Pull vector-domain into release branch
[linux-2.6-omap-h63xx.git] / arch / parisc / kernel / traps.c
index 7bf9e36f010d455c156a0f6066407fd8d3ec3e7d..bbf029a184acce9be221def228b2e575160be633 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -64,7 +63,7 @@ static int printbinary(char *buf, unsigned long x, int nbits)
        return nbits;
 }
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 #define RFMT "%016lx"
 #else
 #define RFMT "%08lx"
@@ -255,8 +254,17 @@ KERN_CRIT "                     ||     ||\n");
                printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n",
                        current->comm, current->pid, str, err);
 
-       dump_stack();
+       /* Wot's wrong wif bein' racy? */
+       if (current->thread.flags & PARISC_KERNEL_DEATH) {
+               printk(KERN_CRIT "%s() recursion detected.\n", __FUNCTION__);
+               local_irq_enable();
+               while (1);
+       }
+       current->thread.flags |= PARISC_KERNEL_DEATH;
+
        show_regs(regs);
+       dump_stack();
+       add_taint(TAINT_DIE);
 
        if (in_interrupt())
                panic("Fatal exception in interrupt");
@@ -267,14 +275,6 @@ KERN_CRIT "                     ||     ||\n");
                panic("Fatal exception");
        }
 
-       /* Wot's wrong wif bein' racy? */
-       if (current->thread.flags & PARISC_KERNEL_DEATH) {
-               printk(KERN_CRIT "%s() recursion detected.\n", __FUNCTION__);
-               local_irq_enable();
-               while (1);
-       }
-
-       current->thread.flags |= PARISC_KERNEL_DEATH;
        do_exit(SIGSEGV);
 }
 
@@ -303,7 +303,7 @@ static void handle_break(struct pt_regs *regs)
        if (unlikely(iir == PARISC_BUG_BREAK_INSN && !user_mode(regs))) {
                /* check if a BUG() or WARN() trapped here.  */
                enum bug_trap_type tt;
-               tt = report_bug(regs->iaoq[0] & ~3);
+               tt = report_bug(regs->iaoq[0] & ~3, regs);
                if (tt == BUG_TRAP_TYPE_WARN) {
                        regs->iaoq[0] += 4;
                        regs->iaoq[1] += 4;
@@ -616,7 +616,7 @@ void handle_interruption(int code, struct pt_regs *regs)
                
        case 13:
                /* Conditional Trap
-                  The condition succees in an instruction which traps 
+                  The condition succeeds in an instruction which traps
                   on condition  */
                if(user_mode(regs)){
                        si.si_signo = SIGFPE;
@@ -803,13 +803,14 @@ void handle_interruption(int code, struct pt_regs *regs)
 
 int __init check_ivt(void *iva)
 {
+       extern const u32 os_hpmc[];
+       extern const u32 os_hpmc_end[];
+
        int i;
        u32 check = 0;
        u32 *ivap;
        u32 *hpmcp;
        u32 length;
-       extern void os_hpmc(void);
-       extern void os_hpmc_end(void);
 
        if (strcmp((char *)iva, "cows can fly"))
                return -1;
@@ -821,7 +822,7 @@ int __init check_ivt(void *iva)
 
        /* Compute Checksum for HPMC handler */
 
-       length = (u32)((unsigned long)os_hpmc_end - (unsigned long)os_hpmc);
+       length = os_hpmc_end - os_hpmc;
        ivap[7] = length;
 
        hpmcp = (u32 *)os_hpmc;
@@ -837,7 +838,7 @@ int __init check_ivt(void *iva)
        return 0;
 }
        
-#ifndef __LP64__
+#ifndef CONFIG_64BIT
 extern const void fault_vector_11;
 #endif
 extern const void fault_vector_20;
@@ -849,7 +850,7 @@ void __init trap_init(void)
        if (boot_cpu_data.cpu_type >= pcxu)
                iva = (void *) &fault_vector_20;
        else
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
                panic("Can't boot 64-bit OS on PA1.1 processor!");
 #else
                iva = (void *) &fault_vector_11;