From 69d3eb6195fcc1750b3820f90e51aceaed26b45d Mon Sep 17 00:00:00 2001 From: Jimmy Brush Date: Fri, 18 Aug 2023 03:26:49 -0400 Subject: [PATCH] libsel4simple-default,riscv: implement irq_trigger Wire up simple->irq_trigger to seL4_IRQControl_GetTrigger on risc-v. This allows risc-v drivers in libplatsupport to register edge-triggered interrupts. Signed-off-by: Jimmy Brush --- libsel4simple-default/src/arch/riscv/default.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libsel4simple-default/src/arch/riscv/default.c b/libsel4simple-default/src/arch/riscv/default.c index 8dc63f267..c8684381d 100644 --- a/libsel4simple-default/src/arch/riscv/default.c +++ b/libsel4simple-default/src/arch/riscv/default.c @@ -15,14 +15,21 @@ #include -seL4_Error simple_default_get_irq(void *data, int irq, seL4_CNode root, seL4_Word index, uint8_t depth) { +seL4_Error simple_default_get_irq(void *data, int irq, seL4_CNode root, seL4_Word index, uint8_t depth) +{ return seL4_IRQControl_Get(seL4_CapIRQControl, irq, root, index, depth); } -void -simple_default_init_arch_simple(arch_simple_t *simple, void *data) +seL4_Error simple_default_get_irq_trigger(void *data, int irq, int trigger, UNUSED int core, seL4_CNode root, + seL4_Word index, uint8_t depth) +{ + return seL4_IRQControl_GetTrigger(seL4_CapIRQControl, irq, trigger, root, index, depth); +} + +void simple_default_init_arch_simple(arch_simple_t *simple, void *data) { simple->data = data; simple->irq = simple_default_get_irq; + simple->irq_trigger = simple_default_get_irq_trigger; }