summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-05-20 23:28:23 +0200
committerTom Rini <trini@konsulko.com>2016-06-06 13:39:15 -0400
commita86aeaf228da739bce6bc40927949efc33672050 (patch)
tree2f3f9a7dbf3ad0228ed1423e91dec1c0ca37fda4 /cmd
parent97d44b1f5c328af97d3c381c77858c8dd32c8e20 (diff)
downloadblackbird-obmc-uboot-a86aeaf228da739bce6bc40927949efc33672050.tar.gz
blackbird-obmc-uboot-a86aeaf228da739bce6bc40927949efc33672050.zip
efi_loader: Add exit support
Some times you may want to exit an EFI payload again, for example to default boot into a PXE installation and decide that you would rather want to boot from the local disk instead. This patch adds exit functionality to the EFI implementation, allowing EFI payloads to exit. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bootefi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index d3a2331870..2a62dce702 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -209,6 +209,12 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
#ifdef DEBUG_EFI
printf("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry);
#endif
+
+ if (setjmp(&loaded_image_info.exit_jmp)) {
+ efi_status_t status = loaded_image_info.exit_status;
+ return status == EFI_SUCCESS ? 0 : -EINVAL;
+ }
+
return entry(&loaded_image_info, &systab);
}
OpenPOWER on IntegriCloud