1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Kernel: Remove "supervisor" bit from PhysicalPage

Instead of each PhysicalPage knowing whether it comes from the
supervisor pages or from the user pages, we can just check in both
sets when freeing a page.

It's just a handful of pointer range checks, nothing expensive.
This commit is contained in:
Andreas Kling 2021-07-11 23:12:32 +02:00
parent ac78f1e812
commit c2792212f4
9 changed files with 39 additions and 53 deletions

View file

@ -47,7 +47,7 @@ UNMAP_AFTER_INIT void PageDirectory::allocate_kernel_directory()
#if ARCH(X86_64)
PhysicalAddress boot_pml4t_paddr(virtual_to_low_physical((FlatPtr)boot_pml4t));
dmesgln("MM: boot_pml4t @ {}", boot_pml4t_paddr);
m_pml4t = PhysicalPage::create(boot_pml4t_paddr, true, false);
m_pml4t = PhysicalPage::create(boot_pml4t_paddr, false);
#endif
PhysicalAddress boot_pdpt_paddr(virtual_to_low_physical((FlatPtr)boot_pdpt));
PhysicalAddress boot_pd0_paddr(virtual_to_low_physical((FlatPtr)boot_pd0));
@ -55,9 +55,9 @@ UNMAP_AFTER_INIT void PageDirectory::allocate_kernel_directory()
dmesgln("MM: boot_pdpt @ {}", boot_pdpt_paddr);
dmesgln("MM: boot_pd0 @ {}", boot_pd0_paddr);
dmesgln("MM: boot_pd3 @ {}", boot_pd3_paddr);
m_directory_table = PhysicalPage::create(boot_pdpt_paddr, true, false);
m_directory_pages[0] = PhysicalPage::create(boot_pd0_paddr, true, false);
m_directory_pages[3] = PhysicalPage::create(boot_pd3_paddr, true, false);
m_directory_table = PhysicalPage::create(boot_pdpt_paddr, false);
m_directory_pages[0] = PhysicalPage::create(boot_pd0_paddr, false);
m_directory_pages[3] = PhysicalPage::create(boot_pd3_paddr, false);
}
PageDirectory::PageDirectory(const RangeAllocator* parent_range_allocator)