diff options
author | xypron.glpk@gmx.de <xypron.glpk@gmx.de> | 2017-07-04 23:15:23 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-07-19 14:14:41 +0200 |
commit | 1da1bac477581fdb8aa093b6ed842874ffc5916d (patch) | |
tree | 26a6388809a5f28fad575b758386094490d3391c /cmd/bootefi.c | |
parent | 3c8ffb68753d03a74e680a9a493828da517eeeb7 (diff) | |
download | u-boot-1da1bac477581fdb8aa093b6ed842874ffc5916d.tar.gz |
efi_loader: provide meaningful status code
Currenty any EFI status other than EFI_SUCCESS is reported as
Application terminated, r = -22
With the patch the status code returned by the EFI application
is printed.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r-- | cmd/bootefi.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c index e6487dad21..08c60e6fa9 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -253,8 +253,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt) debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry); if (setjmp(&loaded_image_info.exit_jmp)) { - efi_status_t status = loaded_image_info.exit_status; - return status == EFI_SUCCESS ? 0 : -EINVAL; + return loaded_image_info.exit_status; } #ifdef CONFIG_ARM64 @@ -282,7 +281,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *saddr, *sfdt; unsigned long addr, fdt_addr = 0; - int r = 0; + unsigned long r; if (argc < 2) return CMD_RET_USAGE; @@ -307,12 +306,13 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("## Starting EFI application at %08lx ...\n", addr); r = do_bootefi_exec((void *)addr, (void*)fdt_addr); - printf("## Application terminated, r = %d\n", r); + printf("## Application terminated, r = %lu\n", + r & ~EFI_ERROR_MASK); - if (r != 0) - r = 1; - - return r; + if (r != EFI_SUCCESS) + return 1; + else + return 0; } #ifdef CONFIG_SYS_LONGHELP |