:: commit 8c75c55a92f64ca072ed202289cfb8cdfdba3d68

mintsuki <mintsuki@protonmail.com> — 2024-06-16 16:27

parents: 9fb6423002

misc/uefi: Switch from EfiLoaderData to EfiLoaderCode at 2 more allocation sites

diff --git a/common/entry.s3.c b/common/entry.s3.c
index 5f91c0d2..e6c6bde9 100644
--- a/common/entry.s3.c
+++ b/common/entry.s3.c
@@ -47,7 +47,7 @@ noreturn void uefi_entry(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         size_t new_base;
         for (new_base = 0x1000; new_base + (size_t)__image_size < 0x100000000; new_base += 0x1000) {
             EFI_PHYSICAL_ADDRESS _new_base = (EFI_PHYSICAL_ADDRESS)new_base;
-            status = gBS->AllocatePages(AllocateAddress, EfiLoaderData, image_size_pages, &_new_base);
+            status = gBS->AllocatePages(AllocateAddress, EfiLoaderCode, image_size_pages, &_new_base);
             if (status == 0) {
                 goto new_base_gotten;
             }
diff --git a/common/protos/chainload.c b/common/protos/chainload.c
index 594437eb..f59dda66 100644
--- a/common/protos/chainload.c
+++ b/common/protos/chainload.c
@@ -257,7 +257,7 @@ noreturn void efi_chainload_file(char *config, char *cmdline, struct file_handle
     memdev_path[0].Header.Length[0] = sizeof(MEMMAP_DEVICE_PATH);
     memdev_path[0].Header.Length[1] = sizeof(MEMMAP_DEVICE_PATH) >> 8;
 
-    memdev_path[0].MemoryType       = EfiLoaderData;
+    memdev_path[0].MemoryType       = EfiLoaderCode;
     memdev_path[0].StartingAddress  = (uintptr_t)ptr;
     memdev_path[0].EndingAddress    = (uintptr_t)ptr + image_size;
 
tab: 248 wrap: offon