summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-05-18 09:34:18 +0300
committerAnup Patel <anup@brainfault.org>2020-05-19 06:49:48 +0300
commita38bea9341a2da29bec00d5253ac71da8ca06bab (patch)
tree167a46716be4bd24d36b64c50412d11c63a15ce1 /include/sbi
parent2966510eedf03e47e13f3e1a88039bd4199c1085 (diff)
downloadopensbi-a38bea9341a2da29bec00d5253ac71da8ca06bab.tar.xz
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')
-rw-r--r--include/sbi/sbi_hart.h4
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);