arch: riscv: add z_riscv_irq_vector_set() to set vector ISR

Introduce z_riscv_irq_vector_set() to hook into ARCH_IRQ_DIRECT_CONNECT(),
allowing users to set vector mode for a specified ISR.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
This commit is contained in:
Jimmy Zheng 2024-08-05 10:35:18 +08:00 committed by Carles Cufí
parent 2f143fb2c1
commit 9ec596674b
1 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,12 @@ extern void z_riscv_irq_priority_set(unsigned int irq,
#define z_riscv_irq_priority_set(i, p, f) /* Nothing */
#endif /* CONFIG_RISCV_HAS_PLIC || CONFIG_RISCV_HAS_CLIC */
#ifdef CONFIG_RISCV_HAS_CLIC
extern void z_riscv_irq_vector_set(unsigned int irq);
#else
#define z_riscv_irq_vector_set(i) /* Nothing */
#endif /* CONFIG_RISCV_HAS_CLIC */
#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
{ \
Z_ISR_DECLARE(irq_p + CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET, \
@ -74,6 +80,7 @@ extern void z_riscv_irq_priority_set(unsigned int irq,
Z_ISR_DECLARE_DIRECT(irq_p + CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET, \
ISR_FLAG_DIRECT, isr_p); \
z_riscv_irq_priority_set(irq_p, priority_p, flags_p); \
z_riscv_irq_vector_set(irq_p); \
}
#define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header()