Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[sfrench/cifs-2.6.git] / arch / blackfin / kernel / traps.c
index 56058b0b6d4a604954938c5f1964e4e58d2f66cc..3909f5b3553679ac1b6215b95e31f856aa34b2dd 100644 (file)
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/kallsyms.h>
 #include <asm/traps.h>
 #include <asm/cacheflush.h>
 #include <asm/blackfin.h>
-#include <asm/uaccess.h>
 #include <asm/irq_handler.h>
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/kallsyms.h>
+#include <asm/trace.h>
 
 #ifdef CONFIG_KGDB
 # include <linux/debugger.h>
@@ -76,7 +76,7 @@ static int printk_address(unsigned long address)
                if (!modname)
                        modname = delim = "";
                return printk("<0x%p> { %s%s%s%s + 0x%lx }",
-                             (void*)address, delim, modname, delim, symname,
+                             (void *)address, delim, modname, delim, symname,
                              (unsigned long)offset);
 
        }
@@ -119,7 +119,7 @@ static int printk_address(unsigned long address)
 
                                write_unlock_irq(&tasklist_lock);
                                return printk("<0x%p> [ %s + 0x%lx ]",
-                                             (void*)address, name, offset);
+                                             (void *)address, name, offset);
                        }
 
                        vml = vml->next;
@@ -128,19 +128,9 @@ static int printk_address(unsigned long address)
        write_unlock_irq(&tasklist_lock);
 
        /* we were unable to find this address anywhere */
-       return printk("[<0x%p>]", (void*)address);
+       return printk("[<0x%p>]", (void *)address);
 }
 
-#define trace_buffer_save(x) \
-       do { \
-               (x) = bfin_read_TBUFCTL(); \
-               bfin_write_TBUFCTL((x) & ~TBUFEN); \
-       } while (0)
-#define trace_buffer_restore(x) \
-       do { \
-               bfin_write_TBUFCTL((x));        \
-       } while (0)
-
 asmlinkage void trap_c(struct pt_regs *fp)
 {
        int j, sig = 0;
@@ -203,15 +193,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
 #else
        /* 0x02 - User Defined, Caught by default */
 #endif
-       /* 0x03  - Atomic test and set */
+       /* 0x03 - User Defined, userspace stack overflow */
        case VEC_EXCPT03:
                info.si_code = SEGV_STACKFLOW;
                sig = SIGSEGV;
                printk(KERN_EMERG EXC_0x03);
                CHK_DEBUGGER_TRAP();
                break;
-       /* 0x04 - spinlock - handled by _ex_spinlock,
-               getting here is an error */
+       /* 0x04 - User Defined, Caught by default */
        /* 0x05 - User Defined, Caught by default */
        /* 0x06 - User Defined, Caught by default */
        /* 0x07 - User Defined, Caught by default */
@@ -547,29 +536,28 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
                printk(KERN_EMERG "TEXT = 0x%p-0x%p  DATA = 0x%p-0x%p\n"
                       KERN_EMERG "BSS = 0x%p-0x%p   USER-STACK = 0x%p\n"
                       KERN_EMERG "\n",
-                      (void*)current->mm->start_code,
-                      (void*)current->mm->end_code,
-                      (void*)current->mm->start_data,
-                      (void*)current->mm->end_data,
-                      (void*)current->mm->end_data,
-                      (void*)current->mm->brk,
-                      (void*)current->mm->start_stack);
+                      (void *)current->mm->start_code,
+                      (void *)current->mm->end_code,
+                      (void *)current->mm->start_data,
+                      (void *)current->mm->end_data,
+                      (void *)current->mm->end_data,
+                      (void *)current->mm->brk,
+                      (void *)current->mm->start_stack);
        }
 
        printk(KERN_EMERG "return address: [0x%p]; contents of:", retaddr);
-       if (retaddr != 0 && retaddr <= (void*)physical_mem_end
+       if (retaddr != 0 && retaddr <= (void *)physical_mem_end
 #if L1_CODE_LENGTH != 0
            /* FIXME: Copy the code out of L1 Instruction SRAM through dma
               memcpy.  */
-           && !(retaddr >= (void*)L1_CODE_START
-                && retaddr < (void*)(L1_CODE_START + L1_CODE_LENGTH))
+           && !(retaddr >= (void *)L1_CODE_START
+                && retaddr < (void *)(L1_CODE_START + L1_CODE_LENGTH))
 #endif
        ) {
                int i = ((unsigned int)retaddr & 0xFFFFFFF0) - 32;
                unsigned short x = 0;
-               for (; i < ((unsigned int)retaddr & 0xFFFFFFF0 ) + 32 ;
-                       i += 2) {
-                       if ( !(i & 0xF) )
+               for (; i < ((unsigned int)retaddr & 0xFFFFFFF0) + 32; i += 2) {
+                       if (!(i & 0xF))
                                printk(KERN_EMERG "\n" KERN_EMERG
                                        "0x%08x: ", i);
 
@@ -588,7 +576,7 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
                                        " The rest of this error"
                                        " is meanless\n");
 #endif
-                       if ( i == (unsigned int)retaddr )
+                       if (i == (unsigned int)retaddr)
                                printk("[%04x]", x);
                        else
                                printk(" %04x ", x);
@@ -681,8 +669,8 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
                break;
        }
 
-       printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
-       printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
+       printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", (void *)bfin_read_DCPLB_FAULT_ADDR());
+       printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", (void *)bfin_read_ICPLB_FAULT_ADDR());
        dump_bfin_regs(fp, (void *)fp->retx);
        dump_stack();
        panic("Unrecoverable event\n");