git: 19e4f2f289fb - main - efi loader: Call tslog_init from efi_main

Colin Percival cperciva at FreeBSD.org
Sat Sep 25 19:10:27 UTC 2021


The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=19e4f2f289fb8d2b14576a65ca9e6f931dbb6a02

commit 19e4f2f289fb8d2b14576a65ca9e6f931dbb6a02
Author:     Colin Percival <cperciva at FreeBSD.org>
AuthorDate: 2021-09-25 19:04:06 +0000
Commit:     Colin Percival <cperciva at FreeBSD.org>
CommitDate: 2021-09-25 19:06:07 +0000

    efi loader: Call tslog_init from efi_main
    
    We were calling tslog_init from main; no reason to wait that long.
    
    Fixes:          f49381ccb6bc efi/loader: Call tslog_init
    Sponsored by:   https://www.patreon.com/cperciva
---
 stand/efi/loader/efi_main.c | 4 ++++
 stand/efi/loader/main.c     | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/stand/efi/loader/efi_main.c b/stand/efi/loader/efi_main.c
index fa3c765c36ab..736c1aa56c99 100644
--- a/stand/efi/loader/efi_main.c
+++ b/stand/efi/loader/efi_main.c
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <bootstrap.h>
 #include <efi.h>
 #include <eficonsctl.h>
 #include <efilib.h>
@@ -101,6 +102,9 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
 
 	setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize));
 
+	/* Start tslog now that we have a heap.*/
+	tslog_init();
+
 	/* Use efi_exit() from here on... */
 
 	status = OpenProtocolByHandle(IH, &image_protocol, (void**)&img);
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index b687255181e3..d8b3b1d19b15 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -924,8 +924,6 @@ main(int argc, CHAR16 *argv[])
 	char buf[32];
 	bool uefi_boot_mgr;
 
-	tslog_init();
-
 	archsw.arch_autoload = efi_autoload;
 	archsw.arch_getdev = efi_getdev;
 	archsw.arch_copyin = efi_copyin;


More information about the dev-commits-src-all mailing list