]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: move EFI_LOAD_FILE2_PROTOCOL_GUID
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 4 Dec 2020 02:33:41 +0000 (03:33 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 10 Dec 2020 08:15:32 +0000 (09:15 +0100)
The EFI_LOAD_FILE_PROTOCOL_GUID and EFI_LOAD_FILE2_PROTOCOL_GUID are needed
to complement the implementation of the LoadFile() boot service.

Remove a duplicate declaration of a variable for the
EFI_LOAD_FILE2_PROTOCOL_GUID.
Move the remaining declaration to efi_boottime.c.
Add a variable for the EFI_LOAD_FILE_PROTOCOL_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_loader.h
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_load_initrd.c
lib/efi_selftest/efi_selftest_load_initrd.c

index 76cd2b36f2b6a00a9935f015b6a389dd84c2611d..4c6eb8616d5285020ed86c9b7bb85955ae345e66 100644 (file)
@@ -195,6 +195,9 @@ extern const efi_guid_t efi_file_system_info_guid;
 extern const efi_guid_t efi_guid_device_path_utilities_protocol;
 /* GUID of the deprecated Unicode collation protocol */
 extern const efi_guid_t efi_guid_unicode_collation_protocol;
+/* GUIDs of the Load File and Load File2 protocol */
+extern const efi_guid_t efi_guid_load_file_protocol;
+extern const efi_guid_t efi_guid_load_file2_protocol;
 /* GUID of the Unicode collation protocol */
 extern const efi_guid_t efi_guid_unicode_collation_protocol2;
 extern const efi_guid_t efi_guid_hii_config_routing_protocol;
index 4f7479d4dfda57315f51761fabb2b35dd344573a..afe8adb91e58221b0ec780e28b9cb2204e15060e 100644 (file)
@@ -81,6 +81,9 @@ const efi_guid_t efi_guid_event_group_ready_to_boot =
 /* event group ResetSystem() invoked (before ExitBootServices) */
 const efi_guid_t efi_guid_event_group_reset_system =
                        EFI_EVENT_GROUP_RESET_SYSTEM;
+/* GUIDs of the Load File and Load File2 protocols */
+const efi_guid_t efi_guid_load_file_protocol = EFI_LOAD_FILE_PROTOCOL_GUID;
+const efi_guid_t efi_guid_load_file2_protocol = EFI_LOAD_FILE2_PROTOCOL_GUID;
 
 static efi_status_t EFIAPI efi_disconnect_controller(
                                        efi_handle_t controller_handle,
index d517d686c33001274e22e6b702aaad230fa563f8..4bf3b5ef68440fdc40e7837da3a65b67ff3ee05d 100644 (file)
@@ -12,9 +12,6 @@
 #include <efi_loader.h>
 #include <efi_load_initrd.h>
 
-static const efi_guid_t efi_guid_load_file2_protocol =
-               EFI_LOAD_FILE2_PROTOCOL_GUID;
-
 static efi_status_t EFIAPI
 efi_load_file2_initrd(struct efi_load_file_protocol *this,
                      struct efi_device_path *file_path, bool boot_policy,
index fe060a6644021b17d44b1a7a5a849160e050837e..f591dcd2115effe908a4c0f13e9be7ab212f8cda 100644 (file)
@@ -86,7 +86,6 @@ static int setup(const efi_handle_t handle,
 
 static int execute(void)
 {
-       efi_guid_t lf2_proto_guid = EFI_LOAD_FILE2_PROTOCOL_GUID;
        struct efi_load_file_protocol *lf2;
        struct efi_device_path *dp2, *dp2_invalid;
        efi_status_t status;
@@ -99,13 +98,15 @@ static int execute(void)
        memset(buffer, 0, sizeof(buffer));
 
        dp2 = (struct efi_device_path *)&dp;
-       status = boottime->locate_device_path(&lf2_proto_guid, &dp2, &handle);
+       status = boottime->locate_device_path(&efi_guid_load_file2_protocol,
+                                             &dp2, &handle);
        if (status != EFI_SUCCESS) {
                efi_st_error("Unable to locate device path\n");
                return EFI_ST_FAILURE;
        }
 
-       status = boottime->handle_protocol(handle, &lf2_proto_guid,
+       status = boottime->handle_protocol(handle,
+                                          &efi_guid_load_file2_protocol,
                                           (void **)&lf2);
        if (status != EFI_SUCCESS) {
                efi_st_error("Unable to locate protocol\n");