aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-10-17 07:20:52 -0400
committerTom Rini <trini@konsulko.com>2018-10-17 07:20:52 -0400
commite3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f (patch)
treea99de7d9340f72890662d92ddbb64b64de5a65d8 /cmd
parentd0423c44f1acc68da10da8c16af4d82016479d7b (diff)
parentd081f27fc28d3a0f9fbb6045e4121709bc303028 (diff)
downloadu-boot-e3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f.zip
u-boot-e3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f.tar.gz
u-boot-e3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f.tar.bz2
Merge tag 'signed-efi-2018.11' of git://github.com/agraf/u-boot
Patch queue for efi - 2018-10-17 A few bug fixes for the 2018.11 release: - Fix block seeking on 32bit - Fix execution with DEBUG set - Fix a few Coverity found bugs - Fix warnings Heinrich Schuchardt (13): efi_loader: fix relocation on x86_64 efi_loader: correct signature of GetPosition, SetPosition efi_loader: execute efi_save_gd() first efi_loader: efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, ...) efi_loader: error handling in read_console() efi_loader: return type efi_console_register() efi_loader: superfluous statement in is_dir() efi_loader: memory leak in efi_set_variable() efi_loader: remove lcd.h from efi_net.c arm: do not include efi_loader.h twice efi_loader: fix typo in efi_boottime.c efi_selftest: creating new handle in controller test efi_loader: efi_dp_get_next_instance() superfluous statement Tom Rini (2): efi_loader: Fix warning in efi_load_image() fs: fat: Fix warning in normalize_longname()
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bootefi.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 82d755c..4d68d80 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -40,6 +40,13 @@ efi_status_t efi_init_obj_list(void)
{
efi_status_t ret = EFI_SUCCESS;
+ /*
+ * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
+ * As this register may be overwritten by an EFI payload we save it here
+ * and restore it on every callback entered.
+ */
+ efi_save_gd();
+
/* Initialize once only */
if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
return efi_obj_list_initialized;
@@ -374,12 +381,6 @@ static efi_status_t do_bootefi_exec(void *efi,
if (ret != EFI_SUCCESS)
goto exit;
- /*
- * 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");
/* Load the EFI payload */
@@ -460,12 +461,6 @@ static int do_bootefi_bootmgr_exec(void)
void *addr;
efi_status_t r;
- /*
- * 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();
-
addr = efi_bootmgr_load(&device_path, &file_path);
if (!addr)
return 1;
@@ -547,11 +542,6 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (r != EFI_SUCCESS)
return CMD_RET_FAILURE;
- /*
- * 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 efi_selftest as load options */
set_load_options(loaded_image_info, "efi_selftest");