[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

@@ -4,6 +4,7 @@
#include <uefi/boot_services.h>
#include <uefi/runtime_services.h>
#include <stdint.h>
#include "kernel_args.h"
#include "pointer_manipulation.h"
namespace boot {
@@ -78,7 +79,13 @@ struct efi_mem_map
};
/// Get the memory map from UEFI.
efi_mem_map get_mappings(uefi::boot_services *bs);
efi_mem_map get_uefi_mappings(uefi::boot_services *bs);
/// Add the kernel's memory map as a module to the kernel args.
void build_kernel_mem_map(
efi_mem_map &efi_map,
kernel::args::header *args,
uefi::boot_services *bs);
} // namespace boot
} // namespace memory