mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
Kernel/riscv64: Return correct range in kernel_virtual_range
on RISC-V
riscv64 doesn't use a prekernel, so use the same code as aarch64 for determining the kernel virtual address range.
This commit is contained in:
parent
0379742d7e
commit
28a3089dc3
1 changed files with 6 additions and 4 deletions
|
@ -69,12 +69,14 @@ bool MemoryManager::is_initialized()
|
|||
|
||||
static UNMAP_AFTER_INIT VirtualRange kernel_virtual_range()
|
||||
{
|
||||
#if ARCH(AARCH64)
|
||||
// NOTE: This is not the same as x86_64, because the aarch64 kernel currently doesn't use the pre-kernel.
|
||||
return VirtualRange { VirtualAddress(kernel_mapping_base), KERNEL_PD_END - kernel_mapping_base };
|
||||
#else
|
||||
#if ARCH(X86_64)
|
||||
size_t kernel_range_start = kernel_mapping_base + 2 * MiB; // The first 2 MiB are used for mapping the pre-kernel
|
||||
return VirtualRange { VirtualAddress(kernel_range_start), KERNEL_PD_END - kernel_range_start };
|
||||
#elif ARCH(AARCH64) || ARCH(RISCV64)
|
||||
// NOTE: This is not the same as x86_64, because the aarch64 and riscv64 kernels currently don't use the pre-kernel.
|
||||
return VirtualRange { VirtualAddress(kernel_mapping_base), KERNEL_PD_END - kernel_mapping_base };
|
||||
#else
|
||||
# error Unknown architecture
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue