summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-03-12 17:02:59 +0100
committerPeter Jones <pjones@redhat.com>2018-03-12 18:00:41 -0400
commit42b1d8832f8a764f9a1cbea5e8b916dbb4665f30 (patch)
tree0c34207763b352f01f257e49b9e46caec6e6b57e /lib
parent1fe31ee1b4ebf2f177d512d0301e11de0689a275 (diff)
downloadefi-boot-shim-42b1d8832f8a764f9a1cbea5e8b916dbb4665f30.tar.gz
efi-boot-shim-42b1d8832f8a764f9a1cbea5e8b916dbb4665f30.zip
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 <hdegoede@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/console.c54
1 files changed, 27 insertions, 27 deletions
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 <Library/BaseCryptLib.h>
#include <openssl/err.h>