From 3f85626fa95cb356a655d3538db6f05231f07003 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 18 Nov 2008 19:45:44 -0800 Subject: [efi] Add efi_strerror() EFI_STATUS is defined as an INTN, which maps to UINT32 (i.e. unsigned int) on i386 and UINT64 (i.e. unsigned long) on x86_64. This would require a cast each time the error status is printed. Add efi_strerror() to avoid this ickiness and simultaneously enable prettier reporting of EFI status codes. --- src/image/efi_image.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/image') diff --git a/src/image/efi_image.c b/src/image/efi_image.c index 5992b622c..ae95debc8 100644 --- a/src/image/efi_image.c +++ b/src/image/efi_image.c @@ -43,16 +43,16 @@ static int efi_image_exec ( struct image *image ) { user_to_virt ( image->data, 0 ), image->len, &handle ) ) != 0 ) { /* Not an EFI image */ - DBGC ( image, "EFIIMAGE %p could not load: %x\n", - image, efirc ); + DBGC ( image, "EFIIMAGE %p could not load: %s\n", + image, efi_strerror ( efirc ) ); return -ENOEXEC; } /* Start the image */ if ( ( efirc = bs->StartImage ( handle, &exit_data_size, &exit_data ) ) != 0 ) { - DBGC ( image, "EFIIMAGE %p returned with status %x\n", - image, efirc ); + DBGC ( image, "EFIIMAGE %p returned with status %s\n", + image, efi_strerror ( efirc ) ); goto done; } @@ -81,8 +81,8 @@ static int efi_image_load ( struct image *image ) { user_to_virt ( image->data, 0 ), image->len, &handle ) ) != 0 ) { /* Not an EFI image */ - DBGC ( image, "EFIIMAGE %p could not load: %x\n", - image, efirc ); + DBGC ( image, "EFIIMAGE %p could not load: %s\n", + image, efi_strerror ( efirc ) ); return -ENOEXEC; } -- cgit v1.2.3-55-g7522