11 #include <linux/module.h>
12 #include <asm/traps.h>
17 #include <asm/trace.h>
25 # define CHK_DEBUGGER_TRAP() \
27 kgdb_handle_exception(trapnr, sig, info.si_code, fp); \
29 # define CHK_DEBUGGER_TRAP_MAYBE() \
32 CHK_DEBUGGER_TRAP(); \
35 # define CHK_DEBUGGER_TRAP() do { } while (0)
36 # define CHK_DEBUGGER_TRAP_MAYBE() do { } while (0)
40 #ifdef CONFIG_DEBUG_VERBOSE
41 #define verbose_printk(fmt, arg...) \
44 #define verbose_printk(fmt, arg...) \
45 ({ if (0) printk(fmt, ##arg); 0; })
48 #if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
50 #ifdef CONFIG_DEBUG_MMRS_MODULE
65 return regs->
ipend & 0xffc0;
70 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
73 #ifdef CONFIG_BFIN_PSEUDODBG_INSNS
83 #if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
117 if (kernel_mode_regs(fp))
163 if (kernel_mode_regs(fp))
192 if (kernel_mode_regs(fp)) {
208 #ifdef CONFIG_BFIN_PSEUDODBG_INSNS
214 if (!kernel_mode_regs(fp) &&
get_instruction(&opcode, (
unsigned short *)fp->
pc)) {
265 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
280 if (kernel_mode_regs(fp))
319 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
364 static unsigned long anomaly_rets;
372 anomaly_rets = fp->
rets;
374 }
else if (fp->
rets == anomaly_rets) {
443 #ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
446 "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n\n");
456 #ifndef CONFIG_ACCESS_CHECK
458 "CONFIG_ACCESS_CHECK\n");
460 panic(
"Kernel exception");
462 #ifdef CONFIG_DEBUG_VERBOSE
463 unsigned long *
stack;
465 stack = (
unsigned long *)rdusp();
486 info.si_addr = (
void __user *)fp->
pc;
503 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
510 #ifdef CONFIG_DEBUG_VERBOSE
512 #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
518 (
unsigned int)
cpu_pda[cpu].seqstat_doublefault & SEQSTAT_EXCAUSE, buf);
535 panic(
"Double Fault - unrecoverable event");
542 switch (cplb_panic) {
561 panic(
"Unrecoverable event");
572 return opcode == BFIN_BUG_OPCODE;
577 #ifndef CONFIG_DEBUG_VERBOSE