efi_loader: round the memory area in efi_add_memory_map()
Virtually all callers of this function do the rounding on their own.
Some do it right, some don't. Instead of doing this in each caller,
do the rounding in efi_add_memory_map(). Change the size parameter
to bytes instead of pages and remove aligning and size calculation in
all callers.
There is no more need to make the original efi_add_memory_map() (which
takes pages as size) available outside the module. Thus rename it to
efi_add_memory_map_pg() and make it static to prevent further misuse
outside the module.
Signed-off-by: Michael Walle <michael@walle.cc>
Add missing comma in sunxi_display.c.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 06573b1..9849eb4 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -151,14 +151,10 @@
static void efi_reserve_memory(u64 addr, u64 size)
{
- u64 pages;
-
/* Convert from sandbox address space. */
addr = (uintptr_t)map_sysmem(addr, 0);
- pages = efi_size_in_pages(size + (addr & EFI_PAGE_MASK));
- addr &= ~EFI_PAGE_MASK;
- if (efi_add_memory_map(addr, pages, EFI_RESERVED_MEMORY_TYPE,
- false) != EFI_SUCCESS)
+ if (efi_add_memory_map(addr, size,
+ EFI_RESERVED_MEMORY_TYPE) != EFI_SUCCESS)
printf("Reserved memory mapping failed addr %llx size %llx\n",
addr, size);
}