vectors.c 2.2 KB

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