diff options
author | Andreas Kling <kling@serenityos.org> | 2022-04-03 17:12:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-03 21:51:58 +0200 |
commit | 07f3d09c55226bd3f2e1ad7139521268a347d136 (patch) | |
tree | 26e9e4b3f4bea1fd317004e83f9063bd8d315141 /Kernel/Memory/RegionTree.h | |
parent | e852a69a069de6176cd6ff3534d5a606d383f396 (diff) | |
download | serenity-07f3d09c55226bd3f2e1ad7139521268a347d136.zip |
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.
Diffstat (limited to 'Kernel/Memory/RegionTree.h')
-rw-r--r-- | Kernel/Memory/RegionTree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Memory/RegionTree.h b/Kernel/Memory/RegionTree.h index 560a4f2aa0..ec1aa82ee0 100644 --- a/Kernel/Memory/RegionTree.h +++ b/Kernel/Memory/RegionTree.h @@ -37,6 +37,8 @@ public: ErrorOr<void> place_anywhere(Region&, size_t size, size_t alignment = PAGE_SIZE); ErrorOr<void> place_specifically(Region&, VirtualRange const&); + ErrorOr<NonnullOwnPtr<Memory::Region>> create_identity_mapped_region(PhysicalAddress, size_t); + ErrorOr<VirtualRange> try_allocate_anywhere(size_t size, size_t alignment = PAGE_SIZE); ErrorOr<VirtualRange> try_allocate_specific(VirtualAddress base, size_t size); ErrorOr<VirtualRange> try_allocate_randomized(size_t size, size_t alignment = PAGE_SIZE); |