1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

Kernel: Make the Process allocate_region* API's understand "int prot".

Instead of having to inspect 'prot' at every call site, make the Process
API's take care of that so we can just pass it through.
This commit is contained in:
Andreas Kling 2019-05-30 16:14:37 +02:00
parent 8fe72d7b3c
commit baaede1bf9
10 changed files with 79 additions and 46 deletions

View file

@ -403,7 +403,7 @@ RetainPtr<Region> MemoryManager::allocate_kernel_region(size_t size, String&& na
ASSERT(!(size % PAGE_SIZE));
auto range = kernel_page_directory().range_allocator().allocate_anywhere(size);
ASSERT(range.is_valid());
auto region = adopt(*new Region(range, move(name), true, true, false));
auto region = adopt(*new Region(range, move(name), PROT_READ | PROT_WRITE | PROT_EXEC, false));
MM.map_region_at_address(*m_kernel_page_directory, *region, range.base(), false);
// FIXME: It would be cool if these could zero-fill on demand instead.
region->commit();