summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>2017-07-11 22:06:21 +0200
committerAlexander Graf <agraf@suse.de>2017-07-19 14:14:39 +0200
commit26329584f350d2bd2a4125a645a6f5821019808b (patch)
tree7677c3bda213914ebe1220187a2959e667484988 /lib/efi_loader/efi_boottime.c
parent58b83586065f9b22b80b5a6ff2c1270715b4128b (diff)
efi_loader: refactor efi_locate_handle
To implement LocateHandleBuffer we need to call efi_locate_handle internally without running through EFI_EXIT. So put EFI_ENTRY and EFI_EXIT into a new wrapper function efi_locate_handle_ext. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> 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.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 08eddbd376..1f72efe7c3 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -466,9 +466,6 @@ static efi_status_t EFIAPI efi_locate_handle(
struct list_head *lhandle;
unsigned long size = 0;
- EFI_ENTRY("%d, %p, %p, %p, %p", search_type, protocol, search_key,
- buffer_size, buffer);
-
/* Count how much space we need */
list_for_each(lhandle, &efi_obj_list) {
struct efi_object *efiobj;
@@ -480,7 +477,7 @@ static efi_status_t EFIAPI efi_locate_handle(
if (*buffer_size < size) {
*buffer_size = size;
- return EFI_EXIT(EFI_BUFFER_TOO_SMALL);
+ return EFI_BUFFER_TOO_SMALL;
}
/* Then fill the array */
@@ -493,7 +490,19 @@ static efi_status_t EFIAPI efi_locate_handle(
}
*buffer_size = size;
- return EFI_EXIT(EFI_SUCCESS);
+ return EFI_SUCCESS;
+}
+
+static efi_status_t EFIAPI efi_locate_handle_ext(
+ enum efi_locate_search_type search_type,
+ efi_guid_t *protocol, void *search_key,
+ unsigned long *buffer_size, efi_handle_t *buffer)
+{
+ EFI_ENTRY("%d, %p, %p, %p, %p", search_type, protocol, search_key,
+ buffer_size, buffer);
+
+ return EFI_EXIT(efi_locate_handle(search_type, protocol, search_key,
+ buffer_size, buffer));
}
static efi_status_t EFIAPI efi_locate_device_path(efi_guid_t *protocol,
@@ -953,7 +962,7 @@ static const struct efi_boot_services efi_boot_services = {
.handle_protocol = efi_handle_protocol,
.reserved = NULL,
.register_protocol_notify = efi_register_protocol_notify,
- .locate_handle = efi_locate_handle,
+ .locate_handle = efi_locate_handle_ext,
.locate_device_path = efi_locate_device_path,
.install_configuration_table = efi_install_configuration_table_ext,
.load_image = efi_load_image,