summaryrefslogtreecommitdiff
path: root/Kernel/Arch
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-06 01:36:14 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-06 01:55:27 +0200
commit75564b4a5f2b5452163571116ee9efaf5c3c65af (patch)
treeec672e92fcf3e7dca6ed51bce1c287319a9fc77d /Kernel/Arch
parentcb71a7370836c3b70038e2f718ee87f6fc286229 (diff)
downloadserenity-75564b4a5f2b5452163571116ee9efaf5c3c65af.zip
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.
Diffstat (limited to 'Kernel/Arch')
-rw-r--r--Kernel/Arch/PC/BIOS.cpp4
1 files changed, 2 insertions, 2 deletions
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;