summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_memory.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-31 08:33:24 -0600
committerTom Rini <trini@konsulko.com>2024-10-31 08:33:24 -0600
commitd4c8b8750b564ee83303160414607e17b6873fe2 (patch)
tree39965f9fb950418d2d1cd08937690e632e14fa50 /lib/efi_loader/efi_memory.c
parent89bdd752b91764b65c713c47e87628b5680fb18f (diff)
parent7596d77bc1b6be838e38af3fb4e73dbd0a0a078e (diff)
Merge tag 'efi-2025-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc2 Documentation: * include semihosting and K3 boards only once in table of contents * include file-system API into HTML docs * describe struct ext2_inode * update Python requirements UEFI: * mark local functions static * simplify efi_free_pages() * pass correct end address value to efi_dp_from_mem() * fix typos in HII test and eficonfig command
Diffstat (limited to 'lib/efi_loader/efi_memory.c')
-rw-r--r--lib/efi_loader/efi_memory.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 9f3f0876997..d2f5d563f2a 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -521,7 +521,6 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type,
efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
{
u64 len;
- uint flags;
long status;
efi_status_t ret;
@@ -536,18 +535,17 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
return EFI_INVALID_PARAMETER;
}
- flags = LMB_NOOVERWRITE | LMB_NONOTIFY;
len = (u64)pages << EFI_PAGE_SHIFT;
+ /*
+ * The 'memory' variable for sandbox holds a pointer which has already
+ * been mapped with map_sysmem() from efi_allocate_pages(). Convert
+ * it back to an address LMB understands
+ */
status = lmb_free_flags(map_to_sysmem((void *)(uintptr_t)memory), len,
- flags);
+ LMB_NOOVERWRITE);
if (status)
return EFI_NOT_FOUND;
- ret = efi_add_memory_map_pg(memory, pages, EFI_CONVENTIONAL_MEMORY,
- false);
- if (ret != EFI_SUCCESS)
- return EFI_NOT_FOUND;
-
return ret;
}