aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path.c
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2024-01-17 13:39:41 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-01-17 08:40:25 +0100
commit6422820ac3e59fd92dc7fc5c9dcd5c6101065f19 (patch)
tree15634d75c578a67a5424e6d079bd6f2757e2cf6c /lib/efi_loader/efi_device_path.c
parent0ab829d4de4323f53b4e2230bf885c2004da5d9b (diff)
downloadu-boot-6422820ac3e59fd92dc7fc5c9dcd5c6101065f19.zip
u-boot-6422820ac3e59fd92dc7fc5c9dcd5c6101065f19.tar.gz
u-boot-6422820ac3e59fd92dc7fc5c9dcd5c6101065f19.tar.bz2
efi_loader: split unrelated code from efi_bootmgr.c
Some code moved from cmd/bootefi.c is actually necessary only for "bootefi <addr>" command (starting an image manually loaded by a user using U-Boot load commands or other methods (like JTAG debugger). The code will never been opted out as unused code by a compiler which doesn't know how EFI boot manager is implemented. So introduce a new configuration, CONFIG_EFI_BINARY_EXEC, to enforce them opted out explicitly. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r--lib/efi_loader/efi_device_path.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 500fa10..46aa59b 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -1061,7 +1061,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
if (path && !file)
return EFI_INVALID_PARAMETER;
- if (!strcmp(dev, "Mem") || !strcmp(dev, "hostfs")) {
+ if (IS_ENABLED(CONFIG_EFI_BINARY_EXEC) &&
+ (!strcmp(dev, "Mem") || !strcmp(dev, "hostfs"))) {
/* loadm command and semihosting */
efi_get_image_parameters(&image_addr, &image_size);