diff options
| author | Clément Léger <[email protected]> | 2024-10-18 10:40:08 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-10-26 00:00:12 +0530 |
| commit | c46a937fd9071660979ff68e5c6310e62c9d1770 (patch) | |
| tree | e126795690adf22d8c1ee1c0188dd66661ee50ed /include | |
| parent | 3bc86854ab5e26de580433cf67ed47bae148d777 (diff) | |
lib: sbi: add Smdbltrp ISA extension support
Add support for the Smdbltrp[1] ISA extension. First thing to do is
clearing MDT on entry after setting the first MTVEC (since MDT is
reset to 1). Additionally, during trap handling, clear MDT once all
critical CSRs have been saved and in return path, restore MSTATUS/H
before restoring MEPC to avoid taking another trap which would clobber
it.
Link: https://github.com/riscv/riscv-double-trap/releases/download/v0.56/riscv-double-trap.pdf [1]
Signed-off-by: Clément Léger <[email protected]>
Reviewed-by: Samuel Holland <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/riscv_encoding.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h index 174cc9c1..38997ef4 100644 --- a/include/sbi/riscv_encoding.h +++ b/include/sbi/riscv_encoding.h @@ -42,7 +42,8 @@ #define MSTATUS_GVA _ULL(0x0000004000000000) #define MSTATUS_GVA_SHIFT 38 #define MSTATUS_MPV _ULL(0x0000008000000000) -#define MSTATUS_MPELP _ULL(0x0000020000000000) +#define MSTATUS_MPELP _ULL(0x0000020000000000) +#define MSTATUS_MDT _ULL(0x0000040000000000) #else #define MSTATUSH_SBE _UL(0x00000010) #define MSTATUSH_MBE _UL(0x00000020) @@ -50,6 +51,7 @@ #define MSTATUSH_GVA_SHIFT 6 #define MSTATUSH_MPV _UL(0x00000080) #define MSTATUSH_MPELP _UL(0x00000200) +#define MSTATUSH_MDT _UL(0x00000400) #endif #define MSTATUS32_SD _UL(0x80000000) #define MSTATUS64_SD _ULL(0x8000000000000000) |
