summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-09-13 18:05:28 -0400
committerAlexander Graf <agraf@suse.de>2017-09-20 10:31:55 +0200
commitb66c60dde9d48889b93694326d40f7e5208cff25 (patch)
treef4827a4d1f3413867fe6a9da19603b464953142c /lib/efi_loader/efi_boottime.c
parentc80214ce1f39a9b9da32dbe941ff83051b03c080 (diff)
efi_loader: add device-path utils
Helpers to construct device-paths from devices, partitions, files, and for parsing and manipulating device-paths. For non-legacy devices, this will use u-boot's device-model to construct device-paths which include bus hierarchy to construct device-paths. For legacy devices we still fake it, but slightly more convincingly. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 0d234146d7..67a045a2ec 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -716,8 +716,17 @@ static efi_status_t EFIAPI efi_locate_device_path(efi_guid_t *protocol,
struct efi_device_path **device_path,
efi_handle_t *device)
{
- EFI_ENTRY("%p, %p, %p", protocol, device_path, device);
- return EFI_EXIT(EFI_NOT_FOUND);
+ struct efi_object *efiobj;
+
+ EFI_ENTRY("%pUl, %p, %p", protocol, device_path, device);
+
+ efiobj = efi_dp_find_obj(*device_path, device_path);
+ if (!efiobj)
+ return EFI_EXIT(EFI_NOT_FOUND);
+
+ *device = efiobj->handle;
+
+ return EFI_EXIT(EFI_SUCCESS);
}
/* Collapses configuration table entries, removing index i */