From 411443334b048425ed2627657609adaaca16e7e1 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 7 Mar 2015 19:14:01 +0000 Subject: [PATCH] Add error reporting (but not actual handling yet, apart from reporting them) for EFI calls to boot1.efi. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- sys/boot/amd64/boot1.efi/boot1.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/boot/amd64/boot1.efi/boot1.c b/sys/boot/amd64/boot1.efi/boot1.c index cb75d2a12f47..e5719fff10fc 100644 --- a/sys/boot/amd64/boot1.efi/boot1.c +++ b/sys/boot/amd64/boot1.efi/boot1.c @@ -307,12 +307,19 @@ load(const char *fname) /* XXX: For secure boot, we need our own loader here */ status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); + if (EFI_ERROR(status)) + printf("LoadImage failed with error %d\n", status); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); + if (EFI_ERROR(status)) + printf("HandleProtocol failed with error %d\n", status); + loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); + if (EFI_ERROR(status)) + printf("StartImage failed with error %d\n", status); } static void