@@ -456,6 +456,7 @@ void __init efi_init(void)
return;
efi.config_table = (unsigned long)efi.systab->tables;
+ efi.nr_config_table = (unsigned long)efi.systab->nr_tables;
efi.fw_vendor = (unsigned long)efi.systab->fw_vendor;
efi.runtime = (unsigned long)efi.systab->runtime;
@@ -143,8 +143,10 @@ static int __init uefi_init(void)
sizeof(efi_config_table_t),
arch_tables);
- if (!retval)
+ if (!retval) {
efi.config_table = (unsigned long)efi.systab->tables;
+ efi.nr_config_table = (unsigned long)efi.systab->nr_tables;
+ }
early_memunmap(config_tables, table_size);
out:
@@ -46,6 +46,7 @@ struct efi __read_mostly efi = {
.fw_vendor = EFI_INVALID_TABLE_ADDR,
.runtime = EFI_INVALID_TABLE_ADDR,
.config_table = EFI_INVALID_TABLE_ADDR,
+ .nr_config_table = 0,
.esrt = EFI_INVALID_TABLE_ADDR,
.properties_table = EFI_INVALID_TABLE_ADDR,
.mem_attr_table = EFI_INVALID_TABLE_ADDR,
@@ -913,6 +913,7 @@ extern struct efi {
unsigned long fw_vendor; /* fw_vendor */
unsigned long runtime; /* runtime table */
unsigned long config_table; /* config tables */
+ unsigned long nr_config_table; /* the number of config tables */
unsigned long esrt; /* ESRT table */
unsigned long properties_table; /* properties table */
unsigned long mem_attr_table; /* memory attributes table */
The 'nr_config_table' and 'config_table' (already in efi structure) in efi structure provide a way for some driver(e.g. capsule-pstore goes through the configuration table to extract crash capsules to aid in debugging) to iterate over the EFI configuration table array. Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> --- arch/x86/platform/efi/efi.c | 1 + drivers/firmware/efi/arm-init.c | 4 +++- drivers/firmware/efi/efi.c | 1 + include/linux/efi.h | 1 + 4 files changed, 6 insertions(+), 1 deletion(-)