33 #ifndef XTENSA_COREBITS_H
34 #define XTENSA_COREBITS_H
37 #define EXCCAUSE_EXCCAUSE_SHIFT 0
38 #define EXCCAUSE_EXCCAUSE_MASK 0x3F
45 #define EXCCAUSE_ILLEGAL 0
46 #define EXCCAUSE_SYSCALL 1
47 #define EXCCAUSE_INSTR_ERROR 2
48 # define EXCCAUSE_IFETCHERROR 2
49 #define EXCCAUSE_LOAD_STORE_ERROR 3
50 # define EXCCAUSE_LOADSTOREERROR 3
51 #define EXCCAUSE_LEVEL1_INTERRUPT 4
52 # define EXCCAUSE_LEVEL1INTERRUPT 4
53 #define EXCCAUSE_ALLOCA 5
54 #define EXCCAUSE_DIVIDE_BY_ZERO 6
55 #define EXCCAUSE_SPECULATION 7
56 #define EXCCAUSE_PRIVILEGED 8
57 #define EXCCAUSE_UNALIGNED 9
59 #define EXCCAUSE_INSTR_DATA_ERROR 12
60 #define EXCCAUSE_LOAD_STORE_DATA_ERROR 13
61 #define EXCCAUSE_INSTR_ADDR_ERROR 14
62 #define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15
63 #define EXCCAUSE_ITLB_MISS 16
64 #define EXCCAUSE_ITLB_MULTIHIT 17
65 #define EXCCAUSE_INSTR_RING 18
67 #define EXCCAUSE_INSTR_PROHIBITED 20
69 #define EXCCAUSE_DTLB_MISS 24
70 #define EXCCAUSE_DTLB_MULTIHIT 25
71 #define EXCCAUSE_LOAD_STORE_RING 26
73 #define EXCCAUSE_LOAD_PROHIBITED 28
74 #define EXCCAUSE_STORE_PROHIBITED 29
76 #define EXCCAUSE_CP_DISABLED(n) (32+(n))
77 #define EXCCAUSE_CP0_DISABLED 32
78 #define EXCCAUSE_CP1_DISABLED 33
79 #define EXCCAUSE_CP2_DISABLED 34
80 #define EXCCAUSE_CP3_DISABLED 35
81 #define EXCCAUSE_CP4_DISABLED 36
82 #define EXCCAUSE_CP5_DISABLED 37
83 #define EXCCAUSE_CP6_DISABLED 38
84 #define EXCCAUSE_CP7_DISABLED 39
89 #define PS_WOE_SHIFT 18
90 #define PS_WOE_MASK 0x00040000
91 #define PS_WOE PS_WOE_MASK
92 #define PS_CALLINC_SHIFT 16
93 #define PS_CALLINC_MASK 0x00030000
94 #define PS_CALLINC(n) (((n)&3)<<PS_CALLINC_SHIFT)
95 #define PS_OWB_SHIFT 8
96 #define PS_OWB_MASK 0x00000F00
97 #define PS_OWB(n) (((n)&15)<<PS_OWB_SHIFT)
98 #define PS_RING_SHIFT 6
99 #define PS_RING_MASK 0x000000C0
100 #define PS_RING(n) (((n)&3)<<PS_RING_SHIFT)
101 #define PS_UM_SHIFT 5
102 #define PS_UM_MASK 0x00000020
103 #define PS_UM PS_UM_MASK
104 #define PS_EXCM_SHIFT 4
105 #define PS_EXCM_MASK 0x00000010
106 #define PS_EXCM PS_EXCM_MASK
107 #define PS_INTLEVEL_SHIFT 0
108 #define PS_INTLEVEL_MASK 0x0000000F
109 #define PS_INTLEVEL(n) ((n)&PS_INTLEVEL_MASK)
111 #define PS_PROGSTACK_SHIFT PS_UM_SHIFT
112 #define PS_PROGSTACK_MASK PS_UM_MASK
113 #define PS_PROG_SHIFT PS_UM_SHIFT
114 #define PS_PROG_MASK PS_UM_MASK
115 #define PS_PROG PS_UM
118 #define DBREAKC_MASK_SHIFT 0
119 #define DBREAKC_MASK_MASK 0x0000003F
120 #define DBREAKC_LOADBREAK_SHIFT 30
121 #define DBREAKC_LOADBREAK_MASK 0x40000000
122 #define DBREAKC_STOREBREAK_SHIFT 31
123 #define DBREAKC_STOREBREAK_MASK 0x80000000
126 #define DEBUGCAUSE_DEBUGINT_SHIFT 5
127 #define DEBUGCAUSE_DEBUGINT_MASK 0x20
128 #define DEBUGCAUSE_BREAKN_SHIFT 4
129 #define DEBUGCAUSE_BREAKN_MASK 0x10
130 #define DEBUGCAUSE_BREAK_SHIFT 3
131 #define DEBUGCAUSE_BREAK_MASK 0x08
132 #define DEBUGCAUSE_DBREAK_SHIFT 2
133 #define DEBUGCAUSE_DBREAK_MASK 0x04
134 #define DEBUGCAUSE_IBREAK_SHIFT 1
135 #define DEBUGCAUSE_IBREAK_MASK 0x02
136 #define DEBUGCAUSE_ICOUNT_SHIFT 0
137 #define DEBUGCAUSE_ICOUNT_MASK 0x01
140 #define MESR_MEME 0x00000001
141 #define MESR_MEME_SHIFT 0
142 #define MESR_DME 0x00000002
143 #define MESR_DME_SHIFT 1
144 #define MESR_RCE 0x00000010
145 #define MESR_RCE_SHIFT 4
147 #define MESR_LCE_SHIFT ?
149 #define MESR_ERRENAB 0x00000100
150 #define MESR_ERRENAB_SHIFT 8
151 #define MESR_ERRTEST 0x00000200
152 #define MESR_ERRTEST_SHIFT 9
153 #define MESR_DATEXC 0x00000400
154 #define MESR_DATEXC_SHIFT 10
155 #define MESR_INSEXC 0x00000800
156 #define MESR_INSEXC_SHIFT 11
157 #define MESR_WAYNUM_SHIFT 16
158 #define MESR_ACCTYPE_SHIFT 20
159 #define MESR_MEMTYPE_SHIFT 24
160 #define MESR_ERRTYPE_SHIFT 30