mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
sbi: sbi_domain_context: Fix trap context for domain context switching
Save/restore sbi_trap_context during domain context switching to
ensure proper trap handling and isolation. This maintains correct
domain-specific state, avoiding context corruption.
Fixes: abea949721
("lib: sbi: Introduce trap context")
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Alvin Chang <alvinga@andestech.com>
Tested-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Yong Li <yong.li@intel.com>
Tested-by: Yong Li <yong.li@intel.com>
This commit is contained in:

committed by
Anup Patel

parent
a73ff043e9
commit
3a94a32580
@@ -14,7 +14,7 @@
|
||||
/** Context representation for a hart within a domain */
|
||||
struct sbi_context {
|
||||
/** Trap-related states such as GPRs, mepc, and mstatus */
|
||||
struct sbi_trap_regs regs;
|
||||
struct sbi_trap_context trap_ctx;
|
||||
|
||||
/** Supervisor status register */
|
||||
unsigned long sstatus;
|
||||
|
Reference in New Issue
Block a user