[U-Boot] [PATCH v3 19/21] efi: Reorder code in do_bootefi_exec()

Simon Glass sjg at chromium.org
Mon Feb 19 15:48:25 UTC 2018


Reorder the code a little so we can (in a future commit) use a common
function for some of the init.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v3:
- Add new patch to reorder code in do_bootefi_exec()

Changes in v2: None

 cmd/bootefi.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index d85d17a9b9..cdfa22ee4c 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -202,20 +202,23 @@ static efi_status_t do_bootefi_exec(void *efi, void *fdt,
 		assert(device_path && image_path);
 	}
 
+	efi_setup_loaded_image(&loaded_image_info, &loaded_image_info_obj,
+			       device_path, image_path);
+
 	/* Initialize and populate EFI object list */
 	ret = efi_init_obj_list();
 	if (ret)
 		return ret;
 
-	efi_setup_loaded_image(&loaded_image_info, &loaded_image_info_obj,
-			       device_path, image_path);
-
 	/*
 	 * gd lives in a fixed register which may get clobbered while we execute
 	 * the payload. So save it here and restore it on every callback entry
 	 */
 	efi_save_gd();
 
+	/* Transfer environment variable bootargs as load options */
+	set_load_options(&loaded_image_info, "bootargs");
+
 	if (fdt && !fdt_check_header(fdt)) {
 		/* Prepare fdt for payload */
 		fdt = copy_fdt(fdt);
@@ -242,8 +245,6 @@ static efi_status_t do_bootefi_exec(void *efi, void *fdt,
 		efi_install_configuration_table(&fdt_guid, NULL);
 	}
 
-	/* Transfer environment variable bootargs as load options */
-	set_load_options(&loaded_image_info, "bootargs");
 	/* Load the EFI payload */
 	entry = efi_load_pe(efi, &loaded_image_info);
 	if (!entry) {
-- 
2.16.1.291.g4437f3f132-goog



More information about the U-Boot mailing list