diff options
| author | Ada Christine <adachristine18@gmail.com> | 2021-12-31 16:05:54 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2021-12-31 16:05:54 +0000 |
| commit | 9310e46afa3779aed0a3cb2340ec5d2531a0de90 (patch) | |
| tree | 16923a1ff48497c07fc1b65529d5395b50d7a0f6 /kc/boot/kc_main.c | |
| parent | c8c0c0c4a78ecdc1eb078ddc6b119137a9d30aa4 (diff) | |
Revert "only map 64KiB past end of kernel. cleanup main_efi.c"
This reverts commit c8c0c0c4a78ecdc1eb078ddc6b119137a9d30aa4.
Diffstat (limited to 'kc/boot/kc_main.c')
| -rw-r--r-- | kc/boot/kc_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kc/boot/kc_main.c b/kc/boot/kc_main.c index c469d40..36aad0c 100644 --- a/kc/boot/kc_main.c +++ b/kc/boot/kc_main.c @@ -344,8 +344,7 @@ static EFI_STATUS enter_kernel(Elf64_Ehdr *ehdr) set_page_map(system_page_map); k_boot_data = (struct kc_boot_data *)object_space_base; - k_boot_data->object_space.base = sizeof(*k_boot_data) + - (char *)object_space_base; + k_boot_data->object_space.base = sizeof(*k_boot_data) + (char *)object_space_base; k_boot_data->object_space.size = object_space_size; convert_memory_map(); @@ -402,8 +401,9 @@ EFI_STATUS kc_main(struct efi_loader_interface *interface) // it is not necessary to know the actual size of this object // as it will be overlaid with a virtual address space // upon kernel initialization. - uint64_t object_space_end = (uintptr_t)object_space_base + - page_size(1) * 16; + uint64_t object_space_end = ((uintptr_t)object_space_base + + page_size(2) + page_size(1) * 16) & + ~(page_size(2) - 1); object_space_size = object_space_end - (uintptr_t)object_space_base; |
