From 63a5ae1f7c9383f43e4431316eb0c77bcb079b98 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jul 2021 17:29:15 -0400 Subject: 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 --- include/mock-variables.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') 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 -- cgit v1.2.3