summaryrefslogtreecommitdiff
path: root/lib/efi_loader/helloworld.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-11-07 08:47:08 -0700
committerAlexander Graf <agraf@suse.de>2016-11-14 23:24:03 +0100
commitc7ae3dfdccc171543804d6577ee41ab03e7a09bc (patch)
treeec3307e4f3a686ba6972b1785e6a3f9d488e5af1 /lib/efi_loader/helloworld.c
parentbb1ae55948377b6b75d2230fd8fea69106477d81 (diff)
efi: Add support for a hello world test program
It is useful to have a basic sanity check for EFI loader support. Add a 'bootefi hello' command which loads HelloWord.efi and runs it under U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> [agraf: Fix documentation, add unfulfilled kconfig dep] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/helloworld.c')
-rw-r--r--lib/efi_loader/helloworld.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c
new file mode 100644
index 0000000000..03e65ab133
--- /dev/null
+++ b/lib/efi_loader/helloworld.c
@@ -0,0 +1,24 @@
+/*
+ * EFI hello world
+ *
+ * Copyright (c) 2016 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <part_efi.h>
+#include <efi_api.h>
+
+efi_status_t EFIAPI efi_main(efi_handle_t handle,
+ struct efi_system_table *systable)
+{
+ struct efi_simple_text_output_protocol *con_out = systable->con_out;
+ struct efi_boot_services *boottime = systable->boottime;
+
+ con_out->output_string(con_out, L"Hello, world!\n");
+ boottime->exit(handle, 0, 0, NULL);
+
+ return EFI_SUCCESS;
+}