forked from Mirrors/opensbi
lib: sbi: Add support for Supervisor Software Events extension
This extension [1] allows to deliver events from SBI to supervisor via a software mechanism. This extension defines events (either local or global) which are signaled by the SBI on specific signal sources (IRQ, exceptions, etc) and are injected to be executed in supervisor mode. [1] https://lists.riscv.org/g/tech-prs/message/798 Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
76d7e9b8ee
commit
c8cdf01d8f
@@ -20,6 +20,7 @@
|
||||
#include <sbi/sbi_trap_ldst.h>
|
||||
#include <sbi/sbi_pmu.h>
|
||||
#include <sbi/sbi_scratch.h>
|
||||
#include <sbi/sbi_sse.h>
|
||||
#include <sbi/sbi_timer.h>
|
||||
#include <sbi/sbi_trap.h>
|
||||
|
||||
@@ -337,6 +338,10 @@ struct sbi_trap_context *sbi_trap_handler(struct sbi_trap_context *tcntx)
|
||||
trap_done:
|
||||
if (rc)
|
||||
sbi_trap_error(msg, rc, tcntx);
|
||||
|
||||
if (((regs->mstatus & MSTATUS_MPP) >> MSTATUS_MPP_SHIFT) != PRV_M)
|
||||
sbi_sse_process_pending_events(regs);
|
||||
|
||||
sbi_trap_set_context(scratch, tcntx->prev_context);
|
||||
return tcntx;
|
||||
}
|
||||
|
Reference in New Issue
Block a user