3 #define LSBIT(v) ((v) & -(v))
5 #define LEVEL_MASK(x) glue3(XCHAL_INTLEVEL, x, _MASK)
6 #define LEVEL_SOFT_MASK(x) (LEVEL_MASK(x) & XCHAL_INTTYPE_MASK_SOFTWARE)
8 #define L1_SOFT_MASK LEVEL_SOFT_MASK(1)
9 #define L1_SOFT LSBIT(L1_SOFT_MASK)
11 #if LEVEL_SOFT_MASK(2)
12 #define HIGH_LEVEL_SOFT_MASK LEVEL_SOFT_MASK(2)
13 #elif LEVEL_SOFT_MASK(3)
14 #define HIGH_LEVEL_SOFT_MASK LEVEL_SOFT_MASK(3)
15 #elif LEVEL_SOFT_MASK(4)
16 #define HIGH_LEVEL_SOFT_MASK LEVEL_SOFT_MASK(4)
17 #elif LEVEL_SOFT_MASK(5)
18 #define HIGH_LEVEL_SOFT_MASK LEVEL_SOFT_MASK(5)
19 #elif LEVEL_SOFT_MASK(6)
20 #define HIGH_LEVEL_SOFT_MASK LEVEL_SOFT_MASK(6)
22 #define HIGH_LEVEL_SOFT_MASK 0
25 #define HIGH_LEVEL_SOFT LSBIT(HIGH_LEVEL_SOFT_MASK)
27 #if LEVEL_SOFT_MASK(2)
28 #define HIGH_LEVEL_SOFT_LEVEL 2
29 #elif LEVEL_SOFT_MASK(3)
30 #define HIGH_LEVEL_SOFT_LEVEL 3
31 #elif LEVEL_SOFT_MASK(4)
32 #define HIGH_LEVEL_SOFT_LEVEL 4
33 #elif LEVEL_SOFT_MASK(5)
34 #define HIGH_LEVEL_SOFT_LEVEL 5
35 #elif LEVEL_SOFT_MASK(6)
36 #define HIGH_LEVEL_SOFT_LEVEL 6
38 #define HIGH_LEVEL_SOFT_LEVEL 0
43 #if XCHAL_HAVE_INTERRUPTS
45 .macro clear_interrupts
51 #if XCHAL_NUM_TIMERS > 1
54 #if XCHAL_NUM_TIMERS > 2
68 movi a3, 0x1f /* EXCM | INTMASK */
70 assert eqi, a2, 0x10 /* only EXCM is set for level-1 interrupt */
100 movi a4, ~XCHAL_INTTYPE_MASK_TIMER
115 set_vector kernel, 1f
122 movi a4, ~XCHAL_INTTYPE_MASK_TIMER
134 set_vector kernel, 1f
141 movi a4, ~XCHAL_INTTYPE_MASK_TIMER
153 set_vector kernel, 1f
160 movi a4, ~XCHAL_INTTYPE_MASK_TIMER
171 set_vector kernel, 1f
179 movi a4, ~XCHAL_INTTYPE_MASK_TIMER
197 set_vector kernel, 1f
198 set_vector glue(level, HIGH_LEVEL_SOFT_LEVEL), 2f
201 movi a2, L1_SOFT | HIGH_LEVEL_SOFT
211 movi a3, 0x1f /* EXCM | INTMASK */
213 movi a3, 0x10 | HIGH_LEVEL_SOFT_LEVEL
214 assert eq, a2, a3 /* EXCM and INTMASK are set
215 for high-priority interrupt */
222 set_vector glue(level, HIGH_LEVEL_SOFT_LEVEL), 3f
226 movi a2, L1_SOFT_MASK | HIGH_LEVEL_SOFT_MASK
237 rsr a2, glue(eps, HIGH_LEVEL_SOFT_LEVEL)
239 rsr a2, glue(epc, HIGH_LEVEL_SOFT_LEVEL)
245 wsr a2, glue(epc, HIGH_LEVEL_SOFT_LEVEL)
246 movi a2, 0x40000 | HIGH_LEVEL_SOFT_LEVEL
247 wsr a2, glue(eps, HIGH_LEVEL_SOFT_LEVEL)
248 rfi HIGH_LEVEL_SOFT_LEVEL
252 movi a3, 0x40000 | HIGH_LEVEL_SOFT_LEVEL