Abstract out support for locating an EFI config table
We want to grab a pointer to the TPM final events table, so abstract out the existing code for finding an FDT table and make it generic. Signed-off-by: Matthew Garrett <mjg59@google.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
This commit is contained in:

committed by
Jarkko Sakkinen

parent
db4d8cb9c9
commit
82d736ac56
@@ -926,3 +926,18 @@ free_map:
|
||||
fail:
|
||||
return status;
|
||||
}
|
||||
|
||||
void *get_efi_config_table(efi_system_table_t *sys_table, efi_guid_t guid)
|
||||
{
|
||||
efi_config_table_t *tables = (efi_config_table_t *)sys_table->tables;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sys_table->nr_tables; i++) {
|
||||
if (efi_guidcmp(tables[i].guid, guid) != 0)
|
||||
continue;
|
||||
|
||||
return (void *)tables[i].table;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user