summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/MMU.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2023-01-07 11:59:37 +0100
committerLinus Groh <mail@linusgroh.de>2023-01-24 14:54:44 +0000
commit150c52e420caef53418c6b245306f2914971346a (patch)
tree94ae9d7c628b366f37e9bff0b6164ebbd6c7b90f /Kernel/Arch/aarch64/MMU.cpp
parent69c49b3d00b937891bac3c2f9a82a5ee511edb0b (diff)
downloadserenity-150c52e420caef53418c6b245306f2914971346a.zip
Kernel/aarch64: Add {panic,dbgln}_without_mmu
And use it the code that will be part of the early boot process. The PANIC macro and dbgln functions cannot be used as it accesses global variables, which in the early boot process do not work, since the MMU is not yet enabled.
Diffstat (limited to 'Kernel/Arch/aarch64/MMU.cpp')
-rw-r--r--Kernel/Arch/aarch64/MMU.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Kernel/Arch/aarch64/MMU.cpp b/Kernel/Arch/aarch64/MMU.cpp
index 4d6ea8ac36..53e00af0be 100644
--- a/Kernel/Arch/aarch64/MMU.cpp
+++ b/Kernel/Arch/aarch64/MMU.cpp
@@ -46,17 +46,17 @@ public:
, m_current(start)
{
if (m_start >= m_end) {
- PANIC("Invalid memory range passed to PageBumpAllocator");
+ panic_without_mmu("Invalid memory range passed to PageBumpAllocator"sv);
}
if ((FlatPtr)m_start % PAGE_TABLE_SIZE != 0 || (FlatPtr)m_end % PAGE_TABLE_SIZE != 0) {
- PANIC("Memory range passed into PageBumpAllocator not aligned to PAGE_TABLE_SIZE");
+ panic_without_mmu("Memory range passed into PageBumpAllocator not aligned to PAGE_TABLE_SIZE"sv);
}
}
u64* take_page()
{
if (m_current == m_end) {
- PANIC("Prekernel pagetable memory exhausted");
+ panic_without_mmu("Prekernel pagetable memory exhausted"sv);
}
u64* page = m_current;
@@ -221,8 +221,11 @@ static u64* get_page_directory(u64* root_table, VirtualAddress virtual_addr)
static void setup_kernel_page_directory(u64* root_table)
{
- boot_pd_kernel = PhysicalAddress((PhysicalPtr)get_page_directory(root_table, VirtualAddress { kernel_mapping_base }));
- VERIFY(!boot_pd_kernel.is_null());
+ auto kernel_page_directory = (PhysicalPtr)get_page_directory(root_table, VirtualAddress { kernel_mapping_base });
+ if (!kernel_page_directory)
+ panic_without_mmu("Could not find kernel page directory!"sv);
+
+ boot_pd_kernel = PhysicalAddress(kernel_page_directory);
}
void init_page_tables()