aboutsummaryrefslogtreecommitdiff
path: root/stand/efi/loader/arch/arm/exec.c
diff options
context:
space:
mode:
authorRebecca Cran <bcran@FreeBSD.org>2019-03-02 04:02:11 +0000
committerRebecca Cran <bcran@FreeBSD.org>2019-03-02 04:02:11 +0000
commitea7796a9ae6bb4f4fc035007d04b2da60655d86c (patch)
tree619c9c81fc81bf3aca877f1e756c7b7305889769 /stand/efi/loader/arch/arm/exec.c
parent51244b1e46c89395d35a9e07d0b9671209513e01 (diff)
downloadsrc-ea7796a9ae6bb4f4fc035007d04b2da60655d86c.tar.gz
src-ea7796a9ae6bb4f4fc035007d04b2da60655d86c.zip
EFI: don't call printf after ExitBootServices, since it uses Boot Services
ExitBootServices terminates all boot services including console access. Attempting to call printf afterwards can result in a crash, depending on the implementation. Move any printf statements to before we call bi_load, and remove any that depend on calling bi_load first. Reviewed by: imp, tsoome Differential Revision: https://reviews.freebsd.org/D19374
Notes
Notes: svn path=/head/; revision=344718
Diffstat (limited to 'stand/efi/loader/arch/arm/exec.c')
-rw-r--r--stand/efi/loader/arch/arm/exec.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c
index 2de99a09849f..5fdf8e3daa39 100644
--- a/stand/efi/loader/arch/arm/exec.c
+++ b/stand/efi/loader/arch/arm/exec.c
@@ -74,16 +74,19 @@ __elfN(arm_exec)(struct preloaded_file *fp)
e = (Elf_Ehdr *)&fmp->md_data;
efi_time_fini();
+
+ entry = efi_translate(e->e_entry);
+
+ printf("Kernel entry at 0x%x...\n", (unsigned)entry);
+ printf("Kernel args: %s\n", fp->f_args);
+
if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) {
efi_time_init();
return (error);
}
- entry = efi_translate(e->e_entry);
- printf("Kernel entry at 0x%x...\n", (unsigned)entry);
- printf("Kernel args: %s\n", fp->f_args);
- printf("modulep: %#x\n", modulep);
- printf("relocation_offset %llx\n", __elfN(relocation_offset));
+ /* At this point we've called ExitBootServices, so we can't call
+ * printf or any other function that uses Boot Services */
dev_cleanup();