summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--MokManager.c1
-rw-r--r--include/console.h47
-rw-r--r--include/console_control.h46
-rw-r--r--lib/Makefile2
-rw-r--r--lib/console.c29
-rw-r--r--lib/console_control.c32
-rw-r--r--shim.c1
8 files changed, 79 insertions, 83 deletions
diff --git a/Makefile b/Makefile
index 40103eb3..581be0ac 100644
--- a/Makefile
+++ b/Makefile
@@ -38,9 +38,9 @@ VERSION = 0.4
TARGET = shim.efi MokManager.efi.signed fallback.efi.signed
OBJS = shim.o netboot.o cert.o replacements.o
KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key
-SOURCES = shim.c shim.h netboot.c include/PeImage.h include/wincert.h include/console.h replacements.c replacements.h include/console_control.h
+SOURCES = shim.c shim.h netboot.c include/PeImage.h include/wincert.h include/console.h replacements.c replacements.h
MOK_OBJS = MokManager.o PasswordCrypt.o crypt_blowfish.o
-MOK_SOURCES = MokManager.c shim.h include/console_control.h PasswordCrypt.c PasswordCrypt.h crypt_blowfish.c crypt_blowfish.h
+MOK_SOURCES = MokManager.c shim.h include/console.h PasswordCrypt.c PasswordCrypt.h crypt_blowfish.c crypt_blowfish.h
FALLBACK_OBJS = fallback.o
FALLBACK_SRCS = fallback.c
diff --git a/MokManager.c b/MokManager.c
index 5d86e330..de0eb59a 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -2,7 +2,6 @@
#include <efilib.h>
#include <Library/BaseCryptLib.h>
#include <openssl/x509.h>
-#include "console_control.h"
#include "shim.h"
#include "PeImage.h"
#include "PasswordCrypt.h"
diff --git a/include/console.h b/include/console.h
index 7eb8a0be..d699d278 100644
--- a/include/console.h
+++ b/include/console.h
@@ -1,3 +1,6 @@
+#ifndef _SHIM_LIB_CONSOLE_H
+#define _SHIM_LIB_CONSOLE_H 1
+
EFI_INPUT_KEY
console_get_keystroke(void);
void
@@ -19,3 +22,47 @@ console_notify(CHAR16 *string);
void
console_reset(void);
#define NOSEL 0x7fffffff
+
+#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
+ { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} }
+
+typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL;
+
+typedef enum {
+ EfiConsoleControlScreenText,
+ EfiConsoleControlScreenGraphics,
+ EfiConsoleControlScreenMaxValue
+} EFI_CONSOLE_CONTROL_SCREEN_MODE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) (
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
+ OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
+ OUT BOOLEAN *GopUgaExists, OPTIONAL
+ OUT BOOLEAN *StdInLocked OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) (
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
+ IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) (
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
+ IN CHAR16 *Password
+ );
+
+struct _EFI_CONSOLE_CONTROL_PROTOCOL {
+ EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode;
+ EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode;
+ EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn;
+};
+
+extern VOID setup_console (int text);
+
+#endif /* _SHIM_LIB_CONSOLE_H */
diff --git a/include/console_control.h b/include/console_control.h
deleted file mode 100644
index aec6f41d..00000000
--- a/include/console_control.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _SHIM_CONSOLE_CONTROL_H
-#define _SHIM_CONSOLE_CONTROL_H 1
-
-#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
- { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} }
-
-typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL;
-
-typedef enum {
- EfiConsoleControlScreenText,
- EfiConsoleControlScreenGraphics,
- EfiConsoleControlScreenMaxValue
-} EFI_CONSOLE_CONTROL_SCREEN_MODE;
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) (
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
- OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
- OUT BOOLEAN *GopUgaExists, OPTIONAL
- OUT BOOLEAN *StdInLocked OPTIONAL
- );
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) (
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
- IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
- );
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) (
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
- IN CHAR16 *Password
- );
-
-struct _EFI_CONSOLE_CONTROL_PROTOCOL {
- EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode;
- EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode;
- EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn;
-};
-
-extern VOID setup_console (int text);
-
-#endif /* _SHIM_CONSOLE_CONTROL_H */
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);
-}
diff --git a/shim.c b/shim.c
index a72e0910..3c55a5a4 100644
--- a/shim.c
+++ b/shim.c
@@ -43,7 +43,6 @@
#include "replacements.h"
#include "ucs2.h"
-#include "console_control.h"
#include "guid.h"
#include "variables.h"
#include "efiauthenticated.h"