summaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-12-26 12:49:09 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-02-16 15:42:20 +0100
commit8f7e2b2980a2d964db60a19a5d2ef8532caddf7d (patch)
tree08140cfb6de91b29c1a5ff58da9c6587736b1498 /cmd/bootefi.c
parent0e18f584de59a86aaf86bd328dbd16fbd0175b3d (diff)
downloadu-boot-8f7e2b2980a2d964db60a19a5d2ef8532caddf7d.tar.gz
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage(). Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index ee685d8644..7f9913c0ee 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -266,9 +266,6 @@ static efi_status_t do_bootefi_exec(void *efi,
struct efi_loaded_image_obj *image_obj = NULL;
struct efi_loaded_image *loaded_image_info = NULL;
- EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
- struct efi_system_table *st);
-
/*
* Special case for efi payload not loaded from disk, such as
* 'bootefi hello' or for example payload loaded directly into
@@ -300,11 +297,9 @@ static efi_status_t do_bootefi_exec(void *efi,
goto err_prepare;
/* Load the EFI payload */
- entry = efi_load_pe(image_obj, efi, loaded_image_info);
- if (!entry) {
- ret = EFI_LOAD_ERROR;
+ ret = efi_load_pe(image_obj, efi, loaded_image_info);
+ if (ret != EFI_SUCCESS)
goto err_prepare;
- }
if (memdp) {
struct efi_device_path_memory *mdp = (void *)memdp;
@@ -319,14 +314,14 @@ static efi_status_t do_bootefi_exec(void *efi,
"{ro,boot}(blob)0000000000000000");
/* Call our payload! */
- debug("%s: Jumping to 0x%p\n", __func__, entry);
+ debug("%s: Jumping to 0x%p\n", __func__, image_obj->entry);
if (setjmp(&image_obj->exit_jmp)) {
ret = image_obj->exit_status;
goto err_prepare;
}
- ret = efi_do_enter(&image_obj->header, &systab, entry);
+ ret = efi_do_enter(&image_obj->header, &systab, image_obj->entry);
err_prepare:
/* image has returned, loaded-image obj goes *poof*: */