This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 2cd1fd11450b3aa74a5765a9472669b2e0d2aee5
Author: Ville Juven <ville.ju...@unikie.com>
AuthorDate: Wed Sep 27 15:04:00 2023 +0300

    risc-v/pgalloc.h: Add SHM area to riscv_uservaddr query
    
    If the vaddr resides within the user's SHM, it is a user memory mapping.
---
 arch/risc-v/src/common/pgalloc.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/risc-v/src/common/pgalloc.h b/arch/risc-v/src/common/pgalloc.h
index 8619038ac7..40da298056 100644
--- a/arch/risc-v/src/common/pgalloc.h
+++ b/arch/risc-v/src/common/pgalloc.h
@@ -95,7 +95,11 @@ static inline bool riscv_uservaddr(uintptr_t vaddr)
    * heap, or stack regions.
    */
 
-  return vaddr >= ARCH_ADDRENV_VBASE && vaddr < ARCH_ADDRENV_VEND;
+  return ((vaddr >= ARCH_ADDRENV_VBASE && vaddr < ARCH_ADDRENV_VEND)
+#ifdef CONFIG_ARCH_VMA_MAPPING
+       || (vaddr >= CONFIG_ARCH_SHM_VBASE && vaddr < ARCH_SHM_VEND)
+#endif
+      );
 }
 
 /****************************************************************************

Reply via email to