summaryrefslogtreecommitdiff
path: root/arch/x86/platform
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-01-20 19:17:27 +0300
committerArd Biesheuvel <ardb@kernel.org>2020-02-23 23:59:42 +0300
commit3a0701dc7ff8ebe1031a9f64c99c638929cd2d70 (patch)
treebd12a07fe7aafb7c164d4e1135afc76e470ce04b /arch/x86/platform
parent686312927b13fc30b23b0e0f9be097c292343048 (diff)
downloadlinux-3a0701dc7ff8ebe1031a9f64c99c638929cd2d70.tar.xz
efi: Make efi_config_init() x86 only
The efi_config_init() routine is no longer shared with ia64 so let's move it into the x86 arch code before making further x86 specific changes to it. Tested-by: Tony Luck <tony.luck@intel.com> # arch/ia64 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/x86/platform')
-rw-r--r--arch/x86/platform/efi/efi.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 5bb53da48a4b..f1033f7f9e39 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -431,6 +431,36 @@ static int __init efi_systab_init(u64 phys)
return 0;
}
+static int __init efi_config_init(efi_config_table_type_t *arch_tables)
+{
+ void *config_tables;
+ int sz, ret;
+
+ if (efi.systab->nr_tables == 0)
+ return 0;
+
+ if (efi_enabled(EFI_64BIT))
+ sz = sizeof(efi_config_table_64_t);
+ else
+ sz = sizeof(efi_config_table_32_t);
+
+ /*
+ * Let's see what config tables the firmware passed to us.
+ */
+ config_tables = early_memremap(efi.systab->tables,
+ efi.systab->nr_tables * sz);
+ if (config_tables == NULL) {
+ pr_err("Could not map Configuration table!\n");
+ return -ENOMEM;
+ }
+
+ ret = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sz,
+ arch_tables);
+
+ early_memunmap(config_tables, efi.systab->nr_tables * sz);
+ return ret;
+}
+
void __init efi_init(void)
{
if (IS_ENABLED(CONFIG_X86_32) &&