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/interface/efi/efi_umalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/interface/efi/efi_umalloc.c') diff --git a/src/interface/efi/efi_umalloc.c b/src/interface/efi/efi_umalloc.c index 531a1c3a..4de3789d 100644 --- a/src/interface/efi/efi_umalloc.c +++ b/src/interface/efi/efi_umalloc.c @@ -56,8 +56,8 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) { EfiBootServicesData, new_pages, &phys_addr ) ) != 0 ) { - DBG ( "EFI could not allocate %d pages: %x\n", - new_pages, efirc ); + DBG ( "EFI could not allocate %d pages: %s\n", + new_pages, efi_strerror ( efirc ) ); return UNULL; } assert ( phys_addr != 0 ); @@ -81,8 +81,8 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) { old_pages = ( EFI_SIZE_TO_PAGES ( old_size ) + 1 ); phys_addr = user_to_phys ( old_ptr, -EFI_PAGE_SIZE ); if ( ( efirc = bs->FreePages ( phys_addr, old_pages ) ) != 0 ){ - DBG ( "EFI could not free %d pages at %llx: %x\n", - old_pages, phys_addr, efirc ); + DBG ( "EFI could not free %d pages at %llx: %s\n", + old_pages, phys_addr, efi_strerror ( efirc ) ); /* Not fatal; we have leaked memory but successfully * allocated (if asked to do so). */ -- cgit v1.2.3-55-g7522