mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: Extend sbi_trap_redirect() for hypervisor extension
When hypervisor extension is available, we can get traps from VS/VU modes. We should be able to force redirect some of these traps to HS-mode. In other words, we should be able forward traps from VS/VU mode to HS-mode using sbi_trap_redirect() hence this patch. Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
@@ -80,8 +80,10 @@
|
||||
#define SBI_TRAP_REGS_mepc 32
|
||||
/** Index of mstatus member in sbi_trap_regs */
|
||||
#define SBI_TRAP_REGS_mstatus 33
|
||||
/** Index of mstatusH member in sbi_trap_regs */
|
||||
#define SBI_TRAP_REGS_mstatusH 34
|
||||
/** Last member index in sbi_trap_regs */
|
||||
#define SBI_TRAP_REGS_last 34
|
||||
#define SBI_TRAP_REGS_last 35
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
@@ -164,6 +166,8 @@ struct sbi_trap_regs {
|
||||
unsigned long mepc;
|
||||
/** mstatus register state */
|
||||
unsigned long mstatus;
|
||||
/** mstatusH register state (only for 32-bit) */
|
||||
unsigned long mstatusH;
|
||||
} __packed;
|
||||
|
||||
struct sbi_scratch;
|
||||
|
Reference in New Issue
Block a user