aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_image_loader.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-10-22 08:56:45 -0400
committerTom Rini <trini@konsulko.com>2021-10-22 12:43:30 -0400
commitf055f2e5a2038002519e5b9affbf259345f4ade9 (patch)
tree2388e5ea59e1e246d8f51b680d04861178f9608f /lib/efi_loader/efi_image_loader.c
parent06685f9de2c1ae37cd015848d245f8a59cbc93dc (diff)
parentaf484011f12e2aa37bcf4f9cbb4258dea4ef14ac (diff)
Merge tag 'efi-2022-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-01-rc1 Documentation: Use Sphinx 3.43. Move system reset documentation to HTML UEFI: Fix linking EFI apps with LLVM Fix alignment of loaded image Correct simple network protocol test Code cleanup
Diffstat (limited to 'lib/efi_loader/efi_image_loader.c')
-rw-r--r--lib/efi_loader/efi_image_loader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index e9572d4d5d..eb95580538 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -898,9 +898,9 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
image_base = opt->ImageBase;
efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
handle->image_type = opt->Subsystem;
- virt_size = ALIGN(virt_size, opt->SectionAlignment);
- efi_reloc = efi_alloc(virt_size,
- loaded_image_info->image_code_type);
+ efi_reloc = efi_alloc_aligned_pages(virt_size,
+ loaded_image_info->image_code_type,
+ opt->SectionAlignment);
if (!efi_reloc) {
log_err("Out of memory\n");
ret = EFI_OUT_OF_RESOURCES;
@@ -914,9 +914,9 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
image_base = opt->ImageBase;
efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
handle->image_type = opt->Subsystem;
- virt_size = ALIGN(virt_size, opt->SectionAlignment);
- efi_reloc = efi_alloc(virt_size,
- loaded_image_info->image_code_type);
+ efi_reloc = efi_alloc_aligned_pages(virt_size,
+ loaded_image_info->image_code_type,
+ opt->SectionAlignment);
if (!efi_reloc) {
log_err("Out of memory\n");
ret = EFI_OUT_OF_RESOURCES;