Kernel: Move Kernel/Memory/ code into Kernel::Memory namespace

This commit is contained in:
Andreas Kling 2021-08-06 13:49:36 +02:00
commit 93d98d4976
Notes: sideshowbarker 2024-07-18 07:24:58 +09:00
153 changed files with 473 additions and 467 deletions

View file

@ -93,14 +93,14 @@ KResult InodeFile::ioctl(FileDescription& description, unsigned request, Userspa
}
}
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& description, const Range& range, u64 offset, int prot, bool shared)
KResultOr<Memory::Region*> InodeFile::mmap(Process& process, FileDescription& description, Memory::Range const& range, u64 offset, int prot, bool shared)
{
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
RefPtr<InodeVMObject> vmobject;
RefPtr<Memory::InodeVMObject> vmobject;
if (shared)
vmobject = SharedInodeVMObject::try_create_with_inode(inode());
vmobject = Memory::SharedInodeVMObject::try_create_with_inode(inode());
else
vmobject = PrivateInodeVMObject::try_create_with_inode(inode());
vmobject = Memory::PrivateInodeVMObject::try_create_with_inode(inode());
if (!vmobject)
return ENOMEM;
return process.space().allocate_region_with_vmobject(range, vmobject.release_nonnull(), offset, description.absolute_path(), prot, shared);