aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_io.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2008-11-18 19:45:44 -0800
committerMichael Brown <mcb30@etherboot.org>2008-11-19 19:22:49 +0000
commit3f85626fa95cb356a655d3538db6f05231f07003 (patch)
treee460ab7fbb1525c43bdbab1018a70f57c8d252a7 /src/interface/efi/efi_io.c
parentd9b3d0991091b8dd568b17221e335ecf81beb02f (diff)
downloadipxe-3f85626fa95cb356a655d3538db6f05231f07003.tar.gz
[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.
Diffstat (limited to 'src/interface/efi/efi_io.c')
-rw-r--r--src/interface/efi/efi_io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/interface/efi/efi_io.c b/src/interface/efi/efi_io.c
index ef21213c..e11f9bfd 100644
--- a/src/interface/efi/efi_io.c
+++ b/src/interface/efi/efi_io.c
@@ -86,7 +86,8 @@ unsigned long long efi_ioread ( volatile void *io_addr, size_t size ) {
if ( ( efirc = read ( cpu_io, efi_width ( size ),
( intptr_t ) io_addr, 1,
( void * ) &data ) ) != 0 ) {
- DBG ( "EFI I/O read at %p failed: %x\n", io_addr, efirc );
+ DBG ( "EFI I/O read at %p failed: %s\n",
+ io_addr, efi_strerror ( efirc ) );
return -1ULL;
}
@@ -111,7 +112,8 @@ void efi_iowrite ( unsigned long long data, volatile void *io_addr,
if ( ( efirc = write ( cpu_io, efi_width ( size ),
( intptr_t ) io_addr, 1,
( void * ) &data ) ) != 0 ) {
- DBG ( "EFI I/O write at %p failed: %x\n", io_addr, efirc );
+ DBG ( "EFI I/O write at %p failed: %s\n",
+ io_addr, efi_strerror ( efirc ) );
}
}
@@ -134,8 +136,8 @@ void efi_ioreads ( volatile void *io_addr, void *data,
if ( ( efirc = read ( cpu_io, efi_width ( size ),
( intptr_t ) io_addr, count,
( void * ) data ) ) != 0 ) {
- DBG ( "EFI I/O string read at %p failed: %x\n",
- io_addr, efirc );
+ DBG ( "EFI I/O string read at %p failed: %s\n",
+ io_addr, efi_strerror ( efirc ) );
}
}
@@ -158,8 +160,8 @@ void efi_iowrites ( volatile void *io_addr, const void *data,
if ( ( efirc = write ( cpu_io, efi_width ( size ),
( intptr_t ) io_addr, count,
( void * ) data ) ) != 0 ) {
- DBG ( "EFI I/O write at %p failed: %x\n",
- io_addr, efirc );
+ DBG ( "EFI I/O write at %p failed: %s\n",
+ io_addr, efi_strerror ( efirc ) );
}
}