summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-12-18 17:39:54 +0000
committeremaste <emaste@FreeBSD.org>2015-12-18 17:39:54 +0000
commitbd6c2ef4d98b59d8b7bd987621bd8c291d57b529 (patch)
treefc345d7f06736b66592059ca998135c9f8f806b0
parent80c240efb71ee222ef95a7c1d16d4cea3d479708 (diff)
downloadFreeBSD-src-bd6c2ef4d98b59d8b7bd987621bd8c291d57b529.zip
FreeBSD-src-bd6c2ef4d98b59d8b7bd987621bd8c291d57b529.tar.gz
loader.efi: show EFI error number, not full status value
EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). MFC after: 1 week Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/boot/efi/loader/bootinfo.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/boot/efi/loader/bootinfo.c b/sys/boot/efi/loader/bootinfo.c
index c9dbe8d..f9f8229 100644
--- a/sys/boot/efi/loader/bootinfo.c
+++ b/sys/boot/efi/loader/bootinfo.c
@@ -250,8 +250,8 @@ bi_add_efi_data_and_exit(struct preloaded_file *kfp,
for (retry = 2; retry > 0; retry--) {
status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver);
if (EFI_ERROR(status)) {
- printf("%s: GetMemoryMap() returned 0x%lx\n", __func__,
- (long)status);
+ printf("%s: GetMemoryMap error %lu\n", __func__,
+ (unsigned long)(status & ~EFI_ERROR_MASK));
return (EINVAL);
}
status = BS->ExitBootServices(IH, efi_mapkey);
@@ -264,7 +264,8 @@ bi_add_efi_data_and_exit(struct preloaded_file *kfp,
return (0);
}
}
- printf("ExitBootServices() returned 0x%lx\n", (long)status);
+ printf("ExitBootServices error %lu\n",
+ (unsigned long)(status & ~EFI_ERROR_MASK));
return (EINVAL);
}
@@ -317,8 +318,8 @@ bi_load_efi_data(struct preloaded_file *kfp)
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages,
&addr);
if (EFI_ERROR(status)) {
- printf("%s: AllocatePages() returned 0x%lx\n", __func__,
- (long)status);
+ printf("%s: AllocatePages error %lu\n", __func__,
+ (unsigned long)(status & ~EFI_ERROR_MASK));
return (ENOMEM);
}
OpenPOWER on IntegriCloud