diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index ecbb4e0509e..8d08fe01f71 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -2296,11 +2296,20 @@ static EFI_STATUS initrd_prepare( return EFI_OUT_OF_RESOURCES; } +#if defined(__i386__) || defined(__x86_64__) _cleanup_pages_ Pages pages = xmalloc_pages( AllocateMaxAddress, EfiLoaderData, EFI_SIZE_TO_PAGES(size), UINT32_MAX /* Below 4G boundary. */); +#else + _cleanup_pages_ Pages pages = xmalloc_pages( + AllocateAnyPages, + EfiLoaderData, + EFI_SIZE_TO_PAGES(size), + 0 /* Ignored. */); +#endif + uint8_t *p = PHYSICAL_ADDRESS_TO_POINTER(pages.addr); STRV_FOREACH(i, entry->initrd) { diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 9aa605b7563..0d3df16ef6b 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -49,11 +49,20 @@ static EFI_STATUS combine_initrds( n += initrd_size; } +#if defined(__i386__) || defined(__x86_64__) _cleanup_pages_ Pages pages = xmalloc_pages( AllocateMaxAddress, EfiLoaderData, EFI_SIZE_TO_PAGES(n), UINT32_MAX /* Below 4G boundary. */); +#else + _cleanup_pages_ Pages pages = xmalloc_pages( + AllocateAnyPages, + EfiLoaderData, + EFI_SIZE_TO_PAGES(n), + 0 /* Ignored. */); +#endif + uint8_t *p = PHYSICAL_ADDRESS_TO_POINTER(pages.addr); for (size_t i = 0; i < n_initrds; i++) { if (!initrds[i])