1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

Kernel: Add PML4T support for the PageDirectory class

This commit is contained in:
Gunnar Beutner 2021-06-26 01:00:40 +02:00 committed by Andreas Kling
parent f5cd366006
commit 1e20dd2a45
2 changed files with 39 additions and 1 deletions

View file

@ -32,7 +32,14 @@ public:
~PageDirectory();
u32 cr3() const { return m_directory_table->paddr().get(); }
u32 cr3() const
{
#if ARCH(X86_64)
return m_pml4t->paddr().get();
#else
return m_directory_table->paddr().get();
#endif
}
RangeAllocator& range_allocator() { return m_range_allocator; }
const RangeAllocator& range_allocator() const { return m_range_allocator; }
@ -55,6 +62,9 @@ private:
Space* m_space { nullptr };
RangeAllocator m_range_allocator;
RangeAllocator m_identity_range_allocator;
#if ARCH(X86_64)
RefPtr<PhysicalPage> m_pml4t;
#endif
RefPtr<PhysicalPage> m_directory_table;
RefPtr<PhysicalPage> m_directory_pages[4];
HashMap<u32, RefPtr<PhysicalPage>> m_page_tables;