diff options
author | Michael Brown <mcb30@etherboot.org> | 2008-11-18 19:45:44 -0800 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-11-19 19:22:49 +0000 |
commit | 3f85626fa95cb356a655d3538db6f05231f07003 (patch) | |
tree | e460ab7fbb1525c43bdbab1018a70f57c8d252a7 /src/interface/efi/efi_timer.c | |
parent | d9b3d0991091b8dd568b17221e335ecf81beb02f (diff) | |
download | ipxe-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_timer.c')
-rw-r--r-- | src/interface/efi/efi_timer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interface/efi/efi_timer.c b/src/interface/efi/efi_timer.c index 66211770a..d1ba43af0 100644 --- a/src/interface/efi/efi_timer.c +++ b/src/interface/efi/efi_timer.c @@ -53,8 +53,8 @@ static void efi_udelay ( unsigned long usecs ) { EFI_STATUS efirc; if ( ( efirc = bs->Stall ( usecs ) ) != 0 ) { - DBG ( "EFI could not delay for %ldus: %x\n", - usecs, efirc ); + DBG ( "EFI could not delay for %ldus: %s\n", + usecs, efi_strerror ( efirc ) ); /* Probably screwed */ } } @@ -71,7 +71,8 @@ static unsigned long efi_currticks ( void ) { /* Read CPU timer 0 (TSC) */ if ( ( efirc = cpu_arch->GetTimerValue ( cpu_arch, 0, &time, NULL ) ) != 0 ) { - DBG ( "EFI could not read CPU timer: %x\n", efirc ); + DBG ( "EFI could not read CPU timer: %s\n", + efi_strerror ( efirc ) ); /* Probably screwed */ return -1UL; } |