traps.c 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  1. /*
  2. * File: arch/blackfin/kernel/traps.c
  3. * Based on:
  4. * Author: Hamish Macdonald
  5. *
  6. * Created:
  7. * Description: uses S/W interrupt 15 for the system calls
  8. *
  9. * Modified:
  10. * Copyright 2004-2006 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <linux/uaccess.h>
  30. #include <linux/interrupt.h>
  31. #include <linux/module.h>
  32. #include <linux/kallsyms.h>
  33. #include <linux/fs.h>
  34. #include <asm/traps.h>
  35. #include <asm/cacheflush.h>
  36. #include <asm/blackfin.h>
  37. #include <asm/irq_handler.h>
  38. #include <linux/irq.h>
  39. #include <asm/trace.h>
  40. #include <asm/fixed_code.h>
  41. #include <asm/dma.h>
  42. #ifdef CONFIG_KGDB
  43. # include <linux/debugger.h>
  44. # include <linux/kgdb.h>
  45. # define CHK_DEBUGGER_TRAP() \
  46. do { \
  47. CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \
  48. } while (0)
  49. # define CHK_DEBUGGER_TRAP_MAYBE() \
  50. do { \
  51. if (kgdb_connected) \
  52. CHK_DEBUGGER_TRAP(); \
  53. } while (0)
  54. #else
  55. # define CHK_DEBUGGER_TRAP() do { } while (0)
  56. # define CHK_DEBUGGER_TRAP_MAYBE() do { } while (0)
  57. #endif
  58. /* Initiate the event table handler */
  59. void __init trap_init(void)
  60. {
  61. CSYNC();
  62. bfin_write_EVT3(trap);
  63. CSYNC();
  64. }
  65. unsigned long saved_icplb_fault_addr, saved_dcplb_fault_addr;
  66. static void decode_address(char *buf, unsigned long address)
  67. {
  68. struct vm_list_struct *vml;
  69. struct task_struct *p;
  70. struct mm_struct *mm;
  71. unsigned long flags, offset;
  72. unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
  73. #ifdef CONFIG_KALLSYMS
  74. unsigned long symsize;
  75. const char *symname;
  76. char *modname;
  77. char *delim = ":";
  78. char namebuf[128];
  79. /* look up the address and see if we are in kernel space */
  80. symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);
  81. if (symname) {
  82. /* yeah! kernel space! */
  83. if (!modname)
  84. modname = delim = "";
  85. sprintf(buf, "<0x%p> { %s%s%s%s + 0x%lx }",
  86. (void *)address, delim, modname, delim, symname,
  87. (unsigned long)offset);
  88. return;
  89. }
  90. #endif
  91. /* Problem in fixed code section? */
  92. if (address >= FIXED_CODE_START && address < FIXED_CODE_END) {
  93. sprintf(buf, "<0x%p> /* Maybe fixed code section */", (void *)address);
  94. return;
  95. }
  96. /* Problem somewhere before the kernel start address */
  97. if (address < CONFIG_BOOT_LOAD) {
  98. sprintf(buf, "<0x%p> /* Maybe null pointer? */", (void *)address);
  99. return;
  100. }
  101. /* looks like we're off in user-land, so let's walk all the
  102. * mappings of all our processes and see if we can't be a whee
  103. * bit more specific
  104. */
  105. write_lock_irqsave(&tasklist_lock, flags);
  106. for_each_process(p) {
  107. mm = (in_atomic ? p->mm : get_task_mm(p));
  108. if (!mm)
  109. continue;
  110. vml = mm->context.vmlist;
  111. while (vml) {
  112. struct vm_area_struct *vma = vml->vma;
  113. if (address >= vma->vm_start && address < vma->vm_end) {
  114. char _tmpbuf[256];
  115. char *name = p->comm;
  116. struct file *file = vma->vm_file;
  117. if (file)
  118. name = d_path(&file->f_path, _tmpbuf,
  119. sizeof(_tmpbuf));
  120. /* FLAT does not have its text aligned to the start of
  121. * the map while FDPIC ELF does ...
  122. */
  123. /* before we can check flat/fdpic, we need to
  124. * make sure current is valid
  125. */
  126. if ((unsigned long)current >= FIXED_CODE_START &&
  127. !((unsigned long)current & 0x3)) {
  128. if (current->mm &&
  129. (address > current->mm->start_code) &&
  130. (address < current->mm->end_code))
  131. offset = address - current->mm->start_code;
  132. else
  133. offset = (address - vma->vm_start) +
  134. (vma->vm_pgoff << PAGE_SHIFT);
  135. sprintf(buf, "<0x%p> [ %s + 0x%lx ]",
  136. (void *)address, name, offset);
  137. } else
  138. sprintf(buf, "<0x%p> [ %s vma:0x%lx-0x%lx]",
  139. (void *)address, name,
  140. vma->vm_start, vma->vm_end);
  141. if (!in_atomic)
  142. mmput(mm);
  143. if (!strlen(buf))
  144. sprintf(buf, "<0x%p> [ %s ] dynamic memory", (void *)address, name);
  145. goto done;
  146. }
  147. vml = vml->next;
  148. }
  149. if (!in_atomic)
  150. mmput(mm);
  151. }
  152. /* we were unable to find this address anywhere */
  153. sprintf(buf, "<0x%p> /* kernel dynamic memory */", (void *)address);
  154. done:
  155. write_unlock_irqrestore(&tasklist_lock, flags);
  156. }
  157. asmlinkage void double_fault_c(struct pt_regs *fp)
  158. {
  159. console_verbose();
  160. oops_in_progress = 1;
  161. printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
  162. dump_bfin_process(fp);
  163. dump_bfin_mem(fp);
  164. show_regs(fp);
  165. panic("Double Fault - unrecoverable event\n");
  166. }
  167. asmlinkage void trap_c(struct pt_regs *fp)
  168. {
  169. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
  170. int j;
  171. #endif
  172. int sig = 0;
  173. siginfo_t info;
  174. unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
  175. trace_buffer_save(j);
  176. /* Important - be very careful dereferncing pointers - will lead to
  177. * double faults if the stack has become corrupt
  178. */
  179. /* If the fault was caused by a kernel thread, or interrupt handler
  180. * we will kernel panic, so the system reboots.
  181. * If KGDB is enabled, don't set this for kernel breakpoints
  182. */
  183. /* TODO: check to see if we are in some sort of deferred HWERR
  184. * that we should be able to recover from, not kernel panic
  185. */
  186. if ((bfin_read_IPEND() & 0xFFC0) && (trapnr != VEC_STEP)
  187. #ifdef CONFIG_KGDB
  188. && (trapnr != VEC_EXCPT02)
  189. #endif
  190. ){
  191. console_verbose();
  192. oops_in_progress = 1;
  193. } else if (current) {
  194. if (current->mm == NULL) {
  195. console_verbose();
  196. oops_in_progress = 1;
  197. }
  198. }
  199. /* trap_c() will be called for exceptions. During exceptions
  200. * processing, the pc value should be set with retx value.
  201. * With this change we can cleanup some code in signal.c- TODO
  202. */
  203. fp->orig_pc = fp->retx;
  204. /* printk("exception: 0x%x, ipend=%x, reti=%x, retx=%x\n",
  205. trapnr, fp->ipend, fp->pc, fp->retx); */
  206. /* send the appropriate signal to the user program */
  207. switch (trapnr) {
  208. /* This table works in conjuction with the one in ./mach-common/entry.S
  209. * Some exceptions are handled there (in assembly, in exception space)
  210. * Some are handled here, (in C, in interrupt space)
  211. * Some, like CPLB, are handled in both, where the normal path is
  212. * handled in assembly/exception space, and the error path is handled
  213. * here
  214. */
  215. /* 0x00 - Linux Syscall, getting here is an error */
  216. /* 0x01 - userspace gdb breakpoint, handled here */
  217. case VEC_EXCPT01:
  218. info.si_code = TRAP_ILLTRAP;
  219. sig = SIGTRAP;
  220. CHK_DEBUGGER_TRAP_MAYBE();
  221. /* Check if this is a breakpoint in kernel space */
  222. if (fp->ipend & 0xffc0)
  223. return;
  224. else
  225. break;
  226. #ifdef CONFIG_KGDB
  227. case VEC_EXCPT02 : /* gdb connection */
  228. info.si_code = TRAP_ILLTRAP;
  229. sig = SIGTRAP;
  230. CHK_DEBUGGER_TRAP();
  231. return;
  232. #else
  233. /* 0x02 - User Defined, Caught by default */
  234. #endif
  235. /* 0x03 - User Defined, userspace stack overflow */
  236. case VEC_EXCPT03:
  237. info.si_code = SEGV_STACKFLOW;
  238. sig = SIGSEGV;
  239. printk(KERN_NOTICE EXC_0x03(KERN_NOTICE));
  240. CHK_DEBUGGER_TRAP();
  241. break;
  242. /* 0x04 - User Defined, Caught by default */
  243. /* 0x05 - User Defined, Caught by default */
  244. /* 0x06 - User Defined, Caught by default */
  245. /* 0x07 - User Defined, Caught by default */
  246. /* 0x08 - User Defined, Caught by default */
  247. /* 0x09 - User Defined, Caught by default */
  248. /* 0x0A - User Defined, Caught by default */
  249. /* 0x0B - User Defined, Caught by default */
  250. /* 0x0C - User Defined, Caught by default */
  251. /* 0x0D - User Defined, Caught by default */
  252. /* 0x0E - User Defined, Caught by default */
  253. /* 0x0F - User Defined, Caught by default */
  254. /* 0x10 HW Single step, handled here */
  255. case VEC_STEP:
  256. info.si_code = TRAP_STEP;
  257. sig = SIGTRAP;
  258. CHK_DEBUGGER_TRAP_MAYBE();
  259. /* Check if this is a single step in kernel space */
  260. if (fp->ipend & 0xffc0)
  261. return;
  262. else
  263. break;
  264. /* 0x11 - Trace Buffer Full, handled here */
  265. case VEC_OVFLOW:
  266. info.si_code = TRAP_TRACEFLOW;
  267. sig = SIGTRAP;
  268. printk(KERN_NOTICE EXC_0x11(KERN_NOTICE));
  269. CHK_DEBUGGER_TRAP();
  270. break;
  271. /* 0x12 - Reserved, Caught by default */
  272. /* 0x13 - Reserved, Caught by default */
  273. /* 0x14 - Reserved, Caught by default */
  274. /* 0x15 - Reserved, Caught by default */
  275. /* 0x16 - Reserved, Caught by default */
  276. /* 0x17 - Reserved, Caught by default */
  277. /* 0x18 - Reserved, Caught by default */
  278. /* 0x19 - Reserved, Caught by default */
  279. /* 0x1A - Reserved, Caught by default */
  280. /* 0x1B - Reserved, Caught by default */
  281. /* 0x1C - Reserved, Caught by default */
  282. /* 0x1D - Reserved, Caught by default */
  283. /* 0x1E - Reserved, Caught by default */
  284. /* 0x1F - Reserved, Caught by default */
  285. /* 0x20 - Reserved, Caught by default */
  286. /* 0x21 - Undefined Instruction, handled here */
  287. case VEC_UNDEF_I:
  288. info.si_code = ILL_ILLOPC;
  289. sig = SIGILL;
  290. printk(KERN_NOTICE EXC_0x21(KERN_NOTICE));
  291. CHK_DEBUGGER_TRAP();
  292. break;
  293. /* 0x22 - Illegal Instruction Combination, handled here */
  294. case VEC_ILGAL_I:
  295. info.si_code = ILL_ILLPARAOP;
  296. sig = SIGILL;
  297. printk(KERN_NOTICE EXC_0x22(KERN_NOTICE));
  298. CHK_DEBUGGER_TRAP();
  299. break;
  300. /* 0x23 - Data CPLB protection violation, handled here */
  301. case VEC_CPLB_VL:
  302. info.si_code = ILL_CPLB_VI;
  303. sig = SIGBUS;
  304. printk(KERN_NOTICE EXC_0x23(KERN_NOTICE));
  305. CHK_DEBUGGER_TRAP();
  306. break;
  307. /* 0x24 - Data access misaligned, handled here */
  308. case VEC_MISALI_D:
  309. info.si_code = BUS_ADRALN;
  310. sig = SIGBUS;
  311. printk(KERN_NOTICE EXC_0x24(KERN_NOTICE));
  312. CHK_DEBUGGER_TRAP();
  313. break;
  314. /* 0x25 - Unrecoverable Event, handled here */
  315. case VEC_UNCOV:
  316. info.si_code = ILL_ILLEXCPT;
  317. sig = SIGILL;
  318. printk(KERN_NOTICE EXC_0x25(KERN_NOTICE));
  319. CHK_DEBUGGER_TRAP();
  320. break;
  321. /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr,
  322. error case is handled here */
  323. case VEC_CPLB_M:
  324. info.si_code = BUS_ADRALN;
  325. sig = SIGBUS;
  326. printk(KERN_NOTICE EXC_0x26(KERN_NOTICE));
  327. CHK_DEBUGGER_TRAP();
  328. break;
  329. /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */
  330. case VEC_CPLB_MHIT:
  331. info.si_code = ILL_CPLB_MULHIT;
  332. sig = SIGSEGV;
  333. #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
  334. if (saved_dcplb_fault_addr < FIXED_CODE_START)
  335. printk(KERN_NOTICE "NULL pointer access\n");
  336. else
  337. #endif
  338. printk(KERN_NOTICE EXC_0x27(KERN_NOTICE));
  339. CHK_DEBUGGER_TRAP();
  340. break;
  341. /* 0x28 - Emulation Watchpoint, handled here */
  342. case VEC_WATCH:
  343. info.si_code = TRAP_WATCHPT;
  344. sig = SIGTRAP;
  345. pr_debug(EXC_0x28(KERN_DEBUG));
  346. CHK_DEBUGGER_TRAP_MAYBE();
  347. /* Check if this is a watchpoint in kernel space */
  348. if (fp->ipend & 0xffc0)
  349. return;
  350. else
  351. break;
  352. #ifdef CONFIG_BF535
  353. /* 0x29 - Instruction fetch access error (535 only) */
  354. case VEC_ISTRU_VL: /* ADSP-BF535 only (MH) */
  355. info.si_code = BUS_OPFETCH;
  356. sig = SIGBUS;
  357. printk(KERN_NOTICE "BF535: VEC_ISTRU_VL\n");
  358. CHK_DEBUGGER_TRAP();
  359. break;
  360. #else
  361. /* 0x29 - Reserved, Caught by default */
  362. #endif
  363. /* 0x2A - Instruction fetch misaligned, handled here */
  364. case VEC_MISALI_I:
  365. info.si_code = BUS_ADRALN;
  366. sig = SIGBUS;
  367. printk(KERN_NOTICE EXC_0x2A(KERN_NOTICE));
  368. CHK_DEBUGGER_TRAP();
  369. break;
  370. /* 0x2B - Instruction CPLB protection violation, handled here */
  371. case VEC_CPLB_I_VL:
  372. info.si_code = ILL_CPLB_VI;
  373. sig = SIGBUS;
  374. printk(KERN_NOTICE EXC_0x2B(KERN_NOTICE));
  375. CHK_DEBUGGER_TRAP();
  376. break;
  377. /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */
  378. case VEC_CPLB_I_M:
  379. info.si_code = ILL_CPLB_MISS;
  380. sig = SIGBUS;
  381. printk(KERN_NOTICE EXC_0x2C(KERN_NOTICE));
  382. CHK_DEBUGGER_TRAP();
  383. break;
  384. /* 0x2D - Instruction CPLB Multiple Hits, handled here */
  385. case VEC_CPLB_I_MHIT:
  386. info.si_code = ILL_CPLB_MULHIT;
  387. sig = SIGSEGV;
  388. #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
  389. if (saved_icplb_fault_addr < FIXED_CODE_START)
  390. printk(KERN_NOTICE "Jump to NULL address\n");
  391. else
  392. #endif
  393. printk(KERN_NOTICE EXC_0x2D(KERN_NOTICE));
  394. CHK_DEBUGGER_TRAP();
  395. break;
  396. /* 0x2E - Illegal use of Supervisor Resource, handled here */
  397. case VEC_ILL_RES:
  398. info.si_code = ILL_PRVOPC;
  399. sig = SIGILL;
  400. printk(KERN_NOTICE EXC_0x2E(KERN_NOTICE));
  401. CHK_DEBUGGER_TRAP();
  402. break;
  403. /* 0x2F - Reserved, Caught by default */
  404. /* 0x30 - Reserved, Caught by default */
  405. /* 0x31 - Reserved, Caught by default */
  406. /* 0x32 - Reserved, Caught by default */
  407. /* 0x33 - Reserved, Caught by default */
  408. /* 0x34 - Reserved, Caught by default */
  409. /* 0x35 - Reserved, Caught by default */
  410. /* 0x36 - Reserved, Caught by default */
  411. /* 0x37 - Reserved, Caught by default */
  412. /* 0x38 - Reserved, Caught by default */
  413. /* 0x39 - Reserved, Caught by default */
  414. /* 0x3A - Reserved, Caught by default */
  415. /* 0x3B - Reserved, Caught by default */
  416. /* 0x3C - Reserved, Caught by default */
  417. /* 0x3D - Reserved, Caught by default */
  418. /* 0x3E - Reserved, Caught by default */
  419. /* 0x3F - Reserved, Caught by default */
  420. case VEC_HWERR:
  421. info.si_code = BUS_ADRALN;
  422. sig = SIGBUS;
  423. switch (fp->seqstat & SEQSTAT_HWERRCAUSE) {
  424. /* System MMR Error */
  425. case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR):
  426. info.si_code = BUS_ADRALN;
  427. sig = SIGBUS;
  428. printk(KERN_NOTICE HWC_x2(KERN_NOTICE));
  429. break;
  430. /* External Memory Addressing Error */
  431. case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR):
  432. info.si_code = BUS_ADRERR;
  433. sig = SIGBUS;
  434. printk(KERN_NOTICE HWC_x3(KERN_NOTICE));
  435. break;
  436. /* Performance Monitor Overflow */
  437. case (SEQSTAT_HWERRCAUSE_PERF_FLOW):
  438. printk(KERN_NOTICE HWC_x12(KERN_NOTICE));
  439. break;
  440. /* RAISE 5 instruction */
  441. case (SEQSTAT_HWERRCAUSE_RAISE_5):
  442. printk(KERN_NOTICE HWC_x18(KERN_NOTICE));
  443. break;
  444. default: /* Reserved */
  445. printk(KERN_NOTICE HWC_default(KERN_NOTICE));
  446. break;
  447. }
  448. CHK_DEBUGGER_TRAP();
  449. break;
  450. default:
  451. info.si_code = TRAP_ILLTRAP;
  452. sig = SIGTRAP;
  453. printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n",
  454. (fp->seqstat & SEQSTAT_EXCAUSE));
  455. CHK_DEBUGGER_TRAP();
  456. break;
  457. }
  458. BUG_ON(sig == 0);
  459. if (sig != SIGTRAP) {
  460. unsigned long *stack;
  461. dump_bfin_process(fp);
  462. dump_bfin_mem(fp);
  463. show_regs(fp);
  464. /* Print out the trace buffer if it makes sense */
  465. #ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
  466. if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
  467. printk(KERN_NOTICE "No trace since you do not have "
  468. "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n"
  469. KERN_NOTICE "\n");
  470. else
  471. #endif
  472. dump_bfin_trace_buffer();
  473. if (oops_in_progress) {
  474. /* Dump the current kernel stack */
  475. printk(KERN_NOTICE "\n" KERN_NOTICE "Kernel Stack\n");
  476. show_stack(current, NULL);
  477. print_modules();
  478. #ifndef CONFIG_ACCESS_CHECK
  479. printk(KERN_EMERG "Please turn on "
  480. "CONFIG_ACCESS_CHECK\n");
  481. #endif
  482. panic("Kernel exception");
  483. } else {
  484. /* Dump the user space stack */
  485. stack = (unsigned long *)rdusp();
  486. printk(KERN_NOTICE "Userspace Stack\n");
  487. show_stack(NULL, stack);
  488. }
  489. }
  490. info.si_signo = sig;
  491. info.si_errno = 0;
  492. info.si_addr = (void __user *)fp->pc;
  493. force_sig_info(sig, &info, current);
  494. trace_buffer_restore(j);
  495. return;
  496. }
  497. /* Typical exception handling routines */
  498. #define EXPAND_LEN ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 256 - 1)
  499. /*
  500. * Similar to get_user, do some address checking, then dereference
  501. * Return true on sucess, false on bad address
  502. */
  503. bool get_instruction(unsigned short *val, unsigned short *address)
  504. {
  505. unsigned long addr;
  506. addr = (unsigned long)address;
  507. /* Check for odd addresses */
  508. if (addr & 0x1)
  509. return false;
  510. /* Check that things do not wrap around */
  511. if (addr > (addr + 2))
  512. return false;
  513. /*
  514. * Since we are in exception context, we need to do a little address checking
  515. * We need to make sure we are only accessing valid memory, and
  516. * we don't read something in the async space that can hang forever
  517. */
  518. if ((addr >= FIXED_CODE_START && (addr + 2) <= physical_mem_end) ||
  519. #ifdef L2_START
  520. (addr >= L2_START && (addr + 2) <= (L2_START + L2_LENGTH)) ||
  521. #endif
  522. (addr >= BOOT_ROM_START && (addr + 2) <= (BOOT_ROM_START + BOOT_ROM_LENGTH)) ||
  523. #if L1_DATA_A_LENGTH != 0
  524. (addr >= L1_DATA_A_START && (addr + 2) <= (L1_DATA_A_START + L1_DATA_A_LENGTH)) ||
  525. #endif
  526. #if L1_DATA_B_LENGTH != 0
  527. (addr >= L1_DATA_B_START && (addr + 2) <= (L1_DATA_B_START + L1_DATA_B_LENGTH)) ||
  528. #endif
  529. (addr >= L1_SCRATCH_START && (addr + 2) <= (L1_SCRATCH_START + L1_SCRATCH_LENGTH)) ||
  530. (!(bfin_read_EBIU_AMBCTL0() & B0RDYEN) &&
  531. addr >= ASYNC_BANK0_BASE && (addr + 2) <= (ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE)) ||
  532. (!(bfin_read_EBIU_AMBCTL0() & B1RDYEN) &&
  533. addr >= ASYNC_BANK1_BASE && (addr + 2) <= (ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE)) ||
  534. (!(bfin_read_EBIU_AMBCTL1() & B2RDYEN) &&
  535. addr >= ASYNC_BANK2_BASE && (addr + 2) <= (ASYNC_BANK2_BASE + ASYNC_BANK1_SIZE)) ||
  536. (!(bfin_read_EBIU_AMBCTL1() & B3RDYEN) &&
  537. addr >= ASYNC_BANK3_BASE && (addr + 2) <= (ASYNC_BANK3_BASE + ASYNC_BANK1_SIZE))) {
  538. *val = *address;
  539. return true;
  540. }
  541. #if L1_CODE_LENGTH != 0
  542. if (addr >= L1_CODE_START && (addr + 2) <= (L1_CODE_START + L1_CODE_LENGTH)) {
  543. dma_memcpy(val, address, 2);
  544. return true;
  545. }
  546. #endif
  547. return false;
  548. }
  549. void dump_bfin_trace_buffer(void)
  550. {
  551. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
  552. int tflags, i = 0;
  553. char buf[150];
  554. unsigned short val = 0, *addr;
  555. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  556. int j, index;
  557. #endif
  558. trace_buffer_save(tflags);
  559. printk(KERN_NOTICE "Hardware Trace:\n");
  560. if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
  561. for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
  562. decode_address(buf, (unsigned long)bfin_read_TBUF());
  563. printk(KERN_NOTICE "%4i Target : %s\n", i, buf);
  564. addr = (unsigned short *)bfin_read_TBUF();
  565. decode_address(buf, (unsigned long)addr);
  566. printk(KERN_NOTICE " Source : %s ", buf);
  567. if (get_instruction(&val, addr)) {
  568. if (val == 0x0010)
  569. printk("RTS");
  570. else if (val == 0x0011)
  571. printk("RTI");
  572. else if (val == 0x0012)
  573. printk("RTX");
  574. else if (val >= 0x0050 && val <= 0x0057)
  575. printk("JUMP (P%i)", val & 7);
  576. else if (val >= 0x0060 && val <= 0x0067)
  577. printk("CALL (P%i)", val & 7);
  578. else if (val >= 0x0070 && val <= 0x0077)
  579. printk("CALL (PC+P%i)", val & 7);
  580. else if (val >= 0x0080 && val <= 0x0087)
  581. printk("JUMP (PC+P%i)", val & 7);
  582. else if ((val >= 0x1000 && val <= 0x13FF) ||
  583. (val >= 0x1800 && val <= 0x1BFF))
  584. printk("IF !CC JUMP");
  585. else if ((val >= 0x1400 && val <= 0x17ff) ||
  586. (val >= 0x1c00 && val <= 0x1fff))
  587. printk("IF CC JUMP");
  588. else if (val >= 0x2000 && val <= 0x2fff)
  589. printk("JUMP.S");
  590. else if (val >= 0xe080 && val <= 0xe0ff)
  591. printk("LSETUP");
  592. else if (val >= 0xe200 && val <= 0xe2ff)
  593. printk("JUMP.L");
  594. else if (val >= 0xe300 && val <= 0xe3ff)
  595. printk("CALL pcrel");
  596. else
  597. printk("0x%04x", val);
  598. }
  599. printk("\n");
  600. }
  601. }
  602. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
  603. if (trace_buff_offset)
  604. index = trace_buff_offset/4 - 1;
  605. else
  606. index = EXPAND_LEN;
  607. j = (1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 128;
  608. while (j) {
  609. decode_address(buf, software_trace_buff[index]);
  610. printk(KERN_NOTICE "%4i Target : %s\n", i, buf);
  611. index -= 1;
  612. if (index < 0 )
  613. index = EXPAND_LEN;
  614. decode_address(buf, software_trace_buff[index]);
  615. printk(KERN_NOTICE " Source : %s\n", buf);
  616. index -= 1;
  617. if (index < 0)
  618. index = EXPAND_LEN;
  619. j--;
  620. i++;
  621. }
  622. #endif
  623. trace_buffer_restore(tflags);
  624. #endif
  625. }
  626. EXPORT_SYMBOL(dump_bfin_trace_buffer);
  627. /*
  628. * Checks to see if the address pointed to is either a
  629. * 16-bit CALL instruction, or a 32-bit CALL instruction
  630. */
  631. bool is_bfin_call(unsigned short *addr)
  632. {
  633. unsigned short opcode = 0, *ins_addr;
  634. ins_addr = (unsigned short *)addr;
  635. if (!get_instruction(&opcode, ins_addr))
  636. return false;
  637. if ((opcode >= 0x0060 && opcode <= 0x0067) ||
  638. (opcode >= 0x0070 && opcode <= 0x0077))
  639. return true;
  640. ins_addr--;
  641. if (!get_instruction(&opcode, ins_addr))
  642. return false;
  643. if (opcode >= 0xE300 && opcode <= 0xE3FF)
  644. return true;
  645. return false;
  646. }
  647. void show_stack(struct task_struct *task, unsigned long *stack)
  648. {
  649. unsigned int *addr, *endstack, *fp = 0, *frame;
  650. unsigned short *ins_addr;
  651. char buf[150];
  652. unsigned int i, j, ret_addr, frame_no = 0;
  653. /*
  654. * If we have been passed a specific stack, use that one otherwise
  655. * if we have been passed a task structure, use that, otherwise
  656. * use the stack of where the variable "stack" exists
  657. */
  658. if (stack == NULL) {
  659. if (task) {
  660. /* We know this is a kernel stack, so this is the start/end */
  661. stack = (unsigned long *)task->thread.ksp;
  662. endstack = (unsigned int *)(((unsigned int)(stack) & ~(THREAD_SIZE - 1)) + THREAD_SIZE);
  663. } else {
  664. /* print out the existing stack info */
  665. stack = (unsigned long *)&stack;
  666. endstack = (unsigned int *)PAGE_ALIGN((unsigned int)stack);
  667. }
  668. } else
  669. endstack = (unsigned int *)PAGE_ALIGN((unsigned int)stack);
  670. decode_address(buf, (unsigned int)stack);
  671. printk(KERN_NOTICE "Stack info:\n" KERN_NOTICE " SP: [0x%p] %s\n", stack, buf);
  672. addr = (unsigned int *)((unsigned int)stack & ~0x3F);
  673. /* First thing is to look for a frame pointer */
  674. for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
  675. addr < endstack; addr++, i++) {
  676. if (*addr & 0x1)
  677. continue;
  678. ins_addr = (unsigned short *)*addr;
  679. ins_addr--;
  680. if (is_bfin_call(ins_addr))
  681. fp = addr - 1;
  682. if (fp) {
  683. /* Let's check to see if it is a frame pointer */
  684. while (fp >= (addr - 1) && fp < endstack && fp)
  685. fp = (unsigned int *)*fp;
  686. if (fp == 0 || fp == endstack) {
  687. fp = addr - 1;
  688. break;
  689. }
  690. fp = 0;
  691. }
  692. }
  693. if (fp) {
  694. frame = fp;
  695. printk(" FP: (0x%p)\n", fp);
  696. } else
  697. frame = 0;
  698. /*
  699. * Now that we think we know where things are, we
  700. * walk the stack again, this time printing things out
  701. * incase there is no frame pointer, we still look for
  702. * valid return addresses
  703. */
  704. /* First time print out data, next time, print out symbols */
  705. for (j = 0; j <= 1; j++) {
  706. if (j)
  707. printk(KERN_NOTICE "Return addresses in stack:\n");
  708. else
  709. printk(KERN_NOTICE " Memory from 0x%08lx to %p", ((long unsigned int)stack & ~0xF), endstack);
  710. fp = frame;
  711. frame_no = 0;
  712. for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
  713. addr <= endstack; addr++, i++) {
  714. ret_addr = 0;
  715. if (!j && i % 8 == 0)
  716. printk("\n" KERN_NOTICE "%p:",addr);
  717. /* if it is an odd address, or zero, just skip it */
  718. if (*addr & 0x1 || !*addr)
  719. goto print;
  720. ins_addr = (unsigned short *)*addr;
  721. /* Go back one instruction, and see if it is a CALL */
  722. ins_addr--;
  723. ret_addr = is_bfin_call(ins_addr);
  724. print:
  725. if (!j && stack == (unsigned long *)addr)
  726. printk("[%08x]", *addr);
  727. else if (ret_addr)
  728. if (j) {
  729. decode_address(buf, (unsigned int)*addr);
  730. if (frame == addr) {
  731. printk(KERN_NOTICE " frame %2i : %s\n", frame_no, buf);
  732. continue;
  733. }
  734. printk(KERN_NOTICE " address : %s\n", buf);
  735. } else
  736. printk("<%08x>", *addr);
  737. else if (fp == addr) {
  738. if (j)
  739. frame = addr+1;
  740. else
  741. printk("(%08x)", *addr);
  742. fp = (unsigned int *)*addr;
  743. frame_no++;
  744. } else if (!j)
  745. printk(" %08x ", *addr);
  746. }
  747. if (!j)
  748. printk("\n");
  749. }
  750. }
  751. void dump_stack(void)
  752. {
  753. unsigned long stack;
  754. #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
  755. int tflags;
  756. #endif
  757. trace_buffer_save(tflags);
  758. dump_bfin_trace_buffer();
  759. show_stack(current, &stack);
  760. trace_buffer_restore(tflags);
  761. }
  762. EXPORT_SYMBOL(dump_stack);
  763. void dump_bfin_process(struct pt_regs *fp)
  764. {
  765. /* We should be able to look at fp->ipend, but we don't push it on the
  766. * stack all the time, so do this until we fix that */
  767. unsigned int context = bfin_read_IPEND();
  768. if (oops_in_progress)
  769. printk(KERN_EMERG "Kernel OOPS in progress\n");
  770. if (context & 0x0020 && (fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR)
  771. printk(KERN_NOTICE "HW Error context\n");
  772. else if (context & 0x0020)
  773. printk(KERN_NOTICE "Deferred Exception context\n");
  774. else if (context & 0x3FC0)
  775. printk(KERN_NOTICE "Interrupt context\n");
  776. else if (context & 0x4000)
  777. printk(KERN_NOTICE "Deferred Interrupt context\n");
  778. else if (context & 0x8000)
  779. printk(KERN_NOTICE "Kernel process context\n");
  780. /* Because we are crashing, and pointers could be bad, we check things
  781. * pretty closely before we use them
  782. */
  783. if ((unsigned long)current >= FIXED_CODE_START &&
  784. !((unsigned long)current & 0x3) && current->pid) {
  785. printk(KERN_NOTICE "CURRENT PROCESS:\n");
  786. if (current->comm >= (char *)FIXED_CODE_START)
  787. printk(KERN_NOTICE "COMM=%s PID=%d\n",
  788. current->comm, current->pid);
  789. else
  790. printk(KERN_NOTICE "COMM= invalid\n");
  791. if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START)
  792. printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
  793. KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n"
  794. KERN_NOTICE "\n",
  795. (void *)current->mm->start_code,
  796. (void *)current->mm->end_code,
  797. (void *)current->mm->start_data,
  798. (void *)current->mm->end_data,
  799. (void *)current->mm->end_data,
  800. (void *)current->mm->brk,
  801. (void *)current->mm->start_stack);
  802. else
  803. printk(KERN_NOTICE "invalid mm\n");
  804. } else
  805. printk(KERN_NOTICE "\n" KERN_NOTICE
  806. "No Valid process in current context\n");
  807. }
  808. void dump_bfin_mem(struct pt_regs *fp)
  809. {
  810. unsigned short *addr, *erraddr, val = 0, err = 0;
  811. char sti = 0, buf[6];
  812. erraddr = (void *)fp->pc;
  813. printk(KERN_NOTICE "return address: [0x%p]; contents of:", erraddr);
  814. for (addr = (unsigned short *)((unsigned long)erraddr & ~0xF) - 0x10;
  815. addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10;
  816. addr++) {
  817. if (!((unsigned long)addr & 0xF))
  818. printk("\n" KERN_NOTICE "0x%p: ", addr);
  819. if (get_instruction(&val, addr)) {
  820. val = 0;
  821. sprintf(buf, "????");
  822. } else
  823. sprintf(buf, "%04x", val);
  824. if (addr == erraddr) {
  825. printk("[%s]", buf);
  826. err = val;
  827. } else
  828. printk(" %s ", buf);
  829. /* Do any previous instructions turn on interrupts? */
  830. if (addr <= erraddr && /* in the past */
  831. ((val >= 0x0040 && val <= 0x0047) || /* STI instruction */
  832. val == 0x017b)) /* [SP++] = RETI */
  833. sti = 1;
  834. }
  835. printk("\n");
  836. /* Hardware error interrupts can be deferred */
  837. if (unlikely(sti && (fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR &&
  838. oops_in_progress)){
  839. printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n");
  840. #ifndef CONFIG_DEBUG_HWERR
  841. printk(KERN_NOTICE "The remaining message may be meaningless\n"
  842. KERN_NOTICE "You should enable CONFIG_DEBUG_HWERR to get a"
  843. " better idea where it came from\n");
  844. #else
  845. /* If we are handling only one peripheral interrupt
  846. * and current mm and pid are valid, and the last error
  847. * was in that user space process's text area
  848. * print it out - because that is where the problem exists
  849. */
  850. if ((!(((fp)->ipend & ~0x30) & (((fp)->ipend & ~0x30) - 1))) &&
  851. (current->pid && current->mm)) {
  852. /* And the last RETI points to the current userspace context */
  853. if ((fp + 1)->pc >= current->mm->start_code &&
  854. (fp + 1)->pc <= current->mm->end_code) {
  855. printk(KERN_NOTICE "It might be better to look around here : \n");
  856. printk(KERN_NOTICE "-------------------------------------------\n");
  857. show_regs(fp + 1);
  858. printk(KERN_NOTICE "-------------------------------------------\n");
  859. }
  860. }
  861. #endif
  862. }
  863. }
  864. void show_regs(struct pt_regs *fp)
  865. {
  866. char buf [150];
  867. struct irqaction *action;
  868. unsigned int i;
  869. unsigned long flags;
  870. printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted());
  871. printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
  872. (long)fp->seqstat, fp->ipend, fp->syscfg);
  873. printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
  874. (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14);
  875. printk(KERN_NOTICE " EXCAUSE : 0x%lx\n",
  876. fp->seqstat & SEQSTAT_EXCAUSE);
  877. for (i = 6; i <= 15 ; i++) {
  878. if (fp->ipend & (1 << i)) {
  879. decode_address(buf, bfin_read32(EVT0 + 4*i));
  880. printk(KERN_NOTICE " physical IVG%i asserted : %s\n", i, buf);
  881. }
  882. }
  883. /* if no interrupts are going off, don't print this out */
  884. if (fp->ipend & ~0x3F) {
  885. for (i = 0; i < (NR_IRQS - 1); i++) {
  886. spin_lock_irqsave(&irq_desc[i].lock, flags);
  887. action = irq_desc[i].action;
  888. if (!action)
  889. goto unlock;
  890. decode_address(buf, (unsigned int)action->handler);
  891. printk(KERN_NOTICE " logical irq %3d mapped : %s", i, buf);
  892. for (action = action->next; action; action = action->next) {
  893. decode_address(buf, (unsigned int)action->handler);
  894. printk(", %s", buf);
  895. }
  896. printk("\n");
  897. unlock:
  898. spin_unlock_irqrestore(&irq_desc[i].lock, flags);
  899. }
  900. }
  901. decode_address(buf, fp->rete);
  902. printk(KERN_NOTICE " RETE: %s\n", buf);
  903. decode_address(buf, fp->retn);
  904. printk(KERN_NOTICE " RETN: %s\n", buf);
  905. decode_address(buf, fp->retx);
  906. printk(KERN_NOTICE " RETX: %s\n", buf);
  907. decode_address(buf, fp->rets);
  908. printk(KERN_NOTICE " RETS: %s\n", buf);
  909. decode_address(buf, fp->pc);
  910. printk(KERN_NOTICE " PC : %s\n", buf);
  911. if (((long)fp->seqstat & SEQSTAT_EXCAUSE) &&
  912. (((long)fp->seqstat & SEQSTAT_EXCAUSE) != VEC_HWERR)) {
  913. decode_address(buf, saved_dcplb_fault_addr);
  914. printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf);
  915. decode_address(buf, saved_icplb_fault_addr);
  916. printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
  917. }
  918. printk(KERN_NOTICE "\n" KERN_NOTICE "PROCESSOR STATE:\n");
  919. printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
  920. fp->r0, fp->r1, fp->r2, fp->r3);
  921. printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
  922. fp->r4, fp->r5, fp->r6, fp->r7);
  923. printk(KERN_NOTICE " P0 : %08lx P1 : %08lx P2 : %08lx P3 : %08lx\n",
  924. fp->p0, fp->p1, fp->p2, fp->p3);
  925. printk(KERN_NOTICE " P4 : %08lx P5 : %08lx FP : %08lx SP : %08lx\n",
  926. fp->p4, fp->p5, fp->fp, (long)fp);
  927. printk(KERN_NOTICE " LB0: %08lx LT0: %08lx LC0: %08lx\n",
  928. fp->lb0, fp->lt0, fp->lc0);
  929. printk(KERN_NOTICE " LB1: %08lx LT1: %08lx LC1: %08lx\n",
  930. fp->lb1, fp->lt1, fp->lc1);
  931. printk(KERN_NOTICE " B0 : %08lx L0 : %08lx M0 : %08lx I0 : %08lx\n",
  932. fp->b0, fp->l0, fp->m0, fp->i0);
  933. printk(KERN_NOTICE " B1 : %08lx L1 : %08lx M1 : %08lx I1 : %08lx\n",
  934. fp->b1, fp->l1, fp->m1, fp->i1);
  935. printk(KERN_NOTICE " B2 : %08lx L2 : %08lx M2 : %08lx I2 : %08lx\n",
  936. fp->b2, fp->l2, fp->m2, fp->i2);
  937. printk(KERN_NOTICE " B3 : %08lx L3 : %08lx M3 : %08lx I3 : %08lx\n",
  938. fp->b3, fp->l3, fp->m3, fp->i3);
  939. printk(KERN_NOTICE "A0.w: %08lx A0.x: %08lx A1.w: %08lx A1.x: %08lx\n",
  940. fp->a0w, fp->a0x, fp->a1w, fp->a1x);
  941. printk(KERN_NOTICE "USP : %08lx ASTAT: %08lx\n",
  942. rdusp(), fp->astat);
  943. printk(KERN_NOTICE "\n");
  944. }
  945. #ifdef CONFIG_SYS_BFIN_SPINLOCK_L1
  946. asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text));
  947. #endif
  948. asmlinkage int sys_bfin_spinlock(int *spinlock)
  949. {
  950. int ret = 0;
  951. int tmp = 0;
  952. local_irq_disable();
  953. ret = get_user(tmp, spinlock);
  954. if (ret == 0) {
  955. if (tmp)
  956. ret = 1;
  957. tmp = 1;
  958. put_user(tmp, spinlock);
  959. }
  960. local_irq_enable();
  961. return ret;
  962. }
  963. int bfin_request_exception(unsigned int exception, void (*handler)(void))
  964. {
  965. void (*curr_handler)(void);
  966. if (exception > 0x3F)
  967. return -EINVAL;
  968. curr_handler = ex_table[exception];
  969. if (curr_handler != ex_replaceable)
  970. return -EBUSY;
  971. ex_table[exception] = handler;
  972. return 0;
  973. }
  974. EXPORT_SYMBOL(bfin_request_exception);
  975. int bfin_free_exception(unsigned int exception, void (*handler)(void))
  976. {
  977. void (*curr_handler)(void);
  978. if (exception > 0x3F)
  979. return -EINVAL;
  980. curr_handler = ex_table[exception];
  981. if (curr_handler != handler)
  982. return -EBUSY;
  983. ex_table[exception] = ex_replaceable;
  984. return 0;
  985. }
  986. EXPORT_SYMBOL(bfin_free_exception);
  987. void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
  988. {
  989. switch (cplb_panic) {
  990. case CPLB_NO_UNLOCKED:
  991. printk(KERN_EMERG "All CPLBs are locked\n");
  992. break;
  993. case CPLB_PROT_VIOL:
  994. return;
  995. case CPLB_NO_ADDR_MATCH:
  996. return;
  997. case CPLB_UNKNOWN_ERR:
  998. printk(KERN_EMERG "Unknown CPLB Exception\n");
  999. break;
  1000. }
  1001. oops_in_progress = 1;
  1002. dump_bfin_process(fp);
  1003. dump_bfin_mem(fp);
  1004. show_regs(fp);
  1005. dump_stack();
  1006. panic("Unrecoverable event\n");
  1007. }