]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: pass boot_policy to efi_load_image_from_path
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 4 Dec 2020 08:27:41 +0000 (09:27 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 1 Jun 2021 11:38:24 +0000 (13:38 +0200)
Implementing support for loading images via the EFI_LOAD_FILE_PROTOCOL
requires the boot policy as input for efi_load_image_from_path().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (6e8c28cf523257acba5d6ccb4328253595640931)

lib/efi_loader/efi_boottime.c

index c1272d332d599f72dc43262fb138043dd4ced103..f8445e9c964a65bb984cec4ac8707daf1ec4a8b8 100644 (file)
@@ -1860,13 +1860,15 @@ out:
  * Read a file into a buffer allocated as EFI_BOOT_SERVICES_DATA. It is the
  * callers obligation to update the memory type as needed.
  *
- * @file_path: the path of the image to load
- * @buffer:    buffer containing the loaded image
- * @size:      size of the loaded image
- * Return:     status code
+ * @boot_policy:       true for request originating from the boot manager
+ * @file_path:         the path of the image to load
+ * @buffer:            buffer containing the loaded image
+ * @size:              size of the loaded image
+ * Return:             status code
  */
 static
-efi_status_t efi_load_image_from_path(struct efi_device_path *file_path,
+efi_status_t efi_load_image_from_path(bool boot_policy,
+                                     struct efi_device_path *file_path,
                                      void **buffer, efi_uintn_t *size)
 {
        struct efi_file_info *info = NULL;
@@ -1968,8 +1970,8 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
        }
 
        if (!source_buffer) {
-               ret = efi_load_image_from_path(file_path, &dest_buffer,
-                                              &source_size);
+               ret = efi_load_image_from_path(boot_policy, file_path,
+                                              &dest_buffer, &source_size);
                if (ret != EFI_SUCCESS)
                        goto error;
        } else {