mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-06-12 22:31:45 +01:00
lib: sbi: Add sbi_pmp_is_enabled() helper
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260430045528.420437-7-npiggin@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
8f1a6164f2
commit
f7738cc1e5
@@ -28,6 +28,15 @@ static unsigned long ctz(unsigned long x)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool sbi_pmp_is_enabled(pmp_t *pmp)
|
||||
{
|
||||
/* If address matching bits are non-zero, the entry is enable */
|
||||
if (pmp->cfg & PMP_A)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int sbi_pmp_encode(pmp_t *pmp, unsigned long prot, unsigned long addr,
|
||||
unsigned long log2len)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user