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

Kernel: Make VM allocation atomic for userspace regions

This patch move AddressSpace (the per-process memory manager) to using
the new atomic "place" APIs in RegionTree as well, just like we did for
MemoryManager in the previous commit.

This required updating quite a few places where VM allocation and
actually committing a Region object to the AddressSpace were separated
by other code.

All you have to do now is call into AddressSpace once and it'll take
care of everything for you.
This commit is contained in:
Andreas Kling 2022-04-03 17:12:39 +02:00
parent e852a69a06
commit 07f3d09c55
13 changed files with 84 additions and 91 deletions

View file

@ -77,7 +77,7 @@ bool MemoryManager::is_initialized()
static UNMAP_AFTER_INIT VirtualRange kernel_virtual_range()
{
auto kernel_range_start = kernel_mapping_base + 2 * MiB; // The first 2 MiB are used for mapping the pre-kernel
size_t kernel_range_start = kernel_mapping_base + 2 * MiB; // The first 2 MiB are used for mapping the pre-kernel
return VirtualRange { VirtualAddress(kernel_range_start), KERNEL_PD_END - kernel_range_start };
}