summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
committerTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
commitf448c4517b55f4018271cdf014615eb54121d863 (patch)
treeb7974f966aacb07af9630b3c3e8cd0be56e17e61 /lib/efi_loader/efi_device_path.c
parenta7a96a37cbd875994bc8d25adb0536bf00e4a30e (diff)
parent70b78d52937b5f18afbbc4257bd3b89b0e75a186 (diff)
Merge tag 'efi-2025-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc2-2 Documentation: * correct title and author of rst2pdf generated pdf * describe CONFIG_DEBUG_SBI_CONSOLE * remove vile language UEFI * correct printf codes in mkeficapsule * add an EFI test app * move default filename to a function * move get_efi_pxe_arch() to efi_helper * allow reporting the host defaults in efidebug * drop sandbox PXE architecture Other: * do not reserve extra 16 KiB of stack in lmb * disable the sandbox virtio blk device * provide -N command line flag to control EFI default boot file name on the sandbox * provide a unit test for the efi bootmeth
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r--lib/efi_loader/efi_device_path.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index d7444588aa0..ee387e1dfd4 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -977,7 +977,7 @@ struct efi_device_path __maybe_unused *efi_dp_from_eth(void)
/* Construct a device-path for memory-mapped image */
struct efi_device_path *efi_dp_from_mem(uint32_t memory_type,
uint64_t start_address,
- uint64_t end_address)
+ size_t size)
{
struct efi_device_path_memory *mdp;
void *buf, *start;
@@ -992,7 +992,7 @@ struct efi_device_path *efi_dp_from_mem(uint32_t memory_type,
mdp->dp.length = sizeof(*mdp);
mdp->memory_type = memory_type;
mdp->start_address = start_address;
- mdp->end_address = end_address;
+ mdp->end_address = start_address + size;
buf = &mdp[1];
*((struct efi_device_path *)buf) = END;
@@ -1073,8 +1073,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
efi_get_image_parameters(&image_addr, &image_size);
dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
- (uintptr_t)image_addr,
- (uintptr_t)image_addr + image_size);
+ (uintptr_t)image_addr, image_size);
} else if (IS_ENABLED(CONFIG_NETDEVICES) && !strcmp(dev, "Net")) {
dp = efi_dp_from_eth();
} else if (!strcmp(dev, "Uart")) {