diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-05-18 12:04:18 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-19 09:19:48 +0530 |
commit | a38bea9341a2da29bec00d5253ac71da8ca06bab (patch) | |
tree | 167a46716be4bd24d36b64c50412d11c63a15ce1 /include/sbi/sbi_hart.h | |
parent | 2966510eedf03e47e13f3e1a88039bd4199c1085 (diff) |
lib: sbi_hart: Detect number of supported PMP regions
It is not mandatory for a RISC-V systems to implement all PMP
regions so we have to check all PMPADDRx CSRs to determine excat
number of supported PMP regions.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi/sbi_hart.h')
-rw-r--r-- | include/sbi/sbi_hart.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index ac7a067..51c2c35 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -38,6 +38,10 @@ static inline ulong sbi_hart_expected_trap_addr(void) } void sbi_hart_delegation_dump(struct sbi_scratch *scratch); +unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch); +int sbi_hart_pmp_get(struct sbi_scratch *scratch, unsigned int n, + unsigned long *prot_out, unsigned long *addr_out, + unsigned long *size); void sbi_hart_pmp_dump(struct sbi_scratch *scratch); int sbi_hart_pmp_check_addr(struct sbi_scratch *scratch, unsigned long daddr, unsigned long attr); |