vectors.c 2.3 KB

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