[boot] Split get_uefi_mappings and module creation

The `get_mappings()` function was getting too large, and some of its
output is needed by more than just the building of the kernel map. Split
it out into two.

Tags: boot memory
This commit is contained in:
Justin C. Miller
2020-05-10 16:43:18 -07:00
parent c713f4ff6f
commit 2bd91c2d94
3 changed files with 27 additions and 10 deletions

View File

@@ -171,7 +171,9 @@ bootloader_main_uefi(uefi::handle image, uefi::system_table *st, console &con)
loader::loaded_elf kernel_elf =
loader::load(kernel->location, kernel->size, bs);
memory::get_mappings(bs);
memory::efi_mem_map efi_map = memory::get_uefi_mappings(bs);
memory::build_kernel_mem_map(efi_map, args, bs);
return kernel_elf;
}