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.
This commit is contained in:
Ville Juven 2023-10-04 15:57:29 +03:00 committed by Petro Karashchenko
parent cba44cc9dc
commit 3e8575c39e

View File

@ -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;
}