traps.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /* MN10300 Exception handling
  2. *
  3. * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
  4. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  5. * Modified by David Howells (dhowells@redhat.com)
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public Licence
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the Licence, or (at your option) any later version.
  11. */
  12. #include <linux/sched.h>
  13. #include <linux/kernel.h>
  14. #include <linux/string.h>
  15. #include <linux/errno.h>
  16. #include <linux/ptrace.h>
  17. #include <linux/timer.h>
  18. #include <linux/mm.h>
  19. #include <linux/smp.h>
  20. #include <linux/smp_lock.h>
  21. #include <linux/init.h>
  22. #include <linux/delay.h>
  23. #include <linux/spinlock.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/kallsyms.h>
  26. #include <linux/pci.h>
  27. #include <linux/kdebug.h>
  28. #include <linux/bug.h>
  29. #include <linux/irq.h>
  30. #include <asm/processor.h>
  31. #include <asm/system.h>
  32. #include <asm/uaccess.h>
  33. #include <asm/io.h>
  34. #include <asm/atomic.h>
  35. #include <asm/smp.h>
  36. #include <asm/pgalloc.h>
  37. #include <asm/cacheflush.h>
  38. #include <asm/cpu-regs.h>
  39. #include <asm/busctl-regs.h>
  40. #include <asm/unit/leds.h>
  41. #include <asm/fpu.h>
  42. #include <asm/gdb-stub.h>
  43. #include <asm/sections.h>
  44. #if (CONFIG_INTERRUPT_VECTOR_BASE & 0xffffff)
  45. #error "INTERRUPT_VECTOR_BASE not aligned to 16MiB boundary!"
  46. #endif
  47. struct pt_regs *__frame; /* current frame pointer */
  48. EXPORT_SYMBOL(__frame);
  49. int kstack_depth_to_print = 24;
  50. spinlock_t die_lock = __SPIN_LOCK_UNLOCKED(die_lock);
  51. ATOMIC_NOTIFIER_HEAD(mn10300_die_chain);
  52. /*
  53. * These constants are for searching for possible module text
  54. * segments. MODULE_RANGE is a guess of how much space is likely
  55. * to be vmalloced.
  56. */
  57. #define MODULE_RANGE (8 * 1024 * 1024)
  58. #define DO_ERROR(signr, prologue, str, name) \
  59. asmlinkage void name(struct pt_regs *regs, u32 intcode) \
  60. { \
  61. prologue; \
  62. if (die_if_no_fixup(str, regs, intcode)) \
  63. return; \
  64. force_sig(signr, current); \
  65. }
  66. #define DO_EINFO(signr, prologue, str, name, sicode) \
  67. asmlinkage void name(struct pt_regs *regs, u32 intcode) \
  68. { \
  69. siginfo_t info; \
  70. prologue; \
  71. if (die_if_no_fixup(str, regs, intcode)) \
  72. return; \
  73. info.si_signo = signr; \
  74. if (signr == SIGILL && sicode == ILL_ILLOPC) { \
  75. uint8_t opcode; \
  76. if (get_user(opcode, (uint8_t __user *)regs->pc) == 0) \
  77. if (opcode == 0xff) \
  78. info.si_signo = SIGTRAP; \
  79. } \
  80. info.si_errno = 0; \
  81. info.si_code = sicode; \
  82. info.si_addr = (void *) regs->pc; \
  83. force_sig_info(info.si_signo, &info, current); \
  84. }
  85. DO_ERROR(SIGTRAP, {}, "trap", trap);
  86. DO_ERROR(SIGSEGV, {}, "ibreak", ibreak);
  87. DO_ERROR(SIGSEGV, {}, "obreak", obreak);
  88. DO_EINFO(SIGSEGV, {}, "access error", access_error, SEGV_ACCERR);
  89. DO_EINFO(SIGSEGV, {}, "insn access error", insn_acc_error, SEGV_ACCERR);
  90. DO_EINFO(SIGSEGV, {}, "data access error", data_acc_error, SEGV_ACCERR);
  91. DO_EINFO(SIGILL, {}, "privileged opcode", priv_op, ILL_PRVOPC);
  92. DO_EINFO(SIGILL, {}, "invalid opcode", invalid_op, ILL_ILLOPC);
  93. DO_EINFO(SIGILL, {}, "invalid ex opcode", invalid_exop, ILL_ILLOPC);
  94. DO_EINFO(SIGBUS, {}, "invalid address", mem_error, BUS_ADRERR);
  95. DO_EINFO(SIGBUS, {}, "bus error", bus_error, BUS_ADRERR);
  96. DO_EINFO(SIGILL, {}, "FPU invalid opcode", fpu_invalid_op, ILL_COPROC);
  97. DO_ERROR(SIGTRAP,
  98. #ifndef CONFIG_MN10300_USING_JTAG
  99. DCR &= ~0x0001,
  100. #else
  101. {},
  102. #endif
  103. "single step", istep);
  104. /*
  105. * handle NMI
  106. */
  107. asmlinkage void nmi(struct pt_regs *regs, enum exception_code code)
  108. {
  109. /* see if gdbstub wants to deal with it */
  110. #ifdef CONFIG_GDBSTUB
  111. if (gdbstub_intercept(regs, code))
  112. return;
  113. #endif
  114. printk(KERN_WARNING "--- Register Dump ---\n");
  115. show_registers(regs);
  116. printk(KERN_WARNING "---------------------\n");
  117. }
  118. /*
  119. * show a stack trace from the specified stack pointer
  120. */
  121. void show_trace(unsigned long *sp)
  122. {
  123. unsigned long *stack, addr, module_start, module_end;
  124. int i;
  125. printk(KERN_EMERG "\n"
  126. KERN_EMERG "Call Trace:");
  127. stack = sp;
  128. i = 0;
  129. module_start = VMALLOC_START;
  130. module_end = VMALLOC_END;
  131. while (((long) stack & (THREAD_SIZE - 1)) != 0) {
  132. addr = *stack++;
  133. if (__kernel_text_address(addr)) {
  134. #if 1
  135. printk(" [<%08lx>]", addr);
  136. print_symbol(" %s", addr);
  137. printk("\n");
  138. #else
  139. if ((i % 6) == 0)
  140. printk("\n" KERN_EMERG " ");
  141. printk("[<%08lx>] ", addr);
  142. i++;
  143. #endif
  144. }
  145. }
  146. printk("\n");
  147. }
  148. /*
  149. * show the raw stack from the specified stack pointer
  150. */
  151. void show_stack(struct task_struct *task, unsigned long *sp)
  152. {
  153. unsigned long *stack;
  154. int i;
  155. if (!sp)
  156. sp = (unsigned long *) &sp;
  157. stack = sp;
  158. printk(KERN_EMERG "Stack:");
  159. for (i = 0; i < kstack_depth_to_print; i++) {
  160. if (((long) stack & (THREAD_SIZE - 1)) == 0)
  161. break;
  162. if ((i % 8) == 0)
  163. printk("\n" KERN_EMERG " ");
  164. printk("%08lx ", *stack++);
  165. }
  166. show_trace(sp);
  167. }
  168. /*
  169. * the architecture-independent dump_stack generator
  170. */
  171. void dump_stack(void)
  172. {
  173. unsigned long stack;
  174. show_stack(current, &stack);
  175. }
  176. EXPORT_SYMBOL(dump_stack);
  177. /*
  178. * dump the register file in the specified exception frame
  179. */
  180. void show_registers_only(struct pt_regs *regs)
  181. {
  182. unsigned long ssp;
  183. ssp = (unsigned long) regs + sizeof(*regs);
  184. printk(KERN_EMERG "PC: %08lx EPSW: %08lx SSP: %08lx mode: %s\n",
  185. regs->pc, regs->epsw, ssp, user_mode(regs) ? "User" : "Super");
  186. printk(KERN_EMERG "d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
  187. regs->d0, regs->d1, regs->d2, regs->d3);
  188. printk(KERN_EMERG "a0: %08lx a1: %08lx a2: %08lx a3: %08lx\n",
  189. regs->a0, regs->a1, regs->a2, regs->a3);
  190. printk(KERN_EMERG "e0: %08lx e1: %08lx e2: %08lx e3: %08lx\n",
  191. regs->e0, regs->e1, regs->e2, regs->e3);
  192. printk(KERN_EMERG "e4: %08lx e5: %08lx e6: %08lx e7: %08lx\n",
  193. regs->e4, regs->e5, regs->e6, regs->e7);
  194. printk(KERN_EMERG "lar: %08lx lir: %08lx mdr: %08lx usp: %08lx\n",
  195. regs->lar, regs->lir, regs->mdr, regs->sp);
  196. printk(KERN_EMERG "cvf: %08lx crl: %08lx crh: %08lx drq: %08lx\n",
  197. regs->mcvf, regs->mcrl, regs->mcrh, regs->mdrq);
  198. printk(KERN_EMERG "threadinfo=%p task=%p)\n",
  199. current_thread_info(), current);
  200. if ((unsigned long) current >= 0x90000000UL &&
  201. (unsigned long) current < 0x94000000UL)
  202. printk(KERN_EMERG "Process %s (pid: %d)\n",
  203. current->comm, current->pid);
  204. printk(KERN_EMERG "CPUP: %04hx\n", CPUP);
  205. printk(KERN_EMERG "TBR: %08x\n", TBR);
  206. printk(KERN_EMERG "DEAR: %08x\n", DEAR);
  207. printk(KERN_EMERG "sISR: %08x\n", sISR);
  208. printk(KERN_EMERG "NMICR: %04hx\n", NMICR);
  209. printk(KERN_EMERG "BCBERR: %08x\n", BCBERR);
  210. printk(KERN_EMERG "BCBEAR: %08x\n", BCBEAR);
  211. printk(KERN_EMERG "MMUFCR: %08x\n", MMUFCR);
  212. printk(KERN_EMERG "IPTEU : %08x IPTEL2: %08x\n", IPTEU, IPTEL2);
  213. printk(KERN_EMERG "DPTEU: %08x DPTEL2: %08x\n", DPTEU, DPTEL2);
  214. }
  215. /*
  216. * dump the registers and the stack
  217. */
  218. void show_registers(struct pt_regs *regs)
  219. {
  220. unsigned long sp;
  221. int i;
  222. show_registers_only(regs);
  223. if (!user_mode(regs))
  224. sp = (unsigned long) regs + sizeof(*regs);
  225. else
  226. sp = regs->sp;
  227. /* when in-kernel, we also print out the stack and code at the
  228. * time of the fault..
  229. */
  230. if (!user_mode(regs)) {
  231. printk(KERN_EMERG "\n");
  232. show_stack(current, (unsigned long *) sp);
  233. #if 0
  234. printk(KERN_EMERG "\n"
  235. KERN_EMERG "Code: ");
  236. if (regs->pc < PAGE_OFFSET)
  237. goto bad;
  238. for (i = 0; i < 20; i++) {
  239. unsigned char c;
  240. if (__get_user(c, &((unsigned char *) regs->pc)[i]))
  241. goto bad;
  242. printk("%02x ", c);
  243. }
  244. #else
  245. i = 0;
  246. #endif
  247. }
  248. printk("\n");
  249. return;
  250. #if 0
  251. bad:
  252. printk(KERN_EMERG " Bad PC value.");
  253. break;
  254. #endif
  255. }
  256. /*
  257. *
  258. */
  259. void show_trace_task(struct task_struct *tsk)
  260. {
  261. unsigned long sp = tsk->thread.sp;
  262. /* User space on another CPU? */
  263. if ((sp ^ (unsigned long) tsk) & (PAGE_MASK << 1))
  264. return;
  265. show_trace((unsigned long *) sp);
  266. }
  267. /*
  268. * note the untimely death of part of the kernel
  269. */
  270. void die(const char *str, struct pt_regs *regs, enum exception_code code)
  271. {
  272. console_verbose();
  273. spin_lock_irq(&die_lock);
  274. printk(KERN_EMERG "\n"
  275. KERN_EMERG "%s: %04x\n",
  276. str, code & 0xffff);
  277. show_registers(regs);
  278. if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 &&
  279. (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) {
  280. printk(KERN_EMERG "Exception in usermode interrupt handler\n");
  281. printk(KERN_EMERG "\n"
  282. KERN_EMERG " Please connect to kernel debugger !!\n");
  283. asm volatile ("0: bra 0b");
  284. }
  285. spin_unlock_irq(&die_lock);
  286. do_exit(SIGSEGV);
  287. }
  288. /*
  289. * see if there's a fixup handler we can force a jump to when an exception
  290. * happens due to something kernel code did
  291. */
  292. int die_if_no_fixup(const char *str, struct pt_regs *regs,
  293. enum exception_code code)
  294. {
  295. if (user_mode(regs))
  296. return 0;
  297. peripheral_leds_display_exception(code);
  298. switch (code) {
  299. /* see if we can fixup the kernel accessing memory */
  300. case EXCEP_ITLBMISS:
  301. case EXCEP_DTLBMISS:
  302. case EXCEP_IAERROR:
  303. case EXCEP_DAERROR:
  304. case EXCEP_MEMERR:
  305. case EXCEP_MISALIGN:
  306. case EXCEP_BUSERROR:
  307. case EXCEP_ILLDATACC:
  308. case EXCEP_IOINSACC:
  309. case EXCEP_PRIVINSACC:
  310. case EXCEP_PRIVDATACC:
  311. case EXCEP_DATINSACC:
  312. if (fixup_exception(regs))
  313. return 1;
  314. case EXCEP_UNIMPINS:
  315. if (regs->pc && *(uint8_t *)regs->pc == 0xff)
  316. if (notify_die(DIE_BREAKPOINT, str, regs, code, 0, 0))
  317. return 1;
  318. break;
  319. default:
  320. break;
  321. }
  322. /* see if gdbstub wants to deal with it */
  323. #ifdef CONFIG_GDBSTUB
  324. if (gdbstub_intercept(regs, code))
  325. return 1;
  326. #endif
  327. if (notify_die(DIE_GPF, str, regs, code, 0, 0))
  328. return 1;
  329. /* make the process die as the last resort */
  330. die(str, regs, code);
  331. }
  332. /*
  333. * handle unsupported syscall instructions (syscall 1-15)
  334. */
  335. static asmlinkage void unsupported_syscall(struct pt_regs *regs,
  336. enum exception_code code)
  337. {
  338. struct task_struct *tsk = current;
  339. siginfo_t info;
  340. /* catch a kernel BUG() */
  341. if (code == EXCEP_SYSCALL15 && !user_mode(regs)) {
  342. if (report_bug(regs->pc, regs) == BUG_TRAP_TYPE_BUG) {
  343. #ifdef CONFIG_GDBSTUB
  344. gdbstub_intercept(regs, code);
  345. #endif
  346. }
  347. }
  348. regs->pc -= 2; /* syscall return addr is _after_ the instruction */
  349. die_if_no_fixup("An unsupported syscall insn was used by the kernel\n",
  350. regs, code);
  351. info.si_signo = SIGILL;
  352. info.si_errno = ENOSYS;
  353. info.si_code = ILL_ILLTRP;
  354. info.si_addr = (void *) regs->pc;
  355. force_sig_info(SIGILL, &info, tsk);
  356. }
  357. /*
  358. * display the register file when the stack pointer gets clobbered
  359. */
  360. asmlinkage void do_double_fault(struct pt_regs *regs)
  361. {
  362. struct task_struct *tsk = current;
  363. strcpy(tsk->comm, "emergency tsk");
  364. tsk->pid = 0;
  365. console_verbose();
  366. printk(KERN_EMERG "--- double fault ---\n");
  367. show_registers(regs);
  368. }
  369. /*
  370. * asynchronous bus error (external, usually I/O DMA)
  371. */
  372. asmlinkage void io_bus_error(u32 bcberr, u32 bcbear, struct pt_regs *regs)
  373. {
  374. console_verbose();
  375. printk(KERN_EMERG "\n"
  376. KERN_EMERG "Asynchronous I/O Bus Error\n"
  377. KERN_EMERG "==========================\n");
  378. if (bcberr & BCBERR_BEME)
  379. printk(KERN_EMERG "- Multiple recorded errors\n");
  380. printk(KERN_EMERG "- Faulting Buses:%s%s%s\n",
  381. bcberr & BCBERR_BEMR_CI ? " CPU-Ins-Fetch" : "",
  382. bcberr & BCBERR_BEMR_CD ? " CPU-Data" : "",
  383. bcberr & BCBERR_BEMR_DMA ? " DMA" : "");
  384. printk(KERN_EMERG "- %s %s access made to %s at address %08x\n",
  385. bcberr & BCBERR_BEBST ? "Burst" : "Single",
  386. bcberr & BCBERR_BERW ? "Read" : "Write",
  387. bcberr & BCBERR_BESB_MON ? "Monitor Space" :
  388. bcberr & BCBERR_BESB_IO ? "Internal CPU I/O Space" :
  389. bcberr & BCBERR_BESB_EX ? "External I/O Bus" :
  390. bcberr & BCBERR_BESB_OPEX ? "External Memory Bus" :
  391. "On Chip Memory",
  392. bcbear
  393. );
  394. printk(KERN_EMERG "- Detected by the %s\n",
  395. bcberr&BCBERR_BESD ? "Bus Control Unit" : "Slave Bus");
  396. #ifdef CONFIG_PCI
  397. #define BRIDGEREGB(X) (*(volatile __u8 *)(0xBE040000 + (X)))
  398. #define BRIDGEREGW(X) (*(volatile __u16 *)(0xBE040000 + (X)))
  399. #define BRIDGEREGL(X) (*(volatile __u32 *)(0xBE040000 + (X)))
  400. printk(KERN_EMERG "- PCI Memory Paging Reg: %08x\n",
  401. *(volatile __u32 *) (0xBFFFFFF4));
  402. printk(KERN_EMERG "- PCI Bridge Base Address 0: %08x\n",
  403. BRIDGEREGL(PCI_BASE_ADDRESS_0));
  404. printk(KERN_EMERG "- PCI Bridge AMPCI Base Address: %08x\n",
  405. BRIDGEREGL(0x48));
  406. printk(KERN_EMERG "- PCI Bridge Command: %04hx\n",
  407. BRIDGEREGW(PCI_COMMAND));
  408. printk(KERN_EMERG "- PCI Bridge Status: %04hx\n",
  409. BRIDGEREGW(PCI_STATUS));
  410. printk(KERN_EMERG "- PCI Bridge Int Status: %08hx\n",
  411. BRIDGEREGL(0x4c));
  412. #endif
  413. printk(KERN_EMERG "\n");
  414. show_registers(regs);
  415. panic("Halted due to asynchronous I/O Bus Error\n");
  416. }
  417. /*
  418. * handle an exception for which a handler has not yet been installed
  419. */
  420. asmlinkage void uninitialised_exception(struct pt_regs *regs,
  421. enum exception_code code)
  422. {
  423. /* see if gdbstub wants to deal with it */
  424. #ifdef CONFIG_GDBSTUB
  425. if (gdbstub_intercept(regs, code))
  426. return;
  427. #endif
  428. peripheral_leds_display_exception(code);
  429. printk(KERN_EMERG "Uninitialised Exception 0x%04x\n", code & 0xFFFF);
  430. show_registers(regs);
  431. for (;;)
  432. continue;
  433. }
  434. /*
  435. * set an interrupt stub to jump to a handler
  436. * ! NOTE: this does *not* flush the caches
  437. */
  438. void __init __set_intr_stub(enum exception_code code, void *handler)
  439. {
  440. unsigned long addr;
  441. u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code);
  442. addr = (unsigned long) handler - (unsigned long) vector;
  443. vector[0] = 0xdc; /* JMP handler */
  444. vector[1] = addr;
  445. vector[2] = addr >> 8;
  446. vector[3] = addr >> 16;
  447. vector[4] = addr >> 24;
  448. vector[5] = 0xcb;
  449. vector[6] = 0xcb;
  450. vector[7] = 0xcb;
  451. }
  452. /*
  453. * set an interrupt stub to jump to a handler
  454. */
  455. void __init set_intr_stub(enum exception_code code, void *handler)
  456. {
  457. unsigned long addr;
  458. u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code);
  459. addr = (unsigned long) handler - (unsigned long) vector;
  460. vector[0] = 0xdc; /* JMP handler */
  461. vector[1] = addr;
  462. vector[2] = addr >> 8;
  463. vector[3] = addr >> 16;
  464. vector[4] = addr >> 24;
  465. vector[5] = 0xcb;
  466. vector[6] = 0xcb;
  467. vector[7] = 0xcb;
  468. mn10300_dcache_flush_inv();
  469. mn10300_icache_inv();
  470. }
  471. /*
  472. * set an interrupt stub to invoke the JTAG unit and then jump to a handler
  473. */
  474. void __init set_jtag_stub(enum exception_code code, void *handler)
  475. {
  476. unsigned long addr;
  477. u8 *vector = (u8 *)(CONFIG_INTERRUPT_VECTOR_BASE + code);
  478. addr = (unsigned long) handler - ((unsigned long) vector + 1);
  479. vector[0] = 0xff; /* PI to jump into JTAG debugger */
  480. vector[1] = 0xdc; /* jmp handler */
  481. vector[2] = addr;
  482. vector[3] = addr >> 8;
  483. vector[4] = addr >> 16;
  484. vector[5] = addr >> 24;
  485. vector[6] = 0xcb;
  486. vector[7] = 0xcb;
  487. mn10300_dcache_flush_inv();
  488. flush_icache_range((unsigned long) vector, (unsigned long) vector + 8);
  489. }
  490. /*
  491. * initialise the exception table
  492. */
  493. void __init trap_init(void)
  494. {
  495. set_excp_vector(EXCEP_TRAP, trap);
  496. set_excp_vector(EXCEP_ISTEP, istep);
  497. set_excp_vector(EXCEP_IBREAK, ibreak);
  498. set_excp_vector(EXCEP_OBREAK, obreak);
  499. set_excp_vector(EXCEP_PRIVINS, priv_op);
  500. set_excp_vector(EXCEP_UNIMPINS, invalid_op);
  501. set_excp_vector(EXCEP_UNIMPEXINS, invalid_exop);
  502. set_excp_vector(EXCEP_MEMERR, mem_error);
  503. set_excp_vector(EXCEP_MISALIGN, misalignment);
  504. set_excp_vector(EXCEP_BUSERROR, bus_error);
  505. set_excp_vector(EXCEP_ILLINSACC, insn_acc_error);
  506. set_excp_vector(EXCEP_ILLDATACC, data_acc_error);
  507. set_excp_vector(EXCEP_IOINSACC, insn_acc_error);
  508. set_excp_vector(EXCEP_PRIVINSACC, insn_acc_error);
  509. set_excp_vector(EXCEP_PRIVDATACC, data_acc_error);
  510. set_excp_vector(EXCEP_DATINSACC, insn_acc_error);
  511. set_excp_vector(EXCEP_FPU_DISABLED, fpu_disabled);
  512. set_excp_vector(EXCEP_FPU_UNIMPINS, fpu_invalid_op);
  513. set_excp_vector(EXCEP_FPU_OPERATION, fpu_exception);
  514. set_excp_vector(EXCEP_NMI, nmi);
  515. set_excp_vector(EXCEP_SYSCALL1, unsupported_syscall);
  516. set_excp_vector(EXCEP_SYSCALL2, unsupported_syscall);
  517. set_excp_vector(EXCEP_SYSCALL3, unsupported_syscall);
  518. set_excp_vector(EXCEP_SYSCALL4, unsupported_syscall);
  519. set_excp_vector(EXCEP_SYSCALL5, unsupported_syscall);
  520. set_excp_vector(EXCEP_SYSCALL6, unsupported_syscall);
  521. set_excp_vector(EXCEP_SYSCALL7, unsupported_syscall);
  522. set_excp_vector(EXCEP_SYSCALL8, unsupported_syscall);
  523. set_excp_vector(EXCEP_SYSCALL9, unsupported_syscall);
  524. set_excp_vector(EXCEP_SYSCALL10, unsupported_syscall);
  525. set_excp_vector(EXCEP_SYSCALL11, unsupported_syscall);
  526. set_excp_vector(EXCEP_SYSCALL12, unsupported_syscall);
  527. set_excp_vector(EXCEP_SYSCALL13, unsupported_syscall);
  528. set_excp_vector(EXCEP_SYSCALL14, unsupported_syscall);
  529. set_excp_vector(EXCEP_SYSCALL15, unsupported_syscall);
  530. }
  531. /*
  532. * determine if a program counter value is a valid bug address
  533. */
  534. int is_valid_bugaddr(unsigned long pc)
  535. {
  536. return pc >= PAGE_OFFSET;
  537. }