From 1fe31ee1b4ebf2f177d512d0301e11de0689a275 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 12 Mar 2018 16:03:38 +0100 Subject: console: Add console_print and console_print_at helpers This is a preparation commit for removing the setup_console(1) calls from MokManager and shim so that we don't force the EFI console to switch to text-mode. This commit replaces all direct calls to Print / PrintAt with calls to the new helpers (no functional changes) so that we can delay calling setup_console(1) till the first Print call in a follow-up patch. Signed-off-by: Hans de Goede --- replacements.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'replacements.c') diff --git a/replacements.c b/replacements.c index 10010567..944c779d 100644 --- a/replacements.c +++ b/replacements.c @@ -116,9 +116,9 @@ replacement_start_image(EFI_HANDLE image_handle, UINTN *exit_data_size, CHAR16 * EFI_STATUS efi_status2 = install_shim_protocols(); if (EFI_ERROR(efi_status2)) { - Print(L"Something has gone seriously wrong: %r\n", - efi_status2); - Print(L"shim cannot continue, sorry.\n"); + console_print(L"Something has gone seriously wrong: %r\n", + efi_status2); + console_print(L"shim cannot continue, sorry.\n"); msleep(5000000); gRT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, @@ -144,8 +144,8 @@ exit_boot_services(EFI_HANDLE image_key, UINTN map_key) return efi_status; } - Print(L"Bootloader has not verified loaded image.\n"); - Print(L"System is compromised. halting.\n"); + console_print(L"Bootloader has not verified loaded image.\n"); + console_print(L"System is compromised. halting.\n"); msleep(5000000); gRT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, 0, NULL); return EFI_SECURITY_VIOLATION; @@ -165,9 +165,9 @@ do_exit(EFI_HANDLE ImageHandle, EFI_STATUS ExitStatus, EFI_STATUS efi_status2 = shim_init(); if (EFI_ERROR(efi_status2)) { - Print(L"Something has gone seriously wrong: %r\n", - efi_status2); - Print(L"shim cannot continue, sorry.\n"); + console_print(L"Something has gone seriously wrong: %r\n", + efi_status2); + console_print(L"shim cannot continue, sorry.\n"); msleep(5000000); gRT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, 0, NULL); -- cgit v1.2.3