summaryrefslogtreecommitdiff
path: root/lib/execute.c
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
commitca6b8577754558ed790dd305d9579d7d5ed72091 (patch)
treef4aef8def509710b9e5a73ca4fb7105e439636a8 /lib/execute.c
parent3802e1ad5adf91f955b9f1408950e28bad10d830 (diff)
parentf892ac66084ab0315adb0c52e4a39b518730d023 (diff)
downloadefi-boot-shim-ca6b8577754558ed790dd305d9579d7d5ed72091.tar.gz
efi-boot-shim-ca6b8577754558ed790dd305d9579d7d5ed72091.zip
Update upstream source from tag 'upstream/15+1531942534.dd3230d'
Update to upstream version '15+1531942534.dd3230d' with Debian dir 8b167be00338c76b0ddc9164059ce6090c274641
Diffstat (limited to 'lib/execute.c')
-rw-r--r--lib/execute.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/lib/execute.c b/lib/execute.c
index 89328c68..3aff28ad 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -41,8 +41,7 @@
#include <efi.h>
#include <efilib.h>
-#include <guid.h>
-#include <execute.h>
+#include "shim.h"
EFI_STATUS
generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16 **PathName)
@@ -74,7 +73,7 @@ generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16
*PathName = AllocatePool((pathlen + 1 + StrLen(name))*sizeof(CHAR16));
if (!*PathName) {
- Print(L"Failed to allocate path buffer\n");
+ console_print(L"Failed to allocate path buffer\n");
efi_status = EFI_OUT_OF_RESOURCES;
goto error;
}
@@ -96,32 +95,30 @@ error:
EFI_STATUS
execute(EFI_HANDLE image, CHAR16 *name)
{
- EFI_STATUS status;
+ EFI_STATUS efi_status;
EFI_HANDLE h;
EFI_LOADED_IMAGE *li;
EFI_DEVICE_PATH *devpath;
CHAR16 *PathName;
- status = uefi_call_wrapper(BS->HandleProtocol, 3, image,
- &IMAGE_PROTOCOL, (void **)&li);
- if (status != EFI_SUCCESS)
- return status;
+ efi_status = gBS->HandleProtocol(image, &IMAGE_PROTOCOL,
+ (void **) &li);
+ if (EFI_ERROR(efi_status))
+ return efi_status;
-
- status = generate_path(name, li, &devpath, &PathName);
- if (status != EFI_SUCCESS)
- return status;
+ efi_status = generate_path(name, li, &devpath, &PathName);
+ if (EFI_ERROR(efi_status))
+ return efi_status;
- status = uefi_call_wrapper(BS->LoadImage, 6, FALSE, image,
- devpath, NULL, 0, &h);
- if (status != EFI_SUCCESS)
+ efi_status = gBS->LoadImage(FALSE, image, devpath, NULL, 0, &h);
+ if (EFI_ERROR(efi_status))
goto out;
-
- status = uefi_call_wrapper(BS->StartImage, 3, h, NULL, NULL);
- uefi_call_wrapper(BS->UnloadImage, 1, h);
+
+ efi_status = gBS->StartImage(h, NULL, NULL);
+ gBS->UnloadImage(h);
out:
FreePool(PathName);
FreePool(devpath);
- return status;
+ return efi_status;
}