[PATCH 085/112] efi: payload: early-mem: use EFI_PAGE_SIZE instead of PAGE_SIZE
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Jan 3 10:12:45 PST 2024
Maybe one day we'll support 16K or 64K pages, but EFI_PAGE_SIZE as used
by EFI_ALLOCATE_PAGES is always in units of 4K pages, so let's use the
correct defines.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
efi/payload/early-mem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/efi/payload/early-mem.c b/efi/payload/early-mem.c
index f9bf562c98ad..b4e8790a39c4 100644
--- a/efi/payload/early-mem.c
+++ b/efi/payload/early-mem.c
@@ -4,7 +4,6 @@
#include <linux/sizes.h>
#include <efi.h>
#include <efi/efi-payload.h>
-#include <linux/pagemap.h>
efi_physical_addr_t efi_earlymem_alloc(const struct efi_system_table *sys_table,
size_t *memsize)
@@ -17,7 +16,7 @@ efi_physical_addr_t efi_earlymem_alloc(const struct efi_system_table *sys_table,
for (*memsize = SZ_256M; *memsize >= SZ_8M; *memsize /= 2) {
efiret = bs->allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
EFI_LOADER_DATA,
- *memsize/PAGE_SIZE, &mem);
+ *memsize / EFI_PAGE_SIZE, &mem);
if (!EFI_ERROR(efiret) || efiret != EFI_OUT_OF_RESOURCES)
break;
}
--
2.39.2
More information about the barebox
mailing list