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:
Nicholas Piggin
2026-04-30 14:55:23 +10:00
committed by Anup Patel
parent 8f1a6164f2
commit f7738cc1e5
3 changed files with 11 additions and 5 deletions
+9
View File
@@ -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)
{