From 75564b4a5f2b5452163571116ee9efaf5c3c65af Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 Sep 2021 01:36:14 +0200 Subject: Kernel: Make kernel region allocators return KResultOr> 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. --- Kernel/Arch/PC/BIOS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Kernel/Arch') diff --git a/Kernel/Arch/PC/BIOS.cpp b/Kernel/Arch/PC/BIOS.cpp index fb4d941d5e..40a96b7839 100644 --- a/Kernel/Arch/PC/BIOS.cpp +++ b/Kernel/Arch/PC/BIOS.cpp @@ -162,7 +162,7 @@ Memory::MappedROM map_bios() Memory::MappedROM mapping; mapping.size = 128 * KiB; mapping.paddr = PhysicalAddress(0xe0000); - mapping.region = MM.allocate_kernel_region(mapping.paddr, Memory::page_round_up(mapping.size), {}, Memory::Region::Access::Read); + mapping.region = MM.allocate_kernel_region(mapping.paddr, Memory::page_round_up(mapping.size), {}, Memory::Region::Access::Read).release_value(); return mapping; } @@ -176,7 +176,7 @@ Memory::MappedROM map_ebda() size_t ebda_size = (*ebda_length_ptr_b1 << 8) | *ebda_length_ptr_b0; Memory::MappedROM mapping; - mapping.region = MM.allocate_kernel_region(ebda_paddr.page_base(), Memory::page_round_up(ebda_size), {}, Memory::Region::Access::Read); + mapping.region = MM.allocate_kernel_region(ebda_paddr.page_base(), Memory::page_round_up(ebda_size), {}, Memory::Region::Access::Read).release_value(); mapping.offset = ebda_paddr.offset_in_page(); mapping.size = ebda_size; mapping.paddr = ebda_paddr; -- cgit v1.2.3