vectors.S 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
  3. * Stephan Linz <linz@li-pro.net>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <config.h>
  24. /*************************************************************************
  25. * Exception Vector Table
  26. *
  27. * This could have gone in the cpu soure tree, but the whole point of
  28. * Nios is customization -- and polluting the cpu source tree with
  29. * board-specific ifdef's really defeats the purpose, no? With this in
  30. * the board-specific tree, each board has the freedom to organize
  31. * vectors/traps, etc anyway it wants. The init code copies this table
  32. * to the proper location.
  33. *
  34. * Each board can do what it likes here. But there are four "standard"
  35. * handlers availble:
  36. *
  37. * _cwp_lolimit -Handles register window underflows.
  38. * _cwp_hilimit -Handles register window overflows.
  39. * _timebase_int -Increments the timebase.
  40. * _def_xhandler -Default exception handler.
  41. *
  42. * _timebase_int handles a Nios Timer interrupt and increments the
  43. * timestamp used for the get_timer(), reset_timer(), etc. routines. It
  44. * expects the timer to be configured like the standard-32 low priority
  45. * timer.
  46. *
  47. * _def_xhandler dispatches exceptions/traps via the external_interrupt()
  48. * routine. This lets you use the irq_install_handler() and handle your
  49. * interrupts/traps with code written in C.
  50. ************************************************************************/
  51. .data
  52. .global _vectors
  53. .align 4
  54. _vectors:
  55. #if defined(CONFIG_SYS_NIOS_CPU_OCI_BASE)
  56. /* OCI does the reset job */
  57. .long _def_xhandler@h /* Vector 0 - NMI / Reset */
  58. #else
  59. /* there is no OCI, so we have to do a direct reset jump here */
  60. .long CONFIG_SYS_NIOS_CPU_RST_VECT /* Vector 0 - Reset to GERMS */
  61. #endif
  62. .long _cwp_lolimit@h /* Vector 1 - underflow */
  63. .long _cwp_hilimit@h /* Vector 2 - overflow */
  64. .long _def_xhandler@h /* Vector 3 - GNUPro debug */
  65. .long _def_xhandler@h /* Vector 4 - GNUPro debug */
  66. .long _def_xhandler@h /* Vector 5 - GNUPro debug */
  67. .long _def_xhandler@h /* Vector 6 - future reserved */
  68. .long _def_xhandler@h /* Vector 7 - future reserved */
  69. .long _def_xhandler@h /* Vector 8 - future reserved */
  70. .long _def_xhandler@h /* Vector 9 - future reserved */
  71. .long _def_xhandler@h /* Vector 10 - future reserved */
  72. .long _def_xhandler@h /* Vector 11 - future reserved */
  73. .long _def_xhandler@h /* Vector 12 - future reserved */
  74. .long _def_xhandler@h /* Vector 13 - future reserved */
  75. .long _def_xhandler@h /* Vector 14 - future reserved */
  76. .long _def_xhandler@h /* Vector 15 - future reserved */
  77. #if (CONFIG_SYS_NIOS_TMRIRQ == 16)
  78. .long _timebase_int@h /* Vector 16 - lopri timer*/
  79. #else
  80. .long _def_xhandler@h /* Vector 16 */
  81. #endif
  82. .long _def_xhandler@h /* Vector 17 */
  83. .long _def_xhandler@h /* Vector 18 */
  84. .long _def_xhandler@h /* Vector 19 */
  85. .long _def_xhandler@h /* Vector 20 */
  86. .long _def_xhandler@h /* Vector 21 */
  87. .long _def_xhandler@h /* Vector 22 */
  88. .long _def_xhandler@h /* Vector 23 */
  89. .long _def_xhandler@h /* Vector 24 */
  90. .long _def_xhandler@h /* Vector 25 */
  91. .long _def_xhandler@h /* Vector 26 */
  92. .long _def_xhandler@h /* Vector 27 */
  93. .long _def_xhandler@h /* Vector 28 */
  94. .long _def_xhandler@h /* Vector 29 */
  95. .long _def_xhandler@h /* Vector 30 */
  96. .long _def_xhandler@h /* Vector 31 */
  97. .long _def_xhandler@h /* Vector 32 */
  98. .long _def_xhandler@h /* Vector 33 */
  99. .long _def_xhandler@h /* Vector 34 */
  100. .long _def_xhandler@h /* Vector 35 */
  101. .long _def_xhandler@h /* Vector 36 */
  102. .long _def_xhandler@h /* Vector 37 */
  103. .long _def_xhandler@h /* Vector 38 */
  104. .long _def_xhandler@h /* Vector 39 */
  105. .long _def_xhandler@h /* Vector 40 */
  106. .long _def_xhandler@h /* Vector 41 */
  107. .long _def_xhandler@h /* Vector 42 */
  108. .long _def_xhandler@h /* Vector 43 */
  109. .long _def_xhandler@h /* Vector 44 */
  110. .long _def_xhandler@h /* Vector 45 */
  111. .long _def_xhandler@h /* Vector 46 */
  112. .long _def_xhandler@h /* Vector 47 */
  113. .long _def_xhandler@h /* Vector 48 */
  114. .long _def_xhandler@h /* Vector 49 */
  115. #if (CONFIG_SYS_NIOS_TMRIRQ == 50)
  116. .long _timebase_int@h /* Vector 50 - lopri timer*/
  117. #else
  118. .long _def_xhandler@h /* Vector 50 */
  119. #endif
  120. .long _def_xhandler@h /* Vector 51 */
  121. .long _def_xhandler@h /* Vector 52 */
  122. .long _def_xhandler@h /* Vector 53 */
  123. .long _def_xhandler@h /* Vector 54 */
  124. .long _def_xhandler@h /* Vector 55 */
  125. .long _def_xhandler@h /* Vector 56 */
  126. .long _def_xhandler@h /* Vector 57 */
  127. .long _def_xhandler@h /* Vector 58 */
  128. .long _def_xhandler@h /* Vector 59 */
  129. .long _def_xhandler@h /* Vector 60 */
  130. .long _def_xhandler@h /* Vector 61 */
  131. .long _def_xhandler@h /* Vector 62 */
  132. .long _def_xhandler@h /* Vector 63 */