Kernel: Remove some Region construction helpers

It's now up to the caller to provide a VMObject when constructing a new
Region object. This will make it easier to handle things going wrong,
like allocation failures, etc.
This commit is contained in:
Andreas Kling 2020-03-01 11:02:22 +01:00
commit 88b334135b
Notes: sideshowbarker 2024-07-19 08:57:45 +09:00
4 changed files with 5 additions and 30 deletions

View file

@ -190,7 +190,8 @@ Region& Process::allocate_split_region(const Region& source_region, const Range&
Region* Process::allocate_region(const Range& range, const String& name, int prot, bool commit)
{
ASSERT(range.is_valid());
auto& region = add_region(Region::create_user_accessible(range, name, prot_to_region_access_flags(prot)));
auto vmobject = AnonymousVMObject::create_with_size(range.size());
auto& region = add_region(Region::create_user_accessible(range, vmobject, 0, name, prot_to_region_access_flags(prot)));
region.map(page_directory());
if (commit)
region.commit();