summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/efi/efi_console.c')
-rw-r--r--src/interface/efi/efi_console.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/interface/efi/efi_console.c b/src/interface/efi/efi_console.c
index 04bbd9e0c..afbd722ab 100644
--- a/src/interface/efi/efi_console.c
+++ b/src/interface/efi/efi_console.c
@@ -18,6 +18,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER );
+FILE_SECBOOT ( PERMITTED );
#include <stddef.h>
#include <string.h>
@@ -386,8 +387,6 @@ static int efi_getchar ( void ) {
static int efi_iskey ( void ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *conin = efi_systab->ConIn;
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *conin_ex = efi_conin_ex;
- EFI_EVENT *event;
EFI_STATUS efirc;
/* If we are mid-sequence, we are always ready */
@@ -395,8 +394,7 @@ static int efi_iskey ( void ) {
return 1;
/* Check to see if the WaitForKey event has fired */
- event = ( conin_ex ? conin_ex->WaitForKeyEx : conin->WaitForKey );
- if ( ( efirc = bs->CheckEvent ( event ) ) == 0 )
+ if ( ( efirc = bs->CheckEvent ( conin->WaitForKey ) ) == 0 )
return 1;
return 0;
@@ -415,13 +413,7 @@ struct console_driver efi_console __console_driver = {
*
*/
static void efi_console_init ( void ) {
- EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
EFI_CONSOLE_CONTROL_SCREEN_MODE mode;
- union {
- void *interface;
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *wtf;
- } u;
- EFI_STATUS efirc;
int rc;
/* On some older EFI 1.10 implementations, we must use the
@@ -441,15 +433,11 @@ static void efi_console_init ( void ) {
* apparently the expected behaviour for all UEFI
* applications. Don't ask.
*/
- if ( ( efirc = bs->OpenProtocol ( efi_systab->ConsoleInHandle,
- &efi_simple_text_input_ex_protocol_guid,
- &u.interface, efi_image_handle,
- efi_systab->ConsoleInHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) == 0 ) {
- efi_conin_ex = u.wtf;
+ if ( ( rc = efi_open_unsafe ( efi_systab->ConsoleInHandle,
+ &efi_simple_text_input_ex_protocol_guid,
+ &efi_conin_ex ) ) == 0 ) {
DBG ( "EFI using SimpleTextInputEx\n" );
} else {
- rc = -EEFI ( efirc );
DBG ( "EFI has no SimpleTextInputEx: %s\n", strerror ( rc ) );
}
}
@@ -458,5 +446,6 @@ static void efi_console_init ( void ) {
* EFI console initialisation function
*/
struct init_fn efi_console_init_fn __init_fn ( INIT_EARLY ) = {
+ .name = "eficonsole",
.initialise = efi_console_init,
};