[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>
This commit is contained in:
Michael Brown
2013-04-19 13:34:19 +01:00
parent 7348035231
commit 54409583e2
20 changed files with 212 additions and 200 deletions
+4 -1
View File
@@ -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;
}