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
Notes: sideshowbarker 2024-07-19 13:50:08 +09:00
10 changed files with 79 additions and 46 deletions

View file

@ -35,7 +35,7 @@ KResultOr<Region*> InodeFile::mmap(Process& process, LinearAddress preferred_lad
region_name = "Memory-mapped file";
#endif
InterruptDisabler disabler;
auto* region = process.allocate_file_backed_region(preferred_laddr, size, inode(), move(region_name), prot & PROT_READ, prot & PROT_WRITE);
auto* region = process.allocate_file_backed_region(preferred_laddr, size, inode(), move(region_name), prot);
if (!region)
return KResult(-ENOMEM);
return region;