summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2021-07-10 19:18:05 +0300
committerAnup Patel <anup@brainfault.org>2021-07-11 07:43:04 +0300
commit0829f2bc284c07576a0dc9a569beea2a2d68dc3d (patch)
treee8356644ff35aad82bcca04a0cce4d6dd91f0e76 /include
parentd3a96cc46989783c2fbb47e11349dbd5d652938d (diff)
downloadopensbi-0829f2bc284c07576a0dc9a569beea2a2d68dc3d.tar.xz
lib: sbi: Detect number of bits implemented in mhpmcounter
RISC-V privilege specification allows the implementation to have less than 64 bits. Add a function to detect the number of implemented bits in mhpmcounter dynamically at runtime. Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_hart.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
index 9e317c5..0c18ef9 100644
--- a/include/sbi/sbi_hart.h
+++ b/include/sbi/sbi_hart.h
@@ -44,6 +44,7 @@ void sbi_hart_delegation_dump(struct sbi_scratch *scratch,
unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch);
unsigned long sbi_hart_pmp_granularity(struct sbi_scratch *scratch);
unsigned int sbi_hart_pmp_addrbits(struct sbi_scratch *scratch);
+unsigned int sbi_hart_mhpm_bits(struct sbi_scratch *scratch);
int sbi_hart_pmp_configure(struct sbi_scratch *scratch);
bool sbi_hart_has_feature(struct sbi_scratch *scratch, unsigned long feature);
void sbi_hart_get_features_str(struct sbi_scratch *scratch,