diff options
| author | Clément Léger <[email protected]> | 2024-10-18 10:40:06 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-10-25 23:58:58 +0530 |
| commit | b2f77f5fa839ab8d55be295b5681848299c9e758 (patch) | |
| tree | 4a4030384412de904111ae93a7375cd528c93d57 /include | |
| parent | b0a7e4b85301a59f717cb420e3db1006b6fdfb6b (diff) | |
lib: sbi: fwft: factorize menvcfg read/write
MENVCFG access will be used as well for double trap, landing pad and
shadow stack fwft support. Factorize that in a common function.
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 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h index 22644274..fd34ba76 100644 --- a/include/sbi/riscv_encoding.h +++ b/include/sbi/riscv_encoding.h @@ -214,7 +214,8 @@ #define ENVCFG_STCE (_ULL(1) << 63) #define ENVCFG_PBMTE (_ULL(1) << 62) -#define ENVCFG_ADUE (_ULL(1) << 61) +#define ENVCFG_ADUE_SHIFT 61 +#define ENVCFG_ADUE (_ULL(1) << ENVCFG_ADUE_SHIFT) #define ENVCFG_CDE (_ULL(1) << 60) #define ENVCFG_DTE (_ULL(1) << 59) #define ENVCFG_PMM (_ULL(0x3) << 32) @@ -228,8 +229,10 @@ #define ENVCFG_CBIE_ILL _UL(0x0) #define ENVCFG_CBIE_FLUSH _UL(0x1) #define ENVCFG_CBIE_INV _UL(0x3) -#define ENVCFG_SSE (_UL(1) << 3) -#define ENVCFG_LPE (_UL(1) << 2) +#define ENVCFG_SSE_SHIFT 3 +#define ENVCFG_SSE (_UL(1) << ENVCFG_SSE_SHIFT) +#define ENVCFG_LPE_SHIFT 2 +#define ENVCFG_LPE (_UL(1) << ENVCFG_LPE_SHIFT) #define ENVCFG_FIOM _UL(0x1) /* ===== User-level CSRs ===== */ |
