This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch releases/12.6
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/releases/12.6 by this push:
new 7a865b2479 riscv/pmp: add all region in NAPOT
7a865b2479 is described below
commit 7a865b247969a9dbc06eddcaf58c59a14dd05d6d
Author: Yanfeng Liu <[email protected]>
AuthorDate: Fri Jun 28 05:42:39 2024 +0800
riscv/pmp: add all region in NAPOT
This allows using 0 base and size to depict the whole region.
Signed-off-by: Yanfeng Liu <[email protected]>
---
arch/risc-v/src/common/riscv_pmp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/risc-v/src/common/riscv_pmp.c
b/arch/risc-v/src/common/riscv_pmp.c
index 97b39b8fe8..718cb4e693 100644
--- a/arch/risc-v/src/common/riscv_pmp.c
+++ b/arch/risc-v/src/common/riscv_pmp.c
@@ -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)