zephyr/arch/riscv/core
Jimmy Zheng 3804387350 arch: riscv: handle interrupt level for CLIC
CLIC supports mintstatus.MIL (RO) and mcause.MPIL (RW) for the current
interrupt level and the previous interrut level before a trap. Each ISR
must execute MRET to set mcause.MPIL back to mintstatus.MIL.

This commit introduces CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL to handle
mcause.MPIL for interrupt preemption in nested ISR, and uses
CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL to ensure ISR always switch out
with MRET.

e.g.
  With CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL=n, a context-switch in
  ISR may skip MRET in this flow:
  IRQ -> _isr_wrapper -> z_riscv_switch() -> retrun to arch_switch()

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-02-05 17:48:45 +01:00
..
offsets arch: riscv: handle interrupt level for CLIC 2025-02-05 17:48:45 +01:00
asm_macros.inc
CMakeLists.txt arch: riscv: smp: allow other IPI implementation 2024-11-16 13:34:10 -05:00
coredump.c riscv: support dumping privilege stack during coredump 2024-09-21 11:29:39 +02:00
cpu_idle.c arch: use same syntax for custom arch calls 2024-08-12 12:43:36 +02:00
elf.c llext: Fix off-by-one in RISC-V truncation check 2025-01-10 14:47:39 +01:00
fatal.c arch: riscv: Rename _Fault to z_riscv_fault 2025-01-28 23:42:06 +01:00
fpu.c Revert "arch: deprecate _current" 2025-01-10 07:49:08 +01:00
fpu.S
ipi_clint.c arch: riscv64: smp: get msip base address from dts 2024-11-27 06:58:57 -05:00
ipi.c arch: riscv: smp: allow other IPI implementation 2024-11-16 13:34:10 -05:00
irq_manage.c arch: riscv: add an option for empty spurious interrupt handler 2024-09-02 12:35:57 -04:00
irq_offload.c arch: initialize irq_offload during boot, do not use SYS_INIT 2024-09-17 20:05:22 -04:00
isr.S arch: riscv: handle interrupt level for CLIC 2025-02-05 17:48:45 +01:00
pmp.c Revert "arch: deprecate _current" 2025-01-10 07:49:08 +01:00
pmp.S
prep_c.c cache: add new interface arch_cache_init() for initializing cache 2024-09-17 20:05:22 -04:00
reboot.c
reset.S arch: riscv: fill all IRQ stacks with 0xAA 2024-09-13 09:17:34 +02:00
semihost.c
smp.c init: support per-core init hook 2024-11-16 14:04:25 -05:00
stacktrace.c Revert "arch: deprecate _current" 2025-01-10 07:49:08 +01:00
switch.S
thread.c arch: riscv: handle interrupt level for CLIC 2025-02-05 17:48:45 +01:00
tls.c
userspace.S
vector_table.ld