mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04:53 +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:
@@ -88,7 +88,10 @@ void NetworkTask_main(void*)
|
||||
};
|
||||
|
||||
size_t buffer_size = 64 * KiB;
|
||||
auto buffer_region = MM.allocate_kernel_region(buffer_size, "Kernel Packet Buffer", Memory::Region::Access::ReadWrite);
|
||||
auto region_or_error = MM.allocate_kernel_region(buffer_size, "Kernel Packet Buffer", Memory::Region::Access::ReadWrite);
|
||||
if (region_or_error.is_error())
|
||||
TODO();
|
||||
auto buffer_region = region_or_error.release_value();
|
||||
auto buffer = (u8*)buffer_region->vaddr().get();
|
||||
Time packet_timestamp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user