1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:15:07 +00:00

Kernel: Stop exposing RegionTree API for VM range allocation

...and remove the last remaining client of the API. It's no longer
possible to ask the RegionTree for a VM range. You can only ask it to
place your Region somewhere in available space.
This commit is contained in:
Andreas Kling 2022-04-03 17:31:58 +02:00
parent 07f3d09c55
commit e89c9ed2ca
2 changed files with 6 additions and 5 deletions

View file

@ -456,8 +456,9 @@ UNMAP_AFTER_INIT void MemoryManager::initialize_physical_pages()
// Allocate a virtual address range for our array
// This looks awkward, but it basically creates a dummy region to occupy the address range permanently.
auto range = MUST(m_region_tree.try_allocate_anywhere(physical_page_array_pages * PAGE_SIZE));
MUST(m_region_tree.place_specifically(*MUST(Region::create_unbacked()).leak_ptr(), range));
auto& region = *MUST(Region::create_unbacked()).leak_ptr();
MUST(m_region_tree.place_anywhere(region, physical_page_array_pages * PAGE_SIZE));
auto range = region.range();
// Now that we have our special m_physical_pages_region region with enough pages to hold the entire array
// try to map the entire region into kernel space so we always have it