[UEFI] Kernel/initrd use dedicated EFI memory map types
@@ -71,7 +71,7 @@ uint64_t kernel_map_elf(const char* kernel_filename, pml4e_t* vas_state) {
int segment_size_page_padded = ROUND_TO_NEXT_PAGE(phdr->p_memsz);
int page_count = segment_size_page_padded / PAGE_SIZE;
printf("\tAllocating %ld pages for ELF segment %ld\n", page_count, i);
- efi_status_t status = BS->AllocatePages(AllocateAnyPages, EfiLoaderCode, page_count, &segment_phys_base);
+ efi_status_t status = BS->AllocatePages(AllocateAnyPages, EFI_MEMORY_TYPE_AXLE_KERNEL_IMAGE, page_count, &segment_phys_base);
if (EFI_ERROR(status)) {
printf("Failed to map kernel segment at requested address\n");
printf("Status: %ld\n", status);
@@ -109,7 +109,7 @@ bool initrd_map(const char* initrd_path, uint64_t* out_base, uint64_t* out_size)
uint64_t initrd_page_count = (initrd_size / PAGE_SIZE) + 1;
printf("Initrd size 0x%p, page count %ld\n", initrd_size, initrd_page_count);
efi_physical_address_t initrd_buf = 0;
- efi_status_t status = BS->AllocatePages(AllocateAnyPages, EfiRuntimeServicesData, initrd_page_count, &initrd_buf);
+ efi_status_t status = BS->AllocatePages(AllocateAnyPages, EFI_MEMORY_TYPE_AXLE_INITRD, initrd_page_count, &initrd_buf);
if (EFI_ERROR(status)) {
printf("Failed to allocate memory for initrd! %ld\n", status);
return false;
