Lines Matching full:irq

22 #include <zephyr/irq.h>
58 * @brief return edge irq value or zero
60 * In the event edge irq is enable this will return the trigger
61 * value of the irq. In the event edge irq is not supported this
64 * @param irq IRQ number to add to the trigger
66 * @return irq value when enabled 0 otherwise
68 static int riscv_plic_is_edge_irq(uint32_t irq) in riscv_plic_is_edge_irq() argument
72 trig += (irq >> PLIC_EDGE_TRIG_SHIFT); in riscv_plic_is_edge_irq()
73 return *trig & BIT(irq); in riscv_plic_is_edge_irq()
84 * @param irq IRQ number to enable
86 void riscv_plic_irq_enable(uint32_t irq) in riscv_plic_irq_enable() argument
92 en += (irq >> 5); in riscv_plic_irq_enable()
93 *en |= (1 << (irq & 31)); in riscv_plic_irq_enable()
105 * @param irq IRQ number to disable
107 void riscv_plic_irq_disable(uint32_t irq) in riscv_plic_irq_disable() argument
113 en += (irq >> 5); in riscv_plic_irq_disable()
114 *en &= ~(1 << (irq & 31)); in riscv_plic_irq_disable()
122 * @param irq IRQ number to check
126 int riscv_plic_irq_is_enabled(uint32_t irq) in riscv_plic_irq_is_enabled() argument
130 en += (irq >> 5); in riscv_plic_irq_is_enabled()
131 return !!(*en & (1 << (irq & 31))); in riscv_plic_irq_is_enabled()
141 * @param irq IRQ number for which to set priority
142 * @param priority Priority of IRQ to set to
144 void riscv_plic_set_priority(uint32_t irq, uint32_t priority) in riscv_plic_set_priority() argument
151 prio += irq; in riscv_plic_set_priority()
173 uint32_t irq; in plic_irq_handler() local
177 /* Get the IRQ number generating the interrupt */ in plic_irq_handler()
178 irq = regs->claim_complete; in plic_irq_handler()
181 * Save IRQ in save_irq. To be used, if need be, by in plic_irq_handler()
183 * as IRQ number held by the claim_complete register is in plic_irq_handler()
186 save_irq = irq; in plic_irq_handler()
189 * If the IRQ is out of range, call z_irq_spurious. in plic_irq_handler()
192 if (irq == 0U || irq >= PLIC_IRQS) in plic_irq_handler()
195 edge_irq = riscv_plic_is_edge_irq(irq); in plic_irq_handler()
199 * to indicate to the PLIC controller that the IRQ has been handled in plic_irq_handler()
205 irq += CONFIG_2ND_LVL_ISR_TBL_OFFSET; in plic_irq_handler()
207 /* Call the corresponding IRQ handler in _sw_isr_table */ in plic_irq_handler()
208 ite = (struct _isr_table_entry *)&_sw_isr_table[irq]; in plic_irq_handler()
213 * PLIC controller that the IRQ has been handled in plic_irq_handler()
249 /* Setup IRQ handler for PLIC driver */ in plic_init()
256 /* Enable IRQ for PLIC driver */ in plic_init()