Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
[firefly-linux-kernel-4.4.55.git] / include / linux / efi.h
index 8b84916dc6719ce46430fa791aa27c0bf8b16835..9bf2f1fcae27789e54336f053fecabe4655b1fbd 100644 (file)
@@ -618,18 +618,30 @@ extern int __init efi_setup_pcdp_console(char *);
 #endif
 
 /*
- * We play games with efi_enabled so that the compiler will, if possible, remove
- * EFI-related code altogether.
+ * We play games with efi_enabled so that the compiler will, if
+ * possible, remove EFI-related code altogether.
  */
+#define EFI_BOOT               0       /* Were we booted from EFI? */
+#define EFI_SYSTEM_TABLES      1       /* Can we use EFI system tables? */
+#define EFI_CONFIG_TABLES      2       /* Can we use EFI config tables? */
+#define EFI_RUNTIME_SERVICES   3       /* Can we use runtime services? */
+#define EFI_MEMMAP             4       /* Can we use EFI memory map? */
+#define EFI_64BIT              5       /* Is the firmware 64-bit? */
+
 #ifdef CONFIG_EFI
 # ifdef CONFIG_X86
-   extern int efi_enabled;
-   extern bool efi_64bit;
+extern int efi_enabled(int facility);
 # else
-#  define efi_enabled 1
+static inline int efi_enabled(int facility)
+{
+       return 1;
+}
 # endif
 #else
-# define efi_enabled 0
+static inline int efi_enabled(int facility)
+{
+       return 0;
+}
 #endif
 
 /*
@@ -728,7 +740,8 @@ struct efivars {
         * 1) ->list - adds, removals, reads, writes
         * 2) ops.[gs]et_variable() calls.
         * It must not be held when creating sysfs entries or calling kmalloc.
-        * ops.get_next_variable() is only called from register_efivars(),
+        * ops.get_next_variable() is only called from register_efivars()
+        * or efivar_update_sysfs_entries(),
         * which is protected by the BKL, so that path is safe.
         */
        spinlock_t lock;