vectors.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /***************************************************************************/
  2. /*
  3. * linux/arch/m68knommu/platform/5307/vectors.c
  4. *
  5. * Copyright (C) 1999-2003, Greg Ungerer <gerg@snapgear.com>
  6. */
  7. /***************************************************************************/
  8. #include <linux/kernel.h>
  9. #include <linux/sched.h>
  10. #include <linux/param.h>
  11. #include <linux/init.h>
  12. #include <linux/unistd.h>
  13. #include <linux/delay.h>
  14. #include <asm/irq.h>
  15. #include <asm/dma.h>
  16. #include <asm/traps.h>
  17. #include <asm/machdep.h>
  18. #include <asm/coldfire.h>
  19. #include <asm/mcftimer.h>
  20. #include <asm/mcfsim.h>
  21. #include <asm/mcfdma.h>
  22. #include <asm/mcfwdebug.h>
  23. /***************************************************************************/
  24. #ifdef TRAP_DBG_INTERRUPT
  25. asmlinkage void dbginterrupt_c(struct frame *fp)
  26. {
  27. extern void dump(struct pt_regs *fp);
  28. printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
  29. dump((struct pt_regs *) fp);
  30. asm("halt");
  31. }
  32. #endif
  33. /***************************************************************************/
  34. extern e_vector *_ramvec;
  35. void set_evector(int vecnum, void (*handler)(void))
  36. {
  37. if (vecnum >= 0 && vecnum <= 255)
  38. _ramvec[vecnum] = handler;
  39. }
  40. /***************************************************************************/
  41. /* Assembler routines */
  42. asmlinkage void buserr(void);
  43. asmlinkage void trap(void);
  44. asmlinkage void system_call(void);
  45. asmlinkage void inthandler(void);
  46. void __init coldfire_trap_init(void)
  47. {
  48. int i;
  49. /*
  50. * There is a common trap handler and common interrupt
  51. * handler that handle almost every vector. We treat
  52. * the system call and bus error special, they get their
  53. * own first level handlers.
  54. */
  55. for (i = 3; (i <= 23); i++)
  56. _ramvec[i] = trap;
  57. for (i = 33; (i <= 63); i++)
  58. _ramvec[i] = trap;
  59. for (i = 24; (i <= 31); i++)
  60. _ramvec[i] = inthandler;
  61. for (i = 64; (i < 255); i++)
  62. _ramvec[i] = inthandler;
  63. _ramvec[255] = 0;
  64. _ramvec[2] = buserr;
  65. _ramvec[32] = system_call;
  66. #ifdef TRAP_DBG_INTERRUPT
  67. _ramvec[12] = dbginterrupt;
  68. #endif
  69. }
  70. /***************************************************************************/
  71. void coldfire_reset(void)
  72. {
  73. HARD_RESET_NOW();
  74. }
  75. /***************************************************************************/