summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-23 08:57:35 -0400
committerTom Rini <trini@konsulko.com>2020-07-23 08:57:35 -0400
commit56d37f1c564107e27d873181d838571b7d7860e7 (patch)
tree41b20866e0a94e34ca76e54a2745ca7a5ba0889b /lib/efi_loader/efi_boottime.c
parent95fc1f164723270b2b0bd8d7e2f7ba21bce66381 (diff)
parent5ee81c6e3f9f6f851c69b1e3d2661d96671d1dd1 (diff)
downloadu-boot-WIP/23Jul2020.tar.gz
Merge tag 'efi-2020-10-rc1-5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efiWIP/23Jul2020
Pull request for UEFI sub-system for efi-2020-10-rc1 (5) The series provides bug fixes for: * crash in OS when accessing UEFI variables * returning from UEFI fit images to U-Boot * error handling for variable services provided by OP-TEE * error handling in EFI_FILE_PROTOCOL.Read() * missing function documentation The first patches needed to use intermediate certificates for secure boot are added. (The rest of the series requires updating sbsigntool in our CI systems.) Logging is enabled in the bootefi command.
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 0b16554ba2..d49145fc76 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -104,7 +104,15 @@ int __efi_exit_check(void)
return ret;
}
-/* Called from do_bootefi_exec() */
+/**
+ * efi_save_gd() - save global data register
+ *
+ * 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.
+ *
+ * This function is called after relocation from initr_reloc_global_data().
+ */
void efi_save_gd(void)
{
#ifdef CONFIG_ARM
@@ -112,10 +120,12 @@ void efi_save_gd(void)
#endif
}
-/*
- * Special case handler for error/abort that just forces things back to u-boot
- * world so we can dump out an abort message, without any care about returning
- * back to UEFI world.
+/**
+ * efi_restore_gd() - restore global data register
+ *
+ * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
+ * Restore it after returning from the UEFI world to the value saved via
+ * efi_save_gd().
*/
void efi_restore_gd(void)
{