summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_trap.h
diff options
context:
space:
mode:
authorVivian Wang <dramforever@live.com>2022-08-04 17:32:27 +0300
committerAnup Patel <anup@brainfault.org>2022-08-22 06:19:29 +0300
commit9529e360dfca40feeb2471bdde990207d44d68e1 (patch)
treed247a378f4175a968c6a2cfa24a7bf3eba4125ba /include/sbi/sbi_trap.h
parenta6a85579b6f4ad74b638b6d770143a7029cf8f57 (diff)
downloadopensbi-9529e360dfca40feeb2471bdde990207d44d68e1.tar.xz
include: Add mstatus[h].GVA encodings
The machine mode GVA field is in mstatus for RV64 and mstatush for RV32, and is available if the hypervisor extension is available. If an exception occurs, we may need to redirect the trap to HS-mode, in which case, hstatus.GVA should be set to same as the machine mode GVA bit. Add MSTATUS_GVA for RV64, MSTATUSH_GVA for RV32, and their SHIFT encodings. The SHIFT index is helpful in assembly code, since field extraction can be implemented in only one register. In pseudocode: - For RV32: gva = (mstatus >> MSTATUS_GVA_SHIFT) & 1; - For RV64: gva = (mstatush >> MSTATUSH_GVA_SHIFT) & 1; Signed-off-by: Vivian Wang <dramforever@live.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include/sbi/sbi_trap.h')
0 files changed, 0 insertions, 0 deletions