Skip to content

Commit 1217656

Browse files
raffi-gcarlescufi
authored andcommitted
riscv: irq: Set prio for dynamic and direct irqs on clic
The irq priority has to be called for dynamic and direct irqs, too. For direct isrs, this was missing completely, for direct irqs just for the clic. For dynamic irqs, I replaced the current implementation with `z_riscv_irq_priority_set`. For the plic, this is exaclty the same. Signed-off-by: Greter Raffael <[email protected]>
1 parent 72758f9 commit 1217656

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

arch/riscv/core/irq_manage.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,12 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
4343
void (*routine)(const void *parameter),
4444
const void *parameter, uint32_t flags)
4545
{
46-
ARG_UNUSED(flags);
47-
4846
z_isr_install(irq, routine, parameter);
4947

50-
#if defined(CONFIG_RISCV_HAS_PLIC)
51-
if (irq_get_level(irq) == 2) {
52-
riscv_plic_set_priority(irq, priority);
53-
}
48+
#if defined(CONFIG_RISCV_HAS_PLIC) || defined(CONFIG_RISCV_HAS_CLIC)
49+
z_riscv_irq_priority_set(irq, priority, flags);
5450
#else
51+
ARG_UNUSED(flags);
5552
ARG_UNUSED(priority);
5653
#endif
5754
return irq;

include/zephyr/arch/riscv/irq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ extern void z_riscv_irq_priority_set(unsigned int irq,
7070
{ \
7171
Z_ISR_DECLARE(irq_p + CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET, \
7272
ISR_FLAG_DIRECT, isr_p, NULL); \
73+
z_riscv_irq_priority_set(irq_p, priority_p, flags_p); \
7374
}
7475

7576
#define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header()

0 commit comments

Comments
 (0)