summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2023-11-22 11:44:04 -0800
committerAnup Patel <[email protected]>2023-12-08 22:43:12 +0530
commit93da66b7d40605c3288ba05e70de8ef1914cdb60 (patch)
treea8bdf516af539f138492c5ea35b58b0c306da186 /include
parent07419ec84bc39d476a17f8b1450434e57407600d (diff)
lib: sbi_hart: Store PMP granularity as log base 2
This minimizes the need to call log2roundup() to recover the log value. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_hart.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
index 811e5f50..0aefc2be 100644
--- a/include/sbi/sbi_hart.h
+++ b/include/sbi/sbi_hart.h
@@ -73,7 +73,7 @@ struct sbi_hart_features {
unsigned long extensions[BITS_TO_LONGS(SBI_HART_EXT_MAX)];
unsigned int pmp_count;
unsigned int pmp_addr_bits;
- unsigned long pmp_gran;
+ unsigned int pmp_log2gran;
unsigned int mhpm_mask;
unsigned int mhpm_bits;
};
@@ -93,7 +93,7 @@ unsigned int sbi_hart_mhpm_mask(struct sbi_scratch *scratch);
void sbi_hart_delegation_dump(struct sbi_scratch *scratch,
const char *prefix, const char *suffix);
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_log2gran(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);