summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorYing-Chun Liu (PaulLiu) <paul.liu@linaro.org>2025-07-03 07:28:10 +0100
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2025-07-03 12:25:56 +0300
commit146546138af5966c97619797dc7f879c4857b00d (patch)
treef37007229d3f39e633ddcecb9e6a7c5621361b5e /lib/efi_loader/efi_boottime.c
parent3c08df58cc43c3ae8ec378ab0e32cfe548313c39 (diff)
efi: add EFI_DEBUG_IMAGE_INFO for debug
This commit adds the functionality of generate EFI_DEBUG_IMAGE_INFO while loading the image. This feature is described in UEFI Spec 2.10. Section 18.4.3. The implementation ensures support for hardware-assisted debugging and provides a standardized mechanism for debuggers to discover the load address of an EFI application. Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 754bc6a6519..ddc935d2240 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2130,6 +2130,11 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
*image_handle = NULL;
free(info);
}
+
+ if (IS_ENABLED(CONFIG_EFI_DEBUG_SUPPORT) && *image_handle)
+ efi_core_new_debug_image_info_entry(EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL,
+ info,
+ *image_handle);
error:
return EFI_EXIT(ret);
}
@@ -3360,6 +3365,8 @@ efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
ret = EFI_INVALID_PARAMETER;
goto out;
}
+ if (IS_ENABLED(CONFIG_EFI_DEBUG_SUPPORT))
+ efi_core_remove_debug_image_info_entry(image_handle);
switch (efiobj->type) {
case EFI_OBJECT_TYPE_STARTED_IMAGE:
/* Call the unload function */