diff options
author | Michael Brown | 2013-04-18 22:29:53 +0200 |
---|---|---|
committer | Michael Brown | 2013-04-19 14:34:19 +0200 |
commit | 54409583e29c481556e94a99dc73316d18aafc74 (patch) | |
tree | 150a8ceb85c1b523dc8dd8dd36daf8f6260e6538 /src/interface/efi/efi_snp_hii.c | |
parent | [libc] Redefine low 8 bits of error code as "platform error code" (diff) | |
download | ipxe-54409583e29c481556e94a99dc73316d18aafc74.tar.gz ipxe-54409583e29c481556e94a99dc73316d18aafc74.tar.xz ipxe-54409583e29c481556e94a99dc73316d18aafc74.zip |
[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>
Diffstat (limited to 'src/interface/efi/efi_snp_hii.c')
-rw-r--r-- | src/interface/efi/efi_snp_hii.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/interface/efi/efi_snp_hii.c b/src/interface/efi/efi_snp_hii.c index 3a1193a3..9ea15a62 100644 --- a/src/interface/efi/efi_snp_hii.c +++ b/src/interface/efi/efi_snp_hii.c @@ -544,7 +544,7 @@ efi_snp_hii_extract_config ( const EFI_HII_CONFIG_ACCESS_PROTOCOL *hii, if ( ( rc = efi_snp_hii_process ( snpdev, pos, progress, results, &have_setting, efi_snp_hii_fetch ) ) != 0 ) { - return RC_TO_EFIRC ( rc ); + return EFIRC ( rc ); } } @@ -558,7 +558,7 @@ efi_snp_hii_extract_config ( const EFI_HII_CONFIG_ACCESS_PROTOCOL *hii, if ( ( rc = efi_snp_hii_fetch ( snpdev, setting->name, NULL, results, NULL ) ) != 0 ) { - return RC_TO_EFIRC ( rc ); + return EFIRC ( rc ); } } } @@ -592,7 +592,7 @@ efi_snp_hii_route_config ( const EFI_HII_CONFIG_ACCESS_PROTOCOL *hii, if ( ( rc = efi_snp_hii_process ( snpdev, pos, progress, NULL, NULL, efi_snp_hii_store ) ) != 0 ) { - return RC_TO_EFIRC ( rc ); + return EFIRC ( rc ); } } @@ -657,9 +657,9 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) { if ( ( efirc = efihii->NewPackageList ( efihii, snpdev->package_list, snpdev->handle, &snpdev->hii_handle ) ) != 0 ) { + rc = -EEFI ( efirc ); DBGC ( snpdev, "SNPDEV %p could not add HII packages: %s\n", - snpdev, efi_strerror ( efirc ) ); - rc = EFIRC_TO_RC ( efirc ); + snpdev, strerror ( rc ) ); goto err_new_package_list; } @@ -668,9 +668,9 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) { &snpdev->handle, &efi_hii_config_access_protocol_guid, &snpdev->hii, NULL ) ) != 0 ) { + rc = -EEFI ( efirc ); DBGC ( snpdev, "SNPDEV %p could not install HII protocol: %s\n", - snpdev, efi_strerror ( efirc ) ); - rc = EFIRC_TO_RC ( efirc ); + snpdev, strerror ( rc ) ); goto err_install_protocol; } |