aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-01-15 13:21:22 +0000
committerMark Brown <broonie@linaro.org>2014-07-23 20:58:33 +0100
commitf5c16b28d4e8e93d25fef525374f4dc43a7d58b4 (patch)
tree077ea01a1589dc93ca8b3960da3cc1bad4c057fd /include
parent05c80d3d5303eb5d973f3e455bcbf6b2381402db (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> (cherry picked from commit 3e909599215456928e6b42a04f11c2517881570b) Signed-off-by: Mark Brown <broonie@linaro.org> Conflicts: arch/x86/include/asm/efi.h arch/x86/platform/efi/efi.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/efi.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 9d223d3cce9d..9f2053e2c2fc 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -581,6 +581,7 @@ extern struct efi {
efi_reset_system_t *reset_system;
efi_set_virtual_address_map_t *set_virtual_address_map;
struct efi_memory_map *memmap;
+ unsigned long flags;
} efi;
static inline int
@@ -674,17 +675,24 @@ extern int __init efi_setup_pcdp_console(char *);
#ifdef CONFIG_EFI
# ifdef CONFIG_X86
-extern int efi_enabled(int facility);
+
+/*
+ * Test whether the above EFI_* bits are enabled.
+ */
+static inline bool efi_enabled(int feature)
+{
+ return test_bit(feature, &efi.flags) != 0;
+}
# else
-static inline int efi_enabled(int facility)
+static inline bool efi_enabled(int feature)
{
- return 1;
+ return true;
}
# endif
#else
-static inline int efi_enabled(int facility)
+static inline bool efi_enabled(int feature)
{
- return 0;
+ return false;
}
#endif