summaryrefslogtreecommitdiff
path: root/kc/boot/kc_main.c
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-12-31 16:05:26 +0000
committerAda Christine <adachristine18@gmail.com>2021-12-31 16:05:26 +0000
commitc8c0c0c4a78ecdc1eb078ddc6b119137a9d30aa4 (patch)
treeb07a2e0d47b265d1d8c0aa46379cfb2fed149e63 /kc/boot/kc_main.c
parentf17e276729d8c3ed28978f8138fa9438db6bd0f9 (diff)
only map 64KiB past end of kernel. cleanup main_efi.c
Diffstat (limited to 'kc/boot/kc_main.c')
-rw-r--r--kc/boot/kc_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kc/boot/kc_main.c b/kc/boot/kc_main.c
index 36aad0c..c469d40 100644
--- a/kc/boot/kc_main.c
+++ b/kc/boot/kc_main.c
@@ -344,7 +344,8 @@ 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();
@@ -401,9 +402,8 @@ 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(2) + page_size(1) * 16) &
- ~(page_size(2) - 1);
+ uint64_t object_space_end = (uintptr_t)object_space_base +
+ page_size(1) * 16;
object_space_size = object_space_end -
(uintptr_t)object_space_base;