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

Kernel: Store a pointer to the owner process in PageDirectory

This replaces the previous owning address space pointer. This commit
should not change any of the existing functionality, but it lays down
the groundwork needed to let us properly access the region table under
the address space spinlock during page fault handling.
This commit is contained in:
Idan Horowitz 2023-04-04 21:06:14 +03:00
parent 65641187ff
commit 003989e1b0
9 changed files with 33 additions and 32 deletions

View file

@ -722,8 +722,11 @@ Region* MemoryManager::find_region_from_vaddr(VirtualAddress vaddr)
auto page_directory = PageDirectory::find_current();
if (!page_directory)
return nullptr;
VERIFY(page_directory->address_space());
return find_user_region_from_vaddr(*page_directory->address_space(), vaddr);
auto* process = page_directory->process();
VERIFY(process);
return process->address_space().with([&](auto& space) {
return find_user_region_from_vaddr(*space, vaddr);
});
}
PageFaultResponse MemoryManager::handle_page_fault(PageFault const& fault)