diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2022-09-21 16:16:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-10-01 14:09:01 +0200 |
commit | a62732ee2f029ca388b358e3cc013df9f1951d9d (patch) | |
tree | cc58112e736798d9fb122cb6278e2c767cd63f49 /Kernel/Memory/MemoryManager.cpp | |
parent | cdf59c86ac0fa2b38af3ec0217913cab19153ab3 (diff) | |
download | serenity-a62732ee2f029ca388b358e3cc013df9f1951d9d.zip |
Kernel/aarch64: Only identity map kernel image, instead of all of RAM
For the initial page tables we only need to identity map the kernel
image, the rest of the memory will be managed by the MemoryManager. The
linker script is updated to get the kernel image start and end
addresses.
Diffstat (limited to 'Kernel/Memory/MemoryManager.cpp')
-rw-r--r-- | Kernel/Memory/MemoryManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index 5710235f62..33fb51c806 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -72,8 +72,14 @@ bool MemoryManager::is_initialized() static UNMAP_AFTER_INIT VirtualRange kernel_virtual_range() { +#if ARCH(AARCH64) + // NOTE: We currently identity map the kernel image for aarch64, so the kernel virtual range + // is the complete memory range. + return VirtualRange { VirtualAddress((FlatPtr)0), 0x3F000000 }; +#else 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 }; +#endif } MemoryManager::GlobalData::GlobalData() |