Skip to content

Commit 3a0701d

Browse files
committed
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 <[email protected]> # arch/ia64 Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 6863129 commit 3a0701d

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

arch/x86/platform/efi/efi.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,36 @@ static int __init efi_systab_init(u64 phys)
431431
return 0;
432432
}
433433

434+
static int __init efi_config_init(efi_config_table_type_t *arch_tables)
435+
{
436+
void *config_tables;
437+
int sz, ret;
438+
439+
if (efi.systab->nr_tables == 0)
440+
return 0;
441+
442+
if (efi_enabled(EFI_64BIT))
443+
sz = sizeof(efi_config_table_64_t);
444+
else
445+
sz = sizeof(efi_config_table_32_t);
446+
447+
/*
448+
* Let's see what config tables the firmware passed to us.
449+
*/
450+
config_tables = early_memremap(efi.systab->tables,
451+
efi.systab->nr_tables * sz);
452+
if (config_tables == NULL) {
453+
pr_err("Could not map Configuration table!\n");
454+
return -ENOMEM;
455+
}
456+
457+
ret = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sz,
458+
arch_tables);
459+
460+
early_memunmap(config_tables, efi.systab->nr_tables * sz);
461+
return ret;
462+
}
463+
434464
void __init efi_init(void)
435465
{
436466
if (IS_ENABLED(CONFIG_X86_32) &&

drivers/firmware/efi/efi.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -601,37 +601,6 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz,
601601
return 0;
602602
}
603603

604-
int __init efi_config_init(efi_config_table_type_t *arch_tables)
605-
{
606-
void *config_tables;
607-
int sz, ret;
608-
609-
if (efi.systab->nr_tables == 0)
610-
return 0;
611-
612-
if (efi_enabled(EFI_64BIT))
613-
sz = sizeof(efi_config_table_64_t);
614-
else
615-
sz = sizeof(efi_config_table_32_t);
616-
617-
/*
618-
* Let's see what config tables the firmware passed to us.
619-
*/
620-
config_tables = early_memremap(efi.systab->tables,
621-
efi.systab->nr_tables * sz);
622-
if (config_tables == NULL) {
623-
pr_err("Could not map Configuration table!\n");
624-
return -ENOMEM;
625-
}
626-
627-
ret = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sz,
628-
arch_tables);
629-
630-
early_memunmap(config_tables, efi.systab->nr_tables * sz);
631-
return ret;
632-
}
633-
634-
635604
int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr,
636605
int min_major_version)
637606
{

include/linux/efi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ extern int __init efi_memmap_split_count(efi_memory_desc_t *md,
608608
extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap,
609609
void *buf, struct efi_mem_range *mem);
610610

611-
extern int efi_config_init(efi_config_table_type_t *arch_tables);
612611
#ifdef CONFIG_EFI_ESRT
613612
extern void __init efi_esrt_init(void);
614613
#else

0 commit comments

Comments
 (0)