6 #define INTERRUPT_LEVEL(n) glue3(XCHAL_INT, n, _LEVEL)
8 .macro make_ccount_delta target, delta
11 sub \delta, \target, \delta
12 slli \delta, \delta, CCOUNT_SHIFT
13 add \target, \target, \delta
41 #if INTERRUPT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1
42 #define TIMER0_VECTOR kernel
44 #define TIMER0_VECTOR glue(level, INTERRUPT_LEVEL(XCHAL_TIMER0_INTERRUPT))
47 #if XCHAL_NUM_TIMERS > 1
48 #if INTERRUPT_LEVEL(XCHAL_TIMER1_INTERRUPT) == 1
49 #define TIMER1_VECTOR kernel
51 #define TIMER1_VECTOR glue(level, INTERRUPT_LEVEL(XCHAL_TIMER1_INTERRUPT))
55 #if XCHAL_NUM_TIMERS > 2
56 #if INTERRUPT_LEVEL(XCHAL_TIMER2_INTERRUPT) == 1
57 #define TIMER2_VECTOR kernel
59 #define TIMER2_VECTOR glue(level, INTERRUPT_LEVEL(XCHAL_TIMER2_INTERRUPT))
63 test ccount_update_deadline
69 #if XCHAL_NUM_TIMERS > 1
72 #if XCHAL_NUM_TIMERS > 2
84 movi a3, 1 << XCHAL_TIMER0_INTERRUPT
94 #if XCHAL_NUM_TIMERS > 1
97 #if XCHAL_NUM_TIMERS > 2
101 make_ccount_delta a2, a15
115 test ccompare0_interrupt
116 set_vector TIMER0_VECTOR, 2f
122 #if XCHAL_NUM_TIMERS > 1
125 #if XCHAL_NUM_TIMERS > 2
130 make_ccount_delta a2, a15
136 movi a2, 1 << XCHAL_TIMER0_INTERRUPT
144 #if INTERRUPT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1
146 assert eqi, a2, 4 /* LEVEL1_INTERRUPT_CAUSE */
150 #if XCHAL_NUM_TIMERS > 1
152 test ccompare1_interrupt
153 set_vector TIMER1_VECTOR, 2f
160 #if XCHAL_NUM_TIMERS > 2
165 make_ccount_delta a2, a15
170 movi a2, 1 << XCHAL_TIMER1_INTERRUPT
172 rsil a2, INTERRUPT_LEVEL(XCHAL_TIMER1_INTERRUPT) - 1
178 #if INTERRUPT_LEVEL(XCHAL_TIMER1_INTERRUPT) == 1
180 assert eqi, a2, 4 /* LEVEL1_INTERRUPT_CAUSE */
185 #if XCHAL_NUM_TIMERS > 2
187 test ccompare2_interrupt
188 set_vector TIMER2_VECTOR, 2f
198 make_ccount_delta a2, a15
203 movi a2, 1 << XCHAL_TIMER2_INTERRUPT
205 rsil a2, INTERRUPT_LEVEL(XCHAL_TIMER2_INTERRUPT) - 1
211 #if INTERRUPT_LEVEL(XCHAL_TIMER2_INTERRUPT) == 1
213 assert eqi, a2, 4 /* LEVEL1_INTERRUPT_CAUSE */
219 test ccompare_interrupt_masked
220 set_vector TIMER0_VECTOR, 2f
226 #if XCHAL_NUM_TIMERS > 2
231 make_ccount_delta a2, a15
232 #if XCHAL_NUM_TIMERS > 1
241 movi a2, 1 << XCHAL_TIMER0_INTERRUPT
250 #if INTERRUPT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1
252 assert eqi, a2, 4 /* LEVEL1_INTERRUPT_CAUSE */
256 test ccompare_interrupt_masked_waiti
257 set_vector TIMER0_VECTOR, 2f
263 #if XCHAL_NUM_TIMERS > 2
267 make_ccount_delta a2, a15
268 #if XCHAL_NUM_TIMERS > 1
277 movi a2, 1 << XCHAL_TIMER0_INTERRUPT
282 #if INTERRUPT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1
284 assert eqi, a2, 4 /* LEVEL1_INTERRUPT_CAUSE */