aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-01-15 08:21:22 -0500
committerMatt Fleming <matt.fleming@intel.com>2014-03-04 11:16:16 -0500
commit3e909599215456928e6b42a04f11c2517881570b (patch)
treea3b8608015b94258abc7f5773d8f3a9a5a7c5219 /arch/x86/platform
parent6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff)
efi: Move facility flags to struct efi
As we grow support for more EFI architectures they're going to want the ability to query which EFI features are available on the running system. Instead of storing this information in an architecture-specific place, stick it in the global 'struct efi', which is already the central location for EFI state. While we're at it, let's change the return value of efi_enabled() to be bool and replace all references to 'facility' with 'feature', which is the usual word used to describe the attributes of the running system. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/platform')
-rw-r--r--arch/x86/platform/efi/efi.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 1a201ac7cef8..821562984452 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -67,8 +67,6 @@ struct efi_memory_map memmap;
67static struct efi efi_phys __initdata; 67static struct efi efi_phys __initdata;
68static efi_system_table_t efi_systab __initdata; 68static efi_system_table_t efi_systab __initdata;
69 69
70unsigned long x86_efi_facility;
71
72static __initdata efi_config_table_type_t arch_tables[] = { 70static __initdata efi_config_table_type_t arch_tables[] = {
73#ifdef CONFIG_X86_UV 71#ifdef CONFIG_X86_UV
74 {UV_SYSTEM_TABLE_GUID, "UVsystab", &efi.uv_systab}, 72 {UV_SYSTEM_TABLE_GUID, "UVsystab", &efi.uv_systab},
@@ -78,15 +76,6 @@ static __initdata efi_config_table_type_t arch_tables[] = {
78 76
79u64 efi_setup; /* efi setup_data physical address */ 77u64 efi_setup; /* efi setup_data physical address */
80 78
81/*
82 * Returns 1 if 'facility' is enabled, 0 otherwise.
83 */
84int efi_enabled(int facility)
85{
86 return test_bit(facility, &x86_efi_facility) != 0;
87}
88EXPORT_SYMBOL(efi_enabled);
89
90static bool __initdata disable_runtime = false; 79static bool __initdata disable_runtime = false;
91static int __init setup_noefi(char *arg) 80static int __init setup_noefi(char *arg)
92{ 81{
@@ -455,7 +444,7 @@ void __init efi_reserve_boot_services(void)
455 444
456void __init efi_unmap_memmap(void) 445void __init efi_unmap_memmap(void)
457{ 446{
458 clear_bit(EFI_MEMMAP, &x86_efi_facility); 447 clear_bit(EFI_MEMMAP, &efi.flags);
459 if (memmap.map) { 448 if (memmap.map) {
460 early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); 449 early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
461 memmap.map = NULL; 450 memmap.map = NULL;
@@ -722,7 +711,7 @@ void __init efi_init(void)
722 if (efi_systab_init(efi_phys.systab)) 711 if (efi_systab_init(efi_phys.systab))
723 return; 712 return;
724 713
725 set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility); 714 set_bit(EFI_SYSTEM_TABLES, &efi.flags);
726 715
727 efi.config_table = (unsigned long)efi.systab->tables; 716 efi.config_table = (unsigned long)efi.systab->tables;
728 efi.fw_vendor = (unsigned long)efi.systab->fw_vendor; 717 efi.fw_vendor = (unsigned long)efi.systab->fw_vendor;
@@ -750,7 +739,7 @@ void __init efi_init(void)
750 if (efi_config_init(arch_tables)) 739 if (efi_config_init(arch_tables))
751 return; 740 return;
752 741
753 set_bit(EFI_CONFIG_TABLES, &x86_efi_facility); 742 set_bit(EFI_CONFIG_TABLES, &efi.flags);
754 743
755 /* 744 /*
756 * Note: We currently don't support runtime services on an EFI 745 * Note: We currently don't support runtime services on an EFI
@@ -762,12 +751,12 @@ void __init efi_init(void)
762 else { 751 else {
763 if (disable_runtime || efi_runtime_init()) 752 if (disable_runtime || efi_runtime_init())
764 return; 753 return;
765 set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility); 754 set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
766 } 755 }
767 if (efi_memmap_init()) 756 if (efi_memmap_init())
768 return; 757 return;
769 758
770 set_bit(EFI_MEMMAP, &x86_efi_facility); 759 set_bit(EFI_MEMMAP, &efi.flags);
771 760
772 print_efi_memmap(); 761 print_efi_memmap();
773} 762}