regs.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of version 2.1 of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it would be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. *
  12. * Further, this software is distributed without any warranty that it is
  13. * free of the rightful claim of any third person regarding infringement
  14. * or the like. Any license provided herein, whether implied or
  15. * otherwise, applies only to this software file. Patent licenses, if
  16. * any, provided herein do not apply to combinations of this program with
  17. * other software, or any other product whatsoever.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this program; if not, write the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
  22. * USA.
  23. */
  24. #ifndef _XTENSA_REGS_H
  25. #define _XTENSA_REGS_H
  26. /* Special registers. */
  27. #define LBEG 0
  28. #define LEND 1
  29. #define LCOUNT 2
  30. #define SAR 3
  31. #define BR 4
  32. #define SCOMPARE1 12
  33. #define ACCHI 16
  34. #define ACCLO 17
  35. #define MR 32
  36. #define WINDOWBASE 72
  37. #define WINDOWSTART 73
  38. #define PTEVADDR 83
  39. #define RASID 90
  40. #define ITLBCFG 91
  41. #define DTLBCFG 92
  42. #define IBREAKENABLE 96
  43. #define DDR 104
  44. #define IBREAKA 128
  45. #define DBREAKA 144
  46. #define DBREAKC 160
  47. #define EPC 176
  48. #define EPC_1 177
  49. #define DEPC 192
  50. #define EPS 192
  51. #define EPS_1 193
  52. #define EXCSAVE 208
  53. #define EXCSAVE_1 209
  54. #define INTERRUPT 226
  55. #define INTENABLE 228
  56. #define PS 230
  57. #define THREADPTR 231
  58. #define EXCCAUSE 232
  59. #define DEBUGCAUSE 233
  60. #define CCOUNT 234
  61. #define PRID 235
  62. #define ICOUNT 236
  63. #define ICOUNTLEVEL 237
  64. #define EXCVADDR 238
  65. #define CCOMPARE 240
  66. #define MISC 244
  67. /* Special names for read-only and write-only interrupt registers. */
  68. #define INTREAD 226
  69. #define INTSET 226
  70. #define INTCLEAR 227
  71. /* EXCCAUSE register fields */
  72. #define EXCCAUSE_EXCCAUSE_SHIFT 0
  73. #define EXCCAUSE_EXCCAUSE_MASK 0x3F
  74. #define EXCCAUSE_ILLEGAL_INSTRUCTION 0
  75. #define EXCCAUSE_SYSTEM_CALL 1
  76. #define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
  77. #define EXCCAUSE_LOAD_STORE_ERROR 3
  78. #define EXCCAUSE_LEVEL1_INTERRUPT 4
  79. #define EXCCAUSE_ALLOCA 5
  80. #define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
  81. #define EXCCAUSE_SPECULATION 7
  82. #define EXCCAUSE_PRIVILEGED 8
  83. #define EXCCAUSE_UNALIGNED 9
  84. #define EXCCAUSE_ITLB_MISS 16
  85. #define EXCCAUSE_ITLB_MULTIHIT 17
  86. #define EXCCAUSE_ITLB_PRIVILEGE 18
  87. #define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
  88. #define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
  89. #define EXCCAUSE_DTLB_MISS 24
  90. #define EXCCAUSE_DTLB_MULTIHIT 25
  91. #define EXCCAUSE_DTLB_PRIVILEGE 26
  92. #define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
  93. #define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
  94. #define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
  95. #define EXCCAUSE_COPROCESSOR0_DISABLED 32
  96. #define EXCCAUSE_COPROCESSOR1_DISABLED 33
  97. #define EXCCAUSE_COPROCESSOR2_DISABLED 34
  98. #define EXCCAUSE_COPROCESSOR3_DISABLED 35
  99. #define EXCCAUSE_COPROCESSOR4_DISABLED 36
  100. #define EXCCAUSE_COPROCESSOR5_DISABLED 37
  101. #define EXCCAUSE_COPROCESSOR6_DISABLED 38
  102. #define EXCCAUSE_COPROCESSOR7_DISABLED 39
  103. /* PS register fields. */
  104. #define PS_WOE_BIT 18
  105. #define PS_CALLINC_SHIFT 16
  106. #define PS_CALLINC_MASK 0x00030000
  107. #define PS_OWB_SHIFT 8
  108. #define PS_OWB_MASK 0x00000F00
  109. #define PS_RING_SHIFT 6
  110. #define PS_RING_MASK 0x000000C0
  111. #define PS_UM_BIT 5
  112. #define PS_EXCM_BIT 4
  113. #define PS_INTLEVEL_SHIFT 0
  114. #define PS_INTLEVEL_MASK 0x0000000F
  115. /* DBREAKCn register fields. */
  116. #define DBREAKC_MASK_BIT 0
  117. #define DBREAKC_MASK_MASK 0x0000003F
  118. #define DBREAKC_LOAD_BIT 30
  119. #define DBREAKC_LOAD_MASK 0x40000000
  120. #define DBREAKC_STOR_BIT 31
  121. #define DBREAKC_STOR_MASK 0x80000000
  122. /* DEBUGCAUSE register fields. */
  123. #define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
  124. #define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
  125. #define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
  126. #define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
  127. #define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
  128. #define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
  129. #endif /* _XTENSA_SPECREG_H */