diff options
| author | Peter Jones <pjones@redhat.com> | 2013-10-01 14:03:16 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-10-01 14:03:16 -0400 |
| commit | 417077f8de33214b2942f5a6d8ff6af217b4f5dd (patch) | |
| tree | 0ca634a9091129b2839c1a45cc3870dfd9a61d8f /lib | |
| parent | bc71a15ed5d1912075f8c48be0243fdb1d35ac88 (diff) | |
| download | efi-boot-shim-417077f8de33214b2942f5a6d8ff6af217b4f5dd.tar.gz efi-boot-shim-417077f8de33214b2942f5a6d8ff6af217b4f5dd.zip | |
Merge console_control.h and console.h
Since these are topically the same thing, they can live together.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile | 2 | ||||
| -rw-r--r-- | lib/console.c | 29 | ||||
| -rw-r--r-- | lib/console_control.c | 32 |
3 files changed, 30 insertions, 33 deletions
diff --git a/lib/Makefile b/lib/Makefile index f2b9091d..c1b9ab34 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,6 +1,6 @@ TARGET = lib.a -LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variables.o security_policy.o console_control.o +LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variables.o security_policy.o ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) diff --git a/lib/console.c b/lib/console.c index af01f035..72d64271 100644 --- a/lib/console.c +++ b/lib/console.c @@ -1,5 +1,6 @@ /* * Copyright 2012 <James.Bottomley@HansenPartnership.com> + * Copyright 2013 Red Hat Inc. <pjones@redhat.com> * * see COPYING file */ @@ -400,3 +401,31 @@ console_reset(void) uefi_call_wrapper(co->SetMode, 2, co, 0); uefi_call_wrapper(co->ClearScreen, 1, co); } + +VOID setup_console (int text) +{ + EFI_STATUS status; + EFI_GUID console_control_guid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; + EFI_CONSOLE_CONTROL_PROTOCOL *concon; + static EFI_CONSOLE_CONTROL_SCREEN_MODE mode = + EfiConsoleControlScreenGraphics; + EFI_CONSOLE_CONTROL_SCREEN_MODE new_mode; + + status = LibLocateProtocol(&console_control_guid, (VOID **)&concon); + if (status != EFI_SUCCESS) + return; + + if (text) { + new_mode = EfiConsoleControlScreenText; + + status = uefi_call_wrapper(concon->GetMode, 4, concon, &mode, + 0, 0); + /* If that didn't work, assume it's graphics */ + if (status != EFI_SUCCESS) + mode = EfiConsoleControlScreenGraphics; + } else { + new_mode = mode; + } + + uefi_call_wrapper(concon->SetMode, 2, concon, new_mode); +} diff --git a/lib/console_control.c b/lib/console_control.c deleted file mode 100644 index 604a60f5..00000000 --- a/lib/console_control.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <efi.h> -#include <efilib.h> - -#include "console_control.h" - -VOID setup_console (int text) -{ - EFI_STATUS status; - EFI_GUID console_control_guid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; - EFI_CONSOLE_CONTROL_PROTOCOL *concon; - static EFI_CONSOLE_CONTROL_SCREEN_MODE mode = - EfiConsoleControlScreenGraphics; - EFI_CONSOLE_CONTROL_SCREEN_MODE new_mode; - - status = LibLocateProtocol(&console_control_guid, (VOID **)&concon); - if (status != EFI_SUCCESS) - return; - - if (text) { - new_mode = EfiConsoleControlScreenText; - - status = uefi_call_wrapper(concon->GetMode, 4, concon, &mode, - 0, 0); - /* If that didn't work, assume it's graphics */ - if (status != EFI_SUCCESS) - mode = EfiConsoleControlScreenGraphics; - } else { - new_mode = mode; - } - - uefi_call_wrapper(concon->SetMode, 2, concon, new_mode); -} |
