mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 21:00:06 +00:00
Kernel: Make kernel region allocators return KResultOr<NOP<Region>>
This expands the reach of error propagation greatly throughout the kernel. Sadly, it also exposes the fact that we're allocating (and doing other fallible things) in constructors all over the place. This patch doesn't attempt to address that of course. That's work for our future selves.
This commit is contained in:
@@ -28,8 +28,9 @@ void ContiguousFramebufferConsole::set_resolution(size_t width, size_t height, s
|
||||
m_pitch = pitch;
|
||||
|
||||
dbgln("Framebuffer Console: taking {} bytes", Memory::page_round_up(pitch * height));
|
||||
m_framebuffer_region = MM.allocate_kernel_region(m_framebuffer_address, Memory::page_round_up(pitch * height), "Framebuffer Console", Memory::Region::Access::ReadWrite, Memory::Region::Cacheable::Yes);
|
||||
VERIFY(m_framebuffer_region);
|
||||
auto region_or_error = MM.allocate_kernel_region(m_framebuffer_address, Memory::page_round_up(pitch * height), "Framebuffer Console", Memory::Region::Access::ReadWrite, Memory::Region::Cacheable::Yes);
|
||||
VERIFY(!region_or_error.is_error());
|
||||
m_framebuffer_region = region_or_error.release_value();
|
||||
|
||||
// Just to start cleanly, we clean the entire framebuffer
|
||||
memset(m_framebuffer_region->vaddr().as_ptr(), 0, pitch * height);
|
||||
|
||||
Reference in New Issue
Block a user