You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/10/09 15:59:32 UTC
[nuttx] branch master updated: riscv-v/pgalloc.h: Return kernel vaddr for kernel RAM paddr
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 3e8575c39e riscv-v/pgalloc.h: Return kernel vaddr for kernel RAM paddr
3e8575c39e is described below
commit 3e8575c39e0078ca710cee36e7e1e4059efbf24b
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Wed Oct 4 15:57:29 2023 +0300
riscv-v/pgalloc.h: Return kernel vaddr for kernel RAM paddr
All kernel memory is mapped paddr=vaddr, so it is trivial to give mapping
for kernel memory. Only interesting region should be kernel RAM, so omit
kernel ROM and don't allow re-mapping it.
---
arch/risc-v/src/common/pgalloc.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/risc-v/src/common/pgalloc.h b/arch/risc-v/src/common/pgalloc.h
index 40da298056..be39da0d3a 100644
--- a/arch/risc-v/src/common/pgalloc.h
+++ b/arch/risc-v/src/common/pgalloc.h
@@ -75,6 +75,10 @@ static inline uintptr_t riscv_pgvaddr(uintptr_t paddr)
{
return paddr - CONFIG_ARCH_PGPOOL_PBASE + CONFIG_ARCH_PGPOOL_VBASE;
}
+ else if (paddr >= CONFIG_RAM_START && paddr < CONFIG_RAM_END)
+ {
+ return paddr - CONFIG_RAM_START + CONFIG_RAM_VSTART;
+ }
return 0;
}