summaryrefslogtreecommitdiff
path: root/include/efi_selftest.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-18 18:13:13 +0200
committerAlexander Graf <agraf@suse.de>2017-12-01 13:22:55 +0100
commitd78e40d651972ef061c960e4b7da7843383c2ec9 (patch)
tree141b41d60b1966f3f77ca6c7c6aaa4b8157e9cf2 /include/efi_selftest.h
parent1f66a12e237f7ce9dc9b997e7ce0b2a33893ce12 (diff)
downloadu-boot-d78e40d651972ef061c960e4b7da7843383c2ec9.tar.gz
u-boot-d78e40d651972ef061c960e4b7da7843383c2ec9.tar.bz2
u-boot-d78e40d651972ef061c960e4b7da7843383c2ec9.zip
efi_selftest: allow to select a single test for execution
Environment variable efi_selftest is passed as load options to the selftest application. It is used to select a single test to be executed. The load options are an UTF8 string. Yet I decided to keep the name propertiy of the tests as char[] to reduce code size. Special value 'list' displays a list of all available tests. Tests get an on_request property. If this property is set the tests are only executed if explicitly requested. The invocation of efi_selftest is changed to reflect that bootefi selftest with efi_selftest = 'list' will call the Exit bootservice. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/efi_selftest.h')
-rw-r--r--include/efi_selftest.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/efi_selftest.h b/include/efi_selftest.h
index 7ec42a0406..5cc8d4f600 100644
--- a/include/efi_selftest.h
+++ b/include/efi_selftest.h
@@ -12,6 +12,7 @@
#include <common.h>
#include <efi.h>
#include <efi_api.h>
+#include <efi_loader.h>
#include <linker_lists.h>
#define EFI_ST_SUCCESS 0
@@ -72,6 +73,15 @@ void efi_st_printf(const char *fmt, ...)
int efi_st_memcmp(const void *buf1, const void *buf2, size_t length);
/*
+ * Compare an u16 string to a char string.
+ *
+ * @buf1: u16 string
+ * @buf2: char string
+ * @return: 0 if both buffers contain the same bytes
+ */
+int efi_st_strcmp_16_8(const u16 *buf1, const char *buf2);
+
+/*
* Reads an Unicode character from the input device.
*
* @return: Unicode character
@@ -88,6 +98,7 @@ u16 efi_st_get_key(void);
* @setup: set up the unit test
* @teardown: tear down the unit test
* @execute: execute the unit test
+ * @on_request: test is only executed on request
*/
struct efi_unit_test {
const char *name;
@@ -96,6 +107,7 @@ struct efi_unit_test {
const struct efi_system_table *systable);
int (*execute)(void);
int (*teardown)(void);
+ bool on_request;
};
/* Declare a new EFI unit test */