aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-01-15 13:49:51 +0000
committerMark Brown <broonie@linaro.org>2014-07-24 22:58:08 +0100
commit9ed6b4ce7b3488d6bb880b06b868a976aa9fc968 (patch)
treed48756903f2c8ad0698ce3b7926b74b9cfca9298
parente42ede8c5eb6b81188aeb6e6e2c2de99dbd8bcd7 (diff)
downloadlinux-linaro-stable-v3.10/topic/efi.tar.gz
ia64/efi: Implement efi_enabled()v3.10/topic/efi
There's no good reason to keep efi_enabled() under CONFIG_X86 anymore, since nothing about the implementation is specific to x86. Set EFI feature flags in the ia64 boot path instead of claiming to support all features. The old behaviour was actually buggy since efi.memmap never points to a valid memory map, so we shouldn't be claiming to support EFI_MEMMAP. Fortunately, this bug was never triggered because EFI_MEMMAP isn't used outside of arch/x86 currently, but that may not always be the case. Reviewed-and-tested-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com> (cherry picked from commit 092063808c498eccac8e891973bf143e7b60d723) Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--arch/ia64/kernel/efi.c7
-rw-r--r--include/linux/efi.h8
2 files changed, 7 insertions, 8 deletions
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index a2cdb0e8e667..ff0968042829 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -477,6 +477,9 @@ efi_init (void)
char *cp, vendor[100] = "unknown";
int i;
+ set_bit(EFI_BOOT, &efi.flags);
+ set_bit(EFI_64BIT, &efi.flags);
+
/*
* It's too early to be able to use the standard kernel command line
* support...
@@ -529,6 +532,8 @@ efi_init (void)
efi.systab->hdr.revision >> 16,
efi.systab->hdr.revision & 0xffff, vendor);
+ set_bit(EFI_SYSTEM_TABLES, &efi.flags);
+
palo_phys = EFI_INVALID_TABLE_ADDR;
if (efi_config_init(arch_tables) != 0)
@@ -657,6 +662,8 @@ efi_enter_virtual_mode (void)
return;
}
+ set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
+
/*
* Now that EFI is in virtual mode, we call the EFI functions more
* efficiently:
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 842a41b11a90..ae3426a4879c 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -915,8 +915,6 @@ extern int __init efi_setup_pcdp_console(char *);
#define EFI_64BIT 5 /* Is the firmware 64-bit? */
#ifdef CONFIG_EFI
-# ifdef CONFIG_X86
-
/*
* Test whether the above EFI_* bits are enabled.
*/
@@ -924,12 +922,6 @@ static inline bool efi_enabled(int feature)
{
return test_bit(feature, &efi.flags) != 0;
}
-# else
-static inline bool efi_enabled(int feature)
-{
- return true;
-}
-# endif
#else
static inline bool efi_enabled(int feature)
{