]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/efi_selftest.h
arm: zynq: Update years in copyright to reflect latest changes
[people/ms/u-boot.git] / include / efi_selftest.h
index 76304a2b2a7fc9b781a3122cf34c695cb50b46fc..be5ba4bfa91ccc0b8eca88cda6d06c42a3737f3f 100644 (file)
 #include <common.h>
 #include <efi.h>
 #include <efi_api.h>
+#include <efi_loader.h>
 #include <linker_lists.h>
 
+#define EFI_ST_SUCCESS 0
+#define EFI_ST_FAILURE 1
+
 /*
  * Prints an error message.
  *
  * @...        format string followed by fields to print
  */
 #define efi_st_error(...) \
-       efi_st_printf("%s(%u):\nERROR: ", __FILE__, __LINE__); \
-       efi_st_printf(__VA_ARGS__) \
+       (efi_st_printf("%s(%u):\nERROR: ", __FILE__, __LINE__), \
+       efi_st_printf(__VA_ARGS__)) \
+
+/*
+ * Prints a TODO message.
+ *
+ * @...        format string followed by fields to print
+ */
+#define efi_st_todo(...) \
+       (efi_st_printf("%s(%u):\nTODO: ", __FILE__, __LINE__), \
+       efi_st_printf(__VA_ARGS__)) \
 
 /*
  * A test may be setup and executed at boottime,
@@ -57,6 +70,26 @@ void efi_st_exit_boot_services(void);
 void efi_st_printf(const char *fmt, ...)
                 __attribute__ ((format (__printf__, 1, 2)));
 
+/*
+ * Compare memory.
+ * We cannot use lib/string.c due to different CFLAGS values.
+ *
+ * @buf1:      first buffer
+ * @buf2:      second buffer
+ * @length:    number of bytes to compare
+ * @return:    0 if both buffers contain the same bytes
+ */
+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.
  *
@@ -74,6 +107,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;
@@ -82,6 +116,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 */