From 31fecad46d1461c3bc6a4ef6d6aa461a19c1d78e Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Tue, 29 Mar 2022 19:25:36 +0530 Subject: lib: sbi: Detect menvcfg CSR at boot time We add the menvcfg CSR as a HART feature and detect it at boot time using traping mechanism. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Reviewed-by: Xiang W --- include/sbi/sbi_hart.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index a83b45b9..57f80bc0 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -26,9 +26,11 @@ enum sbi_hart_features { SBI_HART_HAS_TIME = (1 << 4), /** HART has AIA local interrupt CSRs */ SBI_HART_HAS_AIA = (1 << 5), + /** HART has menvcfg CSR */ + SBI_HART_HAS_MENVCFG = (1 << 6), /** Last index of Hart features*/ - SBI_HART_HAS_LAST_FEATURE = SBI_HART_HAS_AIA, + SBI_HART_HAS_LAST_FEATURE = SBI_HART_HAS_MENVCFG, }; struct sbi_scratch; -- cgit v1.3.1