1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

Kernel: Add RegionTree::find_region_containing(address or range)

Let's encapsulate looking up regions so clients don't have to dig into
RegionTree internals.
This commit is contained in:
Andreas Kling 2022-04-05 12:07:45 +02:00
parent da7ea2556e
commit cfb61cbd54
4 changed files with 25 additions and 15 deletions

View file

@ -54,6 +54,9 @@ public:
bool remove(Region&);
Region* find_region_containing(VirtualAddress);
Region* find_region_containing(VirtualRange);
private:
ErrorOr<VirtualRange> allocate_range_anywhere(size_t size, size_t alignment = PAGE_SIZE);
ErrorOr<VirtualRange> allocate_range_specific(VirtualAddress base, size_t size);