lib: sbi: Introduce trap context
authorAnup Patel <apatel@ventanamicro.com>
Mon, 11 Mar 2024 09:10:12 +0000 (14:40 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 19 Mar 2024 06:01:22 +0000 (11:31 +0530)
commitabea949721bc635cfe39e34adc501d7be87db8ae
tree35652f64f58ca8f33cc0545b05060b5fd65d879d
parent60ffc154c84dfe93b23bd02566310deb153a4360
lib: sbi: Introduce trap context

Club the struct sbi_trap_regs and struct sbi_trap_info a new
struct sbi_trap_context (aka trap context) which must be saved
by low-level trap handler before calling sbi_trap_handler().

To track nested traps, the struct sbi_scratch points to the current
trap context and the trap context has pointer to pervious context
of previous trap.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
Tested-by: Samuel Holland <samuel.holland@sifive.com>
firmware/fw_base.S
include/sbi/sbi_trap.h
lib/sbi/sbi_trap.c