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 pkarashchenko committed Jul 24, 2024
1 parent 0e832f4 commit 7a865b2
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 7a865b2

Please sign in to comment.