aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_runtime.c
diff options
context:
space:
mode:
authorMichael Walle2020-05-17 12:29:19 +0200
committerHeinrich Schuchardt2020-05-17 21:59:53 +0200
commit714497e327e7304a2b67d5f780f415c6e1c300d0 (patch)
treed6182ed8caa040cc042b4f86a4abfaab65f68ff8 /lib/efi_loader/efi_runtime.c
parent515f613253cf0a892c3a321770ab927fa3d925cf (diff)
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>
Diffstat (limited to 'lib/efi_loader/efi_runtime.c')
-rw-r--r--lib/efi_loader/efi_runtime.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 6a25acbbcdf..a28b291927c 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -784,11 +784,10 @@ out:
efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
{
struct efi_runtime_mmio_list *newmmio;
- u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
uint64_t addr = *(uintptr_t *)mmio_ptr;
efi_status_t ret;
- ret = efi_add_memory_map(addr, pages, EFI_MMAP_IO, false);
+ ret = efi_add_memory_map(addr, len, EFI_MMAP_IO);
if (ret != EFI_SUCCESS)
return EFI_OUT_OF_RESOURCES;