[Concept,05/14] efi: Use a function to obtain boot services in efi debug
Commit Message
From: Simon Glass <sjg@chromium.org>
Rather than accessing the EFI loader's structure, create an
efi_get_boot() function to match that used by the app, so that the
call to protocols_per_handle() can operate in the app as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
cmd/efidebug.c | 4 ++--
lib/efi_loader/efi_boottime.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
@@ -491,8 +491,8 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag,
&handler);
if (ret == EFI_SUCCESS)
printf(" %pD\n", handler->protocol_interface);
- ret = systab.boottime->protocols_per_handle(handles[i], &guid,
- &count);
+ ret = efi_get_boot()->protocols_per_handle(handles[i], &guid,
+ &count);
/* Print other protocols */
for (j = 0; j < count; j++) {
if (guidcmp(guid[j], &efi_guid_device_path))
@@ -4026,3 +4026,8 @@ struct efi_system_table *efi_get_sys_table(void)
{
return &systab;
}
+
+struct efi_boot_services *efi_get_boot(void)
+{
+ return systab.boottime;
+}