From 42b1d8832f8a764f9a1cbea5e8b916dbb4665f30 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 12 Mar 2018 17:02:59 +0100 Subject: console: Move setup_console() definition to higher in the file This is a preparation patch for making setup_console() private. Signed-off-by: Hans de Goede --- lib/console.c | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'lib') diff --git a/lib/console.c b/lib/console.c index 06b806c6..c23baec4 100644 --- a/lib/console.c +++ b/lib/console.c @@ -46,6 +46,33 @@ console_get_keystroke(EFI_INPUT_KEY *key) return efi_status; } +VOID setup_console (int text) +{ + EFI_STATUS efi_status; + EFI_CONSOLE_CONTROL_PROTOCOL *concon; + static EFI_CONSOLE_CONTROL_SCREEN_MODE mode = + EfiConsoleControlScreenGraphics; + EFI_CONSOLE_CONTROL_SCREEN_MODE new_mode; + + efi_status = LibLocateProtocol(&EFI_CONSOLE_CONTROL_GUID, + (VOID **)&concon); + if (EFI_ERROR(efi_status)) + return; + + if (text) { + new_mode = EfiConsoleControlScreenText; + + efi_status = concon->GetMode(concon, &mode, 0, 0); + /* If that didn't work, assume it's graphics */ + if (EFI_ERROR(efi_status)) + mode = EfiConsoleControlScreenGraphics; + } else { + new_mode = mode; + } + + concon->SetMode(concon, new_mode); +} + UINTN console_print(const CHAR16 *fmt, ...) { @@ -458,33 +485,6 @@ setup_verbosity(VOID) verbose = verbose_check; } -VOID setup_console (int text) -{ - EFI_STATUS efi_status; - EFI_CONSOLE_CONTROL_PROTOCOL *concon; - static EFI_CONSOLE_CONTROL_SCREEN_MODE mode = - EfiConsoleControlScreenGraphics; - EFI_CONSOLE_CONTROL_SCREEN_MODE new_mode; - - efi_status = LibLocateProtocol(&EFI_CONSOLE_CONTROL_GUID, - (VOID **)&concon); - if (EFI_ERROR(efi_status)) - return; - - if (text) { - new_mode = EfiConsoleControlScreenText; - - efi_status = concon->GetMode(concon, &mode, 0, 0); - /* If that didn't work, assume it's graphics */ - if (EFI_ERROR(efi_status)) - mode = EfiConsoleControlScreenGraphics; - } else { - new_mode = mode; - } - - concon->SetMode(concon, new_mode); -} - /* Included here because they mess up the definition of va_list and friends */ #include #include -- cgit v1.2.3