regs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 SREG_MR 32
  28. #define SREG_IBREAKENABLE 96
  29. #define SREG_IBREAKA 128
  30. #define SREG_DBREAKA 144
  31. #define SREG_DBREAKC 160
  32. #define SREG_EPC 176
  33. #define SREG_EPS 192
  34. #define SREG_EXCSAVE 208
  35. #define SREG_CCOMPARE 240
  36. #define SREG_MISC 244
  37. /* EXCCAUSE register fields */
  38. #define EXCCAUSE_EXCCAUSE_SHIFT 0
  39. #define EXCCAUSE_EXCCAUSE_MASK 0x3F
  40. #define EXCCAUSE_ILLEGAL_INSTRUCTION 0
  41. #define EXCCAUSE_SYSTEM_CALL 1
  42. #define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
  43. #define EXCCAUSE_LOAD_STORE_ERROR 3
  44. #define EXCCAUSE_LEVEL1_INTERRUPT 4
  45. #define EXCCAUSE_ALLOCA 5
  46. #define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
  47. #define EXCCAUSE_SPECULATION 7
  48. #define EXCCAUSE_PRIVILEGED 8
  49. #define EXCCAUSE_UNALIGNED 9
  50. #define EXCCAUSE_INSTR_DATA_ERROR 12
  51. #define EXCCAUSE_LOAD_STORE_DATA_ERROR 13
  52. #define EXCCAUSE_INSTR_ADDR_ERROR 14
  53. #define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15
  54. #define EXCCAUSE_ITLB_MISS 16
  55. #define EXCCAUSE_ITLB_MULTIHIT 17
  56. #define EXCCAUSE_ITLB_PRIVILEGE 18
  57. #define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
  58. #define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
  59. #define EXCCAUSE_DTLB_MISS 24
  60. #define EXCCAUSE_DTLB_MULTIHIT 25
  61. #define EXCCAUSE_DTLB_PRIVILEGE 26
  62. #define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
  63. #define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
  64. #define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
  65. #define EXCCAUSE_COPROCESSOR0_DISABLED 32
  66. #define EXCCAUSE_COPROCESSOR1_DISABLED 33
  67. #define EXCCAUSE_COPROCESSOR2_DISABLED 34
  68. #define EXCCAUSE_COPROCESSOR3_DISABLED 35
  69. #define EXCCAUSE_COPROCESSOR4_DISABLED 36
  70. #define EXCCAUSE_COPROCESSOR5_DISABLED 37
  71. #define EXCCAUSE_COPROCESSOR6_DISABLED 38
  72. #define EXCCAUSE_COPROCESSOR7_DISABLED 39
  73. /* PS register fields. */
  74. #define PS_WOE_BIT 18
  75. #define PS_CALLINC_SHIFT 16
  76. #define PS_CALLINC_MASK 0x00030000
  77. #define PS_OWB_SHIFT 8
  78. #define PS_OWB_WIDTH 4
  79. #define PS_OWB_MASK 0x00000F00
  80. #define PS_RING_SHIFT 6
  81. #define PS_RING_MASK 0x000000C0
  82. #define PS_UM_BIT 5
  83. #define PS_EXCM_BIT 4
  84. #define PS_INTLEVEL_SHIFT 0
  85. #define PS_INTLEVEL_WIDTH 4
  86. #define PS_INTLEVEL_MASK 0x0000000F
  87. /* DBREAKCn register fields. */
  88. #define DBREAKC_MASK_BIT 0
  89. #define DBREAKC_MASK_MASK 0x0000003F
  90. #define DBREAKC_LOAD_BIT 30
  91. #define DBREAKC_LOAD_MASK 0x40000000
  92. #define DBREAKC_STOR_BIT 31
  93. #define DBREAKC_STOR_MASK 0x80000000
  94. /* DEBUGCAUSE register fields. */
  95. #define DEBUGCAUSE_DBNUM_MASK 0xf00
  96. #define DEBUGCAUSE_DBNUM_SHIFT 8 /* First bit of DBNUM field */
  97. #define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
  98. #define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
  99. #define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
  100. #define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
  101. #define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
  102. #define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
  103. #endif /* _XTENSA_SPECREG_H */