[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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user