Clean and document header files.

- Add missing doc comments to header files
- Move allocate_kernel_args to main.cpp
- Split functions out into pointer_manipulation.h
This commit is contained in:
Justin C. Miller
2020-05-10 01:42:22 -07:00
parent 9aa749e877
commit 10c8f6e4b5
11 changed files with 191 additions and 102 deletions

View File

@@ -1,8 +1,9 @@
#include <stddef.h>
#include <uefi/types.h>
#include "kernel_args.h"
#include "error.h"
#include "console.h"
#include "error.h"
#include "memory.h"
namespace boot {
@@ -146,31 +147,6 @@ memory_virtualize(EFI_RUNTIME_SERVICES *runsvc, struct memory_map *map)
}
*/
kernel::args::header *
allocate_args_structure(uefi::boot_services *bs, size_t max_modules)
{
status_line status(L"Setting up kernel args memory");
kernel::args::header *args = nullptr;
size_t args_size =
sizeof(kernel::args::header) + // The header itself
max_modules * sizeof(kernel::args::module); // The module structures
try_or_raise(
bs->allocate_pool(args_type, args_size,
reinterpret_cast<void**>(&args)),
L"Could not allocate argument memory");
bs->set_mem(args, args_size, 0);
args->modules =
reinterpret_cast<kernel::args::module*>(args + 1);
args->num_modules = 0;
return args;
}
efi_mem_map
get_mappings(uefi::boot_services *bs)
{