traps.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /*
  2. * Main exception handling logic.
  3. *
  4. * Copyright 2004-2010 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later
  7. */
  8. #include <linux/bug.h>
  9. #include <linux/uaccess.h>
  10. #include <linux/module.h>
  11. #include <asm/traps.h>
  12. #include <asm/cplb.h>
  13. #include <asm/blackfin.h>
  14. #include <asm/irq_handler.h>
  15. #include <linux/irq.h>
  16. #include <asm/trace.h>
  17. #include <asm/fixed_code.h>
  18. #ifdef CONFIG_KGDB
  19. # include <linux/kgdb.h>
  20. # define CHK_DEBUGGER_TRAP() \
  21. do { \
  22. kgdb_handle_exception(trapnr, sig, info.si_code, fp); \
  23. } while (0)
  24. # define CHK_DEBUGGER_TRAP_MAYBE() \
  25. do { \
  26. if (kgdb_connected) \
  27. CHK_DEBUGGER_TRAP(); \
  28. } while (0)
  29. #else
  30. # define CHK_DEBUGGER_TRAP() do { } while (0)
  31. # define CHK_DEBUGGER_TRAP_MAYBE() do { } while (0)
  32. #endif
  33. #ifdef CONFIG_DEBUG_VERBOSE
  34. #define verbose_printk(fmt, arg...) \
  35. printk(fmt, ##arg)
  36. #else
  37. #define verbose_printk(fmt, arg...) \
  38. ({ if (0) printk(fmt, ##arg); 0; })
  39. #endif
  40. #if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
  41. u32 last_seqstat;
  42. #ifdef CONFIG_DEBUG_MMRS_MODULE
  43. EXPORT_SYMBOL(last_seqstat);
  44. #endif
  45. #endif
  46. /* Initiate the event table handler */
  47. void __init trap_init(void)
  48. {
  49. CSYNC();
  50. bfin_write_EVT3(trap);
  51. CSYNC();
  52. }
  53. static int kernel_mode_regs(struct pt_regs *regs)
  54. {
  55. return regs->ipend & 0xffc0;
  56. }
  57. asmlinkage notrace void trap_c(struct pt_regs *fp)
  58. {
  59. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
  60. int j;
  61. #endif
  62. unsigned int cpu = raw_smp_processor_id();
  63. const char *strerror = NULL;
  64. int sig = 0;
  65. siginfo_t info;
  66. unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
  67. trace_buffer_save(j);
  68. #if defined(CONFIG_DEBUG_MMRS) || defined(CONFIG_DEBUG_MMRS_MODULE)
  69. last_seqstat = (u32)fp->seqstat;
  70. #endif
  71. /* Important - be very careful dereferncing pointers - will lead to
  72. * double faults if the stack has become corrupt
  73. */
  74. /* trap_c() will be called for exceptions. During exceptions
  75. * processing, the pc value should be set with retx value.
  76. * With this change we can cleanup some code in signal.c- TODO
  77. */
  78. fp->orig_pc = fp->retx;
  79. /* printk("exception: 0x%x, ipend=%x, reti=%x, retx=%x\n",
  80. trapnr, fp->ipend, fp->pc, fp->retx); */
  81. /* send the appropriate signal to the user program */
  82. switch (trapnr) {
  83. /* This table works in conjuction with the one in ./mach-common/entry.S
  84. * Some exceptions are handled there (in assembly, in exception space)
  85. * Some are handled here, (in C, in interrupt space)
  86. * Some, like CPLB, are handled in both, where the normal path is
  87. * handled in assembly/exception space, and the error path is handled
  88. * here
  89. */
  90. /* 0x00 - Linux Syscall, getting here is an error */
  91. /* 0x01 - userspace gdb breakpoint, handled here */
  92. case VEC_EXCPT01:
  93. info.si_code = TRAP_ILLTRAP;
  94. sig = SIGTRAP;
  95. CHK_DEBUGGER_TRAP_MAYBE();
  96. /* Check if this is a breakpoint in kernel space */
  97. if (kernel_mode_regs(fp))
  98. goto traps_done;
  99. else
  100. break;
  101. /* 0x03 - User Defined, userspace stack overflow */
  102. case VEC_EXCPT03:
  103. info.si_code = SEGV_STACKFLOW;
  104. sig = SIGSEGV;
  105. strerror = KERN_NOTICE EXC_0x03(KERN_NOTICE);
  106. CHK_DEBUGGER_TRAP_MAYBE();
  107. break;
  108. /* 0x02 - KGDB initial connection and break signal trap */
  109. case VEC_EXCPT02:
  110. #ifdef CONFIG_KGDB
  111. info.si_code = TRAP_ILLTRAP;
  112. sig = SIGTRAP;
  113. CHK_DEBUGGER_TRAP();
  114. goto traps_done;
  115. #endif
  116. /* 0x04 - User Defined */
  117. /* 0x05 - User Defined */
  118. /* 0x06 - User Defined */
  119. /* 0x07 - User Defined */
  120. /* 0x08 - User Defined */
  121. /* 0x09 - User Defined */
  122. /* 0x0A - User Defined */
  123. /* 0x0B - User Defined */
  124. /* 0x0C - User Defined */
  125. /* 0x0D - User Defined */
  126. /* 0x0E - User Defined */
  127. /* 0x0F - User Defined */
  128. /* If we got here, it is most likely that someone was trying to use a
  129. * custom exception handler, and it is not actually installed properly
  130. */
  131. case VEC_EXCPT04 ... VEC_EXCPT15:
  132. info.si_code = ILL_ILLPARAOP;
  133. sig = SIGILL;
  134. strerror = KERN_NOTICE EXC_0x04(KERN_NOTICE);
  135. CHK_DEBUGGER_TRAP_MAYBE();
  136. break;
  137. /* 0x10 HW Single step, handled here */
  138. case VEC_STEP:
  139. info.si_code = TRAP_STEP;
  140. sig = SIGTRAP;
  141. CHK_DEBUGGER_TRAP_MAYBE();
  142. /* Check if this is a single step in kernel space */
  143. if (kernel_mode_regs(fp))
  144. goto traps_done;
  145. else
  146. break;
  147. /* 0x11 - Trace Buffer Full, handled here */
  148. case VEC_OVFLOW:
  149. info.si_code = TRAP_TRACEFLOW;
  150. sig = SIGTRAP;
  151. strerror = KERN_NOTICE EXC_0x11(KERN_NOTICE);
  152. CHK_DEBUGGER_TRAP_MAYBE();
  153. break;
  154. /* 0x12 - Reserved, Caught by default */
  155. /* 0x13 - Reserved, Caught by default */
  156. /* 0x14 - Reserved, Caught by default */
  157. /* 0x15 - Reserved, Caught by default */
  158. /* 0x16 - Reserved, Caught by default */
  159. /* 0x17 - Reserved, Caught by default */
  160. /* 0x18 - Reserved, Caught by default */
  161. /* 0x19 - Reserved, Caught by default */
  162. /* 0x1A - Reserved, Caught by default */
  163. /* 0x1B - Reserved, Caught by default */
  164. /* 0x1C - Reserved, Caught by default */
  165. /* 0x1D - Reserved, Caught by default */
  166. /* 0x1E - Reserved, Caught by default */
  167. /* 0x1F - Reserved, Caught by default */
  168. /* 0x20 - Reserved, Caught by default */
  169. /* 0x21 - Undefined Instruction, handled here */
  170. case VEC_UNDEF_I:
  171. #ifdef CONFIG_BUG
  172. if (kernel_mode_regs(fp)) {
  173. switch (report_bug(fp->pc, fp)) {
  174. case BUG_TRAP_TYPE_NONE:
  175. break;
  176. case BUG_TRAP_TYPE_WARN:
  177. dump_bfin_trace_buffer();
  178. fp->pc += 2;
  179. goto traps_done;
  180. case BUG_TRAP_TYPE_BUG:
  181. /* call to panic() will dump trace, and it is
  182. * off at this point, so it won't be clobbered
  183. */
  184. panic("BUG()");
  185. }
  186. }
  187. #endif
  188. info.si_code = ILL_ILLOPC;
  189. sig = SIGILL;
  190. strerror = KERN_NOTICE EXC_0x21(KERN_NOTICE);
  191. CHK_DEBUGGER_TRAP_MAYBE();
  192. break;
  193. /* 0x22 - Illegal Instruction Combination, handled here */
  194. case VEC_ILGAL_I:
  195. info.si_code = ILL_ILLPARAOP;
  196. sig = SIGILL;
  197. strerror = KERN_NOTICE EXC_0x22(KERN_NOTICE);
  198. CHK_DEBUGGER_TRAP_MAYBE();
  199. break;
  200. /* 0x23 - Data CPLB protection violation, handled here */
  201. case VEC_CPLB_VL:
  202. info.si_code = ILL_CPLB_VI;
  203. sig = SIGSEGV;
  204. strerror = KERN_NOTICE EXC_0x23(KERN_NOTICE);
  205. CHK_DEBUGGER_TRAP_MAYBE();
  206. break;
  207. /* 0x24 - Data access misaligned, handled here */
  208. case VEC_MISALI_D:
  209. info.si_code = BUS_ADRALN;
  210. sig = SIGBUS;
  211. strerror = KERN_NOTICE EXC_0x24(KERN_NOTICE);
  212. CHK_DEBUGGER_TRAP_MAYBE();
  213. break;
  214. /* 0x25 - Unrecoverable Event, handled here */
  215. case VEC_UNCOV:
  216. info.si_code = ILL_ILLEXCPT;
  217. sig = SIGILL;
  218. strerror = KERN_NOTICE EXC_0x25(KERN_NOTICE);
  219. CHK_DEBUGGER_TRAP_MAYBE();
  220. break;
  221. /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr,
  222. error case is handled here */
  223. case VEC_CPLB_M:
  224. info.si_code = BUS_ADRALN;
  225. sig = SIGBUS;
  226. strerror = KERN_NOTICE EXC_0x26(KERN_NOTICE);
  227. break;
  228. /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */
  229. case VEC_CPLB_MHIT:
  230. info.si_code = ILL_CPLB_MULHIT;
  231. sig = SIGSEGV;
  232. #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
  233. if (cpu_pda[cpu].dcplb_fault_addr < FIXED_CODE_START)
  234. strerror = KERN_NOTICE "NULL pointer access\n";
  235. else
  236. #endif
  237. strerror = KERN_NOTICE EXC_0x27(KERN_NOTICE);
  238. CHK_DEBUGGER_TRAP_MAYBE();
  239. break;
  240. /* 0x28 - Emulation Watchpoint, handled here */
  241. case VEC_WATCH:
  242. info.si_code = TRAP_WATCHPT;
  243. sig = SIGTRAP;
  244. pr_debug(EXC_0x28(KERN_DEBUG));
  245. CHK_DEBUGGER_TRAP_MAYBE();
  246. /* Check if this is a watchpoint in kernel space */
  247. if (kernel_mode_regs(fp))
  248. goto traps_done;
  249. else
  250. break;
  251. #ifdef CONFIG_BF535
  252. /* 0x29 - Instruction fetch access error (535 only) */
  253. case VEC_ISTRU_VL: /* ADSP-BF535 only (MH) */
  254. info.si_code = BUS_OPFETCH;
  255. sig = SIGBUS;
  256. strerror = KERN_NOTICE "BF535: VEC_ISTRU_VL\n";
  257. CHK_DEBUGGER_TRAP_MAYBE();
  258. break;
  259. #else
  260. /* 0x29 - Reserved, Caught by default */
  261. #endif
  262. /* 0x2A - Instruction fetch misaligned, handled here */
  263. case VEC_MISALI_I:
  264. info.si_code = BUS_ADRALN;
  265. sig = SIGBUS;
  266. strerror = KERN_NOTICE EXC_0x2A(KERN_NOTICE);
  267. CHK_DEBUGGER_TRAP_MAYBE();
  268. break;
  269. /* 0x2B - Instruction CPLB protection violation, handled here */
  270. case VEC_CPLB_I_VL:
  271. info.si_code = ILL_CPLB_VI;
  272. sig = SIGBUS;
  273. strerror = KERN_NOTICE EXC_0x2B(KERN_NOTICE);
  274. CHK_DEBUGGER_TRAP_MAYBE();
  275. break;
  276. /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */
  277. case VEC_CPLB_I_M:
  278. info.si_code = ILL_CPLB_MISS;
  279. sig = SIGBUS;
  280. strerror = KERN_NOTICE EXC_0x2C(KERN_NOTICE);
  281. break;
  282. /* 0x2D - Instruction CPLB Multiple Hits, handled here */
  283. case VEC_CPLB_I_MHIT:
  284. info.si_code = ILL_CPLB_MULHIT;
  285. sig = SIGSEGV;
  286. #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
  287. if (cpu_pda[cpu].icplb_fault_addr < FIXED_CODE_START)
  288. strerror = KERN_NOTICE "Jump to NULL address\n";
  289. else
  290. #endif
  291. strerror = KERN_NOTICE EXC_0x2D(KERN_NOTICE);
  292. CHK_DEBUGGER_TRAP_MAYBE();
  293. break;
  294. /* 0x2E - Illegal use of Supervisor Resource, handled here */
  295. case VEC_ILL_RES:
  296. info.si_code = ILL_PRVOPC;
  297. sig = SIGILL;
  298. strerror = KERN_NOTICE EXC_0x2E(KERN_NOTICE);
  299. CHK_DEBUGGER_TRAP_MAYBE();
  300. break;
  301. /* 0x2F - Reserved, Caught by default */
  302. /* 0x30 - Reserved, Caught by default */
  303. /* 0x31 - Reserved, Caught by default */
  304. /* 0x32 - Reserved, Caught by default */
  305. /* 0x33 - Reserved, Caught by default */
  306. /* 0x34 - Reserved, Caught by default */
  307. /* 0x35 - Reserved, Caught by default */
  308. /* 0x36 - Reserved, Caught by default */
  309. /* 0x37 - Reserved, Caught by default */
  310. /* 0x38 - Reserved, Caught by default */
  311. /* 0x39 - Reserved, Caught by default */
  312. /* 0x3A - Reserved, Caught by default */
  313. /* 0x3B - Reserved, Caught by default */
  314. /* 0x3C - Reserved, Caught by default */
  315. /* 0x3D - Reserved, Caught by default */
  316. /* 0x3E - Reserved, Caught by default */
  317. /* 0x3F - Reserved, Caught by default */
  318. case VEC_HWERR:
  319. info.si_code = BUS_ADRALN;
  320. sig = SIGBUS;
  321. switch (fp->seqstat & SEQSTAT_HWERRCAUSE) {
  322. /* System MMR Error */
  323. case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR):
  324. info.si_code = BUS_ADRALN;
  325. sig = SIGBUS;
  326. strerror = KERN_NOTICE HWC_x2(KERN_NOTICE);
  327. break;
  328. /* External Memory Addressing Error */
  329. case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR):
  330. if (ANOMALY_05000310) {
  331. static unsigned long anomaly_rets;
  332. if ((fp->pc >= (L1_CODE_START + L1_CODE_LENGTH - 512)) &&
  333. (fp->pc < (L1_CODE_START + L1_CODE_LENGTH))) {
  334. /*
  335. * A false hardware error will happen while fetching at
  336. * the L1 instruction SRAM boundary. Ignore it.
  337. */
  338. anomaly_rets = fp->rets;
  339. goto traps_done;
  340. } else if (fp->rets == anomaly_rets) {
  341. /*
  342. * While boundary code returns to a function, at the ret
  343. * point, a new false hardware error might occur too based
  344. * on tests. Ignore it too.
  345. */
  346. goto traps_done;
  347. } else if ((fp->rets >= (L1_CODE_START + L1_CODE_LENGTH - 512)) &&
  348. (fp->rets < (L1_CODE_START + L1_CODE_LENGTH))) {
  349. /*
  350. * If boundary code calls a function, at the entry point,
  351. * a new false hardware error maybe happen based on tests.
  352. * Ignore it too.
  353. */
  354. goto traps_done;
  355. } else
  356. anomaly_rets = 0;
  357. }
  358. info.si_code = BUS_ADRERR;
  359. sig = SIGBUS;
  360. strerror = KERN_NOTICE HWC_x3(KERN_NOTICE);
  361. break;
  362. /* Performance Monitor Overflow */
  363. case (SEQSTAT_HWERRCAUSE_PERF_FLOW):
  364. strerror = KERN_NOTICE HWC_x12(KERN_NOTICE);
  365. break;
  366. /* RAISE 5 instruction */
  367. case (SEQSTAT_HWERRCAUSE_RAISE_5):
  368. printk(KERN_NOTICE HWC_x18(KERN_NOTICE));
  369. break;
  370. default: /* Reserved */
  371. printk(KERN_NOTICE HWC_default(KERN_NOTICE));
  372. break;
  373. }
  374. CHK_DEBUGGER_TRAP_MAYBE();
  375. break;
  376. /*
  377. * We should be handling all known exception types above,
  378. * if we get here we hit a reserved one, so panic
  379. */
  380. default:
  381. info.si_code = ILL_ILLPARAOP;
  382. sig = SIGILL;
  383. verbose_printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n",
  384. (fp->seqstat & SEQSTAT_EXCAUSE));
  385. CHK_DEBUGGER_TRAP_MAYBE();
  386. break;
  387. }
  388. BUG_ON(sig == 0);
  389. /* If the fault was caused by a kernel thread, or interrupt handler
  390. * we will kernel panic, so the system reboots.
  391. */
  392. if (kernel_mode_regs(fp) || (current && !current->mm)) {
  393. console_verbose();
  394. oops_in_progress = 1;
  395. }
  396. if (sig != SIGTRAP) {
  397. if (strerror)
  398. verbose_printk(strerror);
  399. dump_bfin_process(fp);
  400. dump_bfin_mem(fp);
  401. show_regs(fp);
  402. /* Print out the trace buffer if it makes sense */
  403. #ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
  404. if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
  405. verbose_printk(KERN_NOTICE "No trace since you do not have "
  406. "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n\n");
  407. else
  408. #endif
  409. dump_bfin_trace_buffer();
  410. if (oops_in_progress) {
  411. /* Dump the current kernel stack */
  412. verbose_printk(KERN_NOTICE "Kernel Stack\n");
  413. show_stack(current, NULL);
  414. print_modules();
  415. #ifndef CONFIG_ACCESS_CHECK
  416. verbose_printk(KERN_EMERG "Please turn on "
  417. "CONFIG_ACCESS_CHECK\n");
  418. #endif
  419. panic("Kernel exception");
  420. } else {
  421. #ifdef CONFIG_DEBUG_VERBOSE
  422. unsigned long *stack;
  423. /* Dump the user space stack */
  424. stack = (unsigned long *)rdusp();
  425. verbose_printk(KERN_NOTICE "Userspace Stack\n");
  426. show_stack(NULL, stack);
  427. #endif
  428. }
  429. }
  430. #ifdef CONFIG_IPIPE
  431. if (!ipipe_trap_notify(fp->seqstat & 0x3f, fp))
  432. #endif
  433. {
  434. info.si_signo = sig;
  435. info.si_errno = 0;
  436. switch (trapnr) {
  437. case VEC_CPLB_VL:
  438. case VEC_MISALI_D:
  439. case VEC_CPLB_M:
  440. case VEC_CPLB_MHIT:
  441. info.si_addr = (void __user *)cpu_pda[cpu].dcplb_fault_addr;
  442. break;
  443. default:
  444. info.si_addr = (void __user *)fp->pc;
  445. break;
  446. }
  447. force_sig_info(sig, &info, current);
  448. }
  449. if ((ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) ||
  450. (ANOMALY_05000281 && trapnr == VEC_HWERR) ||
  451. (ANOMALY_05000189 && (trapnr == VEC_CPLB_I_VL || trapnr == VEC_CPLB_VL)))
  452. fp->pc = SAFE_USER_INSTRUCTION;
  453. traps_done:
  454. trace_buffer_restore(j);
  455. }
  456. asmlinkage void double_fault_c(struct pt_regs *fp)
  457. {
  458. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
  459. int j;
  460. trace_buffer_save(j);
  461. #endif
  462. console_verbose();
  463. oops_in_progress = 1;
  464. #ifdef CONFIG_DEBUG_VERBOSE
  465. printk(KERN_EMERG "Double Fault\n");
  466. #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
  467. if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
  468. unsigned int cpu = raw_smp_processor_id();
  469. char buf[150];
  470. decode_address(buf, cpu_pda[cpu].retx_doublefault);
  471. printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
  472. (unsigned int)cpu_pda[cpu].seqstat_doublefault & SEQSTAT_EXCAUSE, buf);
  473. decode_address(buf, cpu_pda[cpu].dcplb_doublefault_addr);
  474. printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf);
  475. decode_address(buf, cpu_pda[cpu].icplb_doublefault_addr);
  476. printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf);
  477. decode_address(buf, fp->retx);
  478. printk(KERN_NOTICE "The instruction at %s caused a double exception\n", buf);
  479. } else
  480. #endif
  481. {
  482. dump_bfin_process(fp);
  483. dump_bfin_mem(fp);
  484. show_regs(fp);
  485. dump_bfin_trace_buffer();
  486. }
  487. #endif
  488. panic("Double Fault - unrecoverable event");
  489. }
  490. void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
  491. {
  492. switch (cplb_panic) {
  493. case CPLB_NO_UNLOCKED:
  494. printk(KERN_EMERG "All CPLBs are locked\n");
  495. break;
  496. case CPLB_PROT_VIOL:
  497. return;
  498. case CPLB_NO_ADDR_MATCH:
  499. return;
  500. case CPLB_UNKNOWN_ERR:
  501. printk(KERN_EMERG "Unknown CPLB Exception\n");
  502. break;
  503. }
  504. oops_in_progress = 1;
  505. dump_bfin_process(fp);
  506. dump_bfin_mem(fp);
  507. show_regs(fp);
  508. dump_stack();
  509. panic("Unrecoverable event");
  510. }
  511. #ifdef CONFIG_BUG
  512. int is_valid_bugaddr(unsigned long addr)
  513. {
  514. unsigned short opcode;
  515. if (!get_instruction(&opcode, (unsigned short *)addr))
  516. return 0;
  517. return opcode == BFIN_BUG_OPCODE;
  518. }
  519. #endif
  520. /* stub this out */
  521. #ifndef CONFIG_DEBUG_VERBOSE
  522. void show_regs(struct pt_regs *fp)
  523. {
  524. }
  525. #endif