mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
Kernel: Make Process::allocate_region*() return KResultOr<Region*>
This allows region allocation to return specific errors and we don't have to assume every failure is an ENOMEM.
This commit is contained in:
parent
7899e14e72
commit
64b0d89335
10 changed files with 70 additions and 79 deletions
|
@ -61,7 +61,7 @@ KResultOr<Region*> MBVGADevice::mmap(Process& process, FileDescription&, Virtual
|
|||
auto vmobject = AnonymousVMObject::create_for_physical_range(m_framebuffer_address, framebuffer_size_in_bytes());
|
||||
if (!vmobject)
|
||||
return KResult(-ENOMEM);
|
||||
auto* region = process.allocate_region_with_vmobject(
|
||||
return process.allocate_region_with_vmobject(
|
||||
preferred_vaddr,
|
||||
framebuffer_size_in_bytes(),
|
||||
vmobject.release_nonnull(),
|
||||
|
@ -69,10 +69,6 @@ KResultOr<Region*> MBVGADevice::mmap(Process& process, FileDescription&, Virtual
|
|||
"MBVGA Framebuffer",
|
||||
prot,
|
||||
shared);
|
||||
if (!region)
|
||||
return KResult(-ENOMEM);
|
||||
dbgln("MBVGADevice: mmap with size {} at {}", region->size(), region->vaddr());
|
||||
return region;
|
||||
}
|
||||
|
||||
int MBVGADevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue