summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_debug.c
diff options
context:
space:
mode:
authorMichael Brown2013-04-18 22:29:53 +0200
committerMichael Brown2013-04-19 14:34:19 +0200
commit54409583e29c481556e94a99dc73316d18aafc74 (patch)
tree150a8ceb85c1b523dc8dd8dd36daf8f6260e6538 /src/interface/efi/efi_debug.c
parent[libc] Redefine low 8 bits of error code as "platform error code" (diff)
downloadipxe-54409583e29c481556e94a99dc73316d18aafc74.tar.gz
ipxe-54409583e29c481556e94a99dc73316d18aafc74.tar.xz
ipxe-54409583e29c481556e94a99dc73316d18aafc74.zip
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_debug.c')
-rw-r--r--src/interface/efi/efi_debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interface/efi/efi_debug.c b/src/interface/efi/efi_debug.c
index a7ba7e2e..4ed66607 100644
--- a/src/interface/efi/efi_debug.c
+++ b/src/interface/efi/efi_debug.c
@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <ipxe/uuid.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>
@@ -67,12 +68,14 @@ void dbg_efi_protocols ( EFI_HANDLE handle ) {
UINTN count;
unsigned int i;
EFI_STATUS efirc;
+ int rc;
/* Retrieve list of protocols */
if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
&count ) ) != 0 ) {
+ rc = -EEFI ( efirc );
printf ( "EFI could not retrieve protocols for %p: %s\n",
- handle, efi_strerror ( efirc ) );
+ handle, strerror ( rc ) );
return;
}