Lines Matching full:irq

26 	/* Zephyr multilevel-encoded IRQ */
27 uint32_t irq; member
39 /* Third level IRQ's interrupt controller */
41 /* IRQ of the third level interrupt aggregator */
42 uint32_t irq: CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS; member
45 /* Second level IRQ's interrupt controller */
47 /* IRQ of the second level interrupt aggregator */
48 uint32_t irq: CONFIG_1ST_LEVEL_INTERRUPT_BITS; member
54 static inline uint32_t _z_l1_irq(_z_irq_t irq) in _z_l1_irq() argument
56 return irq.bits.l1; in _z_l1_irq()
59 static inline uint32_t _z_l2_irq(_z_irq_t irq) in _z_l2_irq() argument
61 return irq.bits.l2 - 1; in _z_l2_irq()
64 static inline uint32_t _z_l3_irq(_z_irq_t irq) in _z_l3_irq() argument
66 return irq.bits.l3 - 1; in _z_l3_irq()
83 * @brief Return IRQ level
86 * @param irq IRQ number in its zephyr format
88 * @return 1 if IRQ level 1, 2 if IRQ level 2, 3 if IRQ level 3
90 static inline unsigned int irq_get_level(unsigned int irq) in irq_get_level() argument
93 .irq = irq, in irq_get_level()
102 * This routine returns the second level irq number of the zephyr irq
105 * @param irq IRQ number in its zephyr format
107 * @return 2nd level IRQ number
109 static inline unsigned int irq_from_level_2(unsigned int irq) in irq_from_level_2() argument
112 .irq = irq, in irq_from_level_2()
119 * @brief Preprocessor macro to convert `irq` from level 1 to level 2 format
121 * @param irq IRQ number in its zephyr format
123 * @return 2nd level IRQ number
125 #define IRQ_TO_L2(irq) ((irq + 1) << CONFIG_1ST_LEVEL_INTERRUPT_BITS) argument
128 * @brief Converts irq from level 1 to level 2 format
131 * This routine converts the input into the level 2 irq number format
135 * @param irq IRQ number in its zephyr format
137 * @return 2nd level IRQ number
139 static inline unsigned int irq_to_level_2(unsigned int irq) in irq_to_level_2() argument
144 .l2 = irq + 1, in irq_to_level_2()
149 return z_irq.irq; in irq_to_level_2()
153 * @brief Returns the parent IRQ of the level 2 raw IRQ number
158 * @param irq IRQ number in its zephyr format
160 * @return 2nd level IRQ parent
162 static inline unsigned int irq_parent_level_2(unsigned int irq) in irq_parent_level_2() argument
165 .irq = irq, in irq_parent_level_2()
175 * This routine returns the third level irq number of the zephyr irq
178 * @param irq IRQ number in its zephyr format
180 * @return 3rd level IRQ number
182 static inline unsigned int irq_from_level_3(unsigned int irq) in irq_from_level_3() argument
185 .irq = irq, in irq_from_level_3()
192 * @brief Preprocessor macro to convert `irq` from level 1 to level 3 format
194 * @param irq IRQ number in its zephyr format
196 * @return 3rd level IRQ number
198 #define IRQ_TO_L3(irq) \ argument
199 ((irq + 1) << (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS))
202 * @brief Converts irq from level 1 to level 3 format
205 * This routine converts the input into the level 3 irq number format
209 * @param irq IRQ number in its zephyr format
211 * @return 3rd level IRQ number
213 static inline unsigned int irq_to_level_3(unsigned int irq) in irq_to_level_3() argument
219 .l3 = irq + 1, in irq_to_level_3()
223 return z_irq.irq; in irq_to_level_3()
227 * @brief Returns the parent IRQ of the level 3 raw IRQ number
232 * @param irq IRQ number in its zephyr format
234 * @return 3rd level IRQ parent
236 static inline unsigned int irq_parent_level_3(unsigned int irq) in irq_parent_level_3() argument
239 .irq = irq, in irq_parent_level_3()
248 * @param irq IRQ number in its zephyr format
249 * @param level IRQ level
251 * @return IRQ number in the level
253 static inline unsigned int irq_from_level(unsigned int irq, unsigned int level) in irq_from_level() argument
256 return irq; in irq_from_level()
258 return irq_from_level_2(irq); in irq_from_level()
260 return irq_from_level_3(irq); in irq_from_level()
265 return irq; in irq_from_level()
269 * @brief Converts irq from level 1 to a given level
271 * @param irq IRQ number in its zephyr format
272 * @param level IRQ level
274 * @return Converted IRQ number in the level
276 static inline unsigned int irq_to_level(unsigned int irq, unsigned int level) in irq_to_level() argument
279 return irq; in irq_to_level()
281 return irq_to_level_2(irq); in irq_to_level()
283 return irq_to_level_3(irq); in irq_to_level()
288 return irq; in irq_to_level()
292 * @brief Returns the parent IRQ of the given level raw IRQ number
294 * @param irq IRQ number in its zephyr format
295 * @param level IRQ level
297 * @return IRQ parent of the given level
299 static inline unsigned int irq_parent_level(unsigned int irq, unsigned int level) in irq_parent_level() argument
303 return irq; in irq_parent_level()
305 return irq_parent_level_2(irq); in irq_parent_level()
307 return irq_parent_level_3(irq); in irq_parent_level()
312 return irq; in irq_parent_level()
316 * @brief Returns the parent interrupt controller IRQ of the given IRQ number
318 * @param irq IRQ number in its zephyr format
320 * @return IRQ of the interrupt controller
322 static inline unsigned int irq_get_intc_irq(unsigned int irq) in irq_get_intc_irq() argument
324 const unsigned int level = irq_get_level(irq); in irq_get_intc_irq()
328 .irq = irq, in irq_get_intc_irq()
332 return z_irq.l3_intc.irq; in irq_get_intc_irq()
334 return z_irq.l2_intc.irq; in irq_get_intc_irq()
336 return irq; in irq_get_intc_irq()
341 * @brief Increments the multilevel-encoded @a irq by @a val
343 * @param irq IRQ number in its zephyr format
346 * @return @a irq incremented by @a val
348 static inline unsigned int irq_increment(unsigned int irq, unsigned int val) in irq_increment() argument
351 .irq = irq, in irq_increment()
362 return z_irq.irq; in irq_increment()