Lines Matching refs:irq

57 void swerv_pic_irq_enable(uint32_t irq)  in swerv_pic_irq_enable()  argument
61 if ((irq >= SWERV_PIC_MAX_ID) || (irq < RISCV_MAX_GENERIC_IRQ)) { in swerv_pic_irq_enable()
66 swerv_pic_write(SWERV_PIC_meie(irq - RISCV_MAX_GENERIC_IRQ), 1); in swerv_pic_irq_enable()
70 void swerv_pic_irq_disable(uint32_t irq) in swerv_pic_irq_disable() argument
74 if ((irq >= SWERV_PIC_MAX_ID) || (irq < RISCV_MAX_GENERIC_IRQ)) { in swerv_pic_irq_disable()
79 swerv_pic_write(SWERV_PIC_meie(irq - RISCV_MAX_GENERIC_IRQ), 0); in swerv_pic_irq_disable()
83 int swerv_pic_irq_is_enabled(uint32_t irq) in swerv_pic_irq_is_enabled() argument
85 if ((irq >= SWERV_PIC_MAX_ID) || (irq < RISCV_MAX_GENERIC_IRQ)) { in swerv_pic_irq_is_enabled()
89 return swerv_pic_read(SWERV_PIC_meie(irq - RISCV_MAX_GENERIC_IRQ)) in swerv_pic_irq_is_enabled()
93 void swerv_pic_set_priority(uint32_t irq, uint32_t priority) in swerv_pic_set_priority() argument
97 if (irq <= RISCV_MAX_GENERIC_IRQ) { in swerv_pic_set_priority()
101 if ((irq >= SWERV_PIC_MAX_ID) || (irq < RISCV_MAX_GENERIC_IRQ)) { in swerv_pic_set_priority()
110 swerv_pic_write(SWERV_PIC_meipl(irq - RISCV_MAX_GENERIC_IRQ), priority); in swerv_pic_set_priority()
122 uint32_t irq; in swerv_pic_irq_handler() local
129 irq = (tmp >> 2) & 0xff; in swerv_pic_irq_handler()
131 save_irq = irq; in swerv_pic_irq_handler()
133 if (irq == 0U || irq >= 64) { in swerv_pic_irq_handler()
136 irq += RISCV_MAX_GENERIC_IRQ; in swerv_pic_irq_handler()
139 ite = (struct _isr_table_entry *)&_sw_isr_table[irq]; in swerv_pic_irq_handler()
144 swerv_pic_write(SWERV_PIC_meigwclr(irq), 0); in swerv_pic_irq_handler()
192 void arch_irq_enable(unsigned int irq) in arch_irq_enable() argument
196 if (irq > RISCV_MAX_GENERIC_IRQ) { in arch_irq_enable()
197 swerv_pic_irq_enable(irq); in arch_irq_enable()
207 : "r" (1 << irq)); in arch_irq_enable()
210 void arch_irq_disable(unsigned int irq) in arch_irq_disable() argument
214 if (irq > RISCV_MAX_GENERIC_IRQ) { in arch_irq_disable()
215 swerv_pic_irq_disable(irq); in arch_irq_disable()
225 : "r" (1 << irq)); in arch_irq_disable()
228 int arch_irq_is_enabled(unsigned int irq) in arch_irq_is_enabled() argument
232 if (irq > RISCV_MAX_GENERIC_IRQ) { in arch_irq_is_enabled()
233 return swerv_pic_irq_is_enabled(irq); in arch_irq_is_enabled()
238 return !!(mie & (1 << irq)); in arch_irq_is_enabled()