mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 05:05:08 +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:
parent
e852a69a06
commit
07f3d09c55
13 changed files with 84 additions and 91 deletions
|
@ -1419,10 +1419,9 @@ ErrorOr<void> Thread::make_thread_specific_region(Badge<Process>)
|
|||
if (!process().m_master_tls_region)
|
||||
return {};
|
||||
|
||||
auto range = TRY(process().address_space().try_allocate_range({}, thread_specific_region_size()));
|
||||
auto* region = TRY(process().address_space().allocate_region(range, "Thread-specific", PROT_READ | PROT_WRITE));
|
||||
auto* region = TRY(process().address_space().allocate_region({}, thread_specific_region_size(), PAGE_SIZE, "Thread-specific", PROT_READ | PROT_WRITE));
|
||||
|
||||
m_thread_specific_range = range;
|
||||
m_thread_specific_range = region->range();
|
||||
|
||||
SmapDisabler disabler;
|
||||
auto* thread_specific_data = (ThreadSpecificData*)region->vaddr().offset(align_up_to(process().m_master_tls_size, thread_specific_region_alignment())).as_ptr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue