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:
parent
cba44cc9dc
commit
3e8575c39e
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue