From 54409583e29c481556e94a99dc73316d18aafc74 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 18 Apr 2013 21:29:53 +0100 Subject: [efi] Perform meaningful error code conversions Exploit the redefinition of iPXE error codes to include a "platform error code" to allow for meaningful conversion of EFI_STATUS values to iPXE errors and vice versa. Signed-off-by: Michael Brown --- src/interface/efi/efi_console.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/interface/efi/efi_console.c') diff --git a/src/interface/efi/efi_console.c b/src/interface/efi/efi_console.c index a30ca301b..d86d30c91 100644 --- a/src/interface/efi/efi_console.c +++ b/src/interface/efi/efi_console.c @@ -20,6 +20,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include +#include +#include #include #include #include @@ -227,6 +229,7 @@ static int efi_getchar ( void ) { const char *ansi_seq; EFI_INPUT_KEY key; EFI_STATUS efirc; + int rc; /* If we are mid-sequence, pass out the next byte */ if ( *ansi_input ) @@ -234,8 +237,8 @@ static int efi_getchar ( void ) { /* Read key from real EFI console */ if ( ( efirc = conin->ReadKeyStroke ( conin, &key ) ) != 0 ) { - DBG ( "EFI could not read keystroke: %s\n", - efi_strerror ( efirc ) ); + rc = -EEFI ( efirc ); + DBG ( "EFI could not read keystroke: %s\n", strerror ( rc ) ); return 0; } DBG2 ( "EFI read key stroke with unicode %04x scancode %04x\n", -- cgit v1.2.3-55-g7522