Skip to content

Commit

Permalink
riscv/pmp: add all region in NAPOT
Browse files Browse the repository at this point in the history
This allows using 0 base and size to depict the whole region.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 authored and jerpelea committed Jul 24, 2024
1 parent 14da04e commit 1f29491
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/risc-v/src/common/riscv_pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ static bool pmp_check_region_attrs(uintptr_t base, uintptr_t size,

case PMPCFG_A_NAPOT:
{
/* Special range for the whole range */

if (base == 0 && size == 0)
{
return true;
}

/* For NAPOT, Naturally aligned power-of-two region, >= 8 bytes */

if ((base & 0x07) != 0 || size < 8 || (size & (size - 1)) != 0)
Expand Down

0 comments on commit 1f29491

Please sign in to comment.