summaryrefslogtreecommitdiff
path: root/include/mock-variables.h
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-07-26 17:29:15 -0400
committerPeter Jones <pjones@redhat.com>2021-09-07 17:05:04 -0400
commit63a5ae1f7c9383f43e4431316eb0c77bcb079b98 (patch)
treef9a3bd604c661a9143c5490ce0b34f86e7eb38fc /include/mock-variables.h
parent3386d4f5b7cf63fba4b1ba9b1c2878617b141b23 (diff)
downloadefi-boot-shim-63a5ae1f7c9383f43e4431316eb0c77bcb079b98.tar.gz
efi-boot-shim-63a5ae1f7c9383f43e4431316eb0c77bcb079b98.zip
tests: Add config table support
This adds a simple implementation of ST->ConfigurationTable, ST->NumberOfTableEntries, and BS->InstallConfigurationTable to our test harness. Currently it is limited at 1024 entries, but that should be well more than enough for any tests we've currently considered. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include/mock-variables.h')
-rw-r--r--include/mock-variables.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/mock-variables.h b/include/mock-variables.h
index fc276ce7..759fd1f0 100644
--- a/include/mock-variables.h
+++ b/include/mock-variables.h
@@ -21,6 +21,8 @@ EFI_STATUS EFIAPI mock_query_variable_info(UINT32 attrs,
UINT64 *remaining_var_storage,
UINT64 *max_var_size);
+EFI_STATUS EFIAPI mock_install_configuration_table(EFI_GUID *guid, VOID *table);
+
struct mock_variable_limits {
UINT32 attrs;
UINT64 *max_var_storage;
@@ -40,6 +42,7 @@ typedef enum {
} mock_sort_policy_t;
extern mock_sort_policy_t mock_variable_sort_policy;
+extern mock_sort_policy_t mock_config_table_sort_policy;
#define MOCK_VAR_DELETE_ATTR_ALLOW_ZERO 0x01
#define MOCK_VAR_DELETE_ATTR_ALOW_MISMATCH 0x02
@@ -110,7 +113,8 @@ void mock_load_variables(const char *const dirname, const char *filters[],
void mock_install_query_variable_info(void);
void mock_uninstall_query_variable_info(void);
void mock_reset_variables(void);
-void mock_finalize_vars(void);
+void mock_reset_config_table(void);
+void mock_finalize_vars_and_configs(void);
typedef enum {
NONE = 0,
@@ -171,5 +175,8 @@ typedef void (mock_query_variable_info_post_hook_t)(
const int line, const char * const func);
extern mock_query_variable_info_post_hook_t *mock_query_variable_info_post_hook;
+#define MOCK_CONFIG_TABLE_ENTRIES 1024
+extern EFI_CONFIGURATION_TABLE mock_config_table[MOCK_CONFIG_TABLE_ENTRIES];
+
#endif /* !SHIM_MOCK_VARIABLES_H_ */
// vim:fenc=utf-8:tw=75:noet