mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel/aarch64: Change MMU::kernel_virtual_range to high virtual memory
This was previously hardcoded this to be the physical memory range, since we identity mapped the memory, however we now run the kernel at a high virtual memory address. Also changes PageDirectory.h to store up-to 512 pages, as the code now needs access to more than 4 pages.
This commit is contained in:
parent
5db32ecbe1
commit
5e00bb0b9f
Notes:
sideshowbarker
2024-07-17 01:19:03 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/5e00bb0b9f Pull-request: https://github.com/SerenityOS/serenity/pull/16884 Reviewed-by: https://github.com/48cf Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/mrkct Reviewed-by: https://github.com/nico ✅
2 changed files with 2 additions and 7 deletions
|
@ -72,9 +72,8 @@ 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 };
|
||||
// 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
|
||||
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 };
|
||||
|
|
|
@ -67,11 +67,7 @@ private:
|
|||
RefPtr<PhysicalPage> m_pml4t;
|
||||
#endif
|
||||
RefPtr<PhysicalPage> m_directory_table;
|
||||
#if ARCH(X86_64)
|
||||
RefPtr<PhysicalPage> m_directory_pages[512];
|
||||
#else
|
||||
RefPtr<PhysicalPage> m_directory_pages[4];
|
||||
#endif
|
||||
RecursiveSpinlock<LockRank::None> m_lock {};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue