Merge tag 'xfs-for-linus-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / firmware / efi / runtime-wrappers.c
index 23bef6bb73ee58db932e7fd34100e4d850e73a4a..41958774cde301e5e1d1d5f3eef7be6e1eea0b59 100644 (file)
 #include <linux/stringify.h>
 #include <asm/efi.h>
 
-static void efi_call_virt_check_flags(unsigned long flags, const char *call)
+/*
+ * Wrap around the new efi_call_virt_generic() macros so that the
+ * code doesn't get too cluttered:
+ */
+#define efi_call_virt(f, args...)   \
+       efi_call_virt_pointer(efi.systab->runtime, f, args)
+#define __efi_call_virt(f, args...) \
+       __efi_call_virt_pointer(efi.systab->runtime, f, args)
+
+void efi_call_virt_check_flags(unsigned long flags, const char *call)
 {
        unsigned long cur_flags, mismatch;
 
@@ -38,48 +47,6 @@ static void efi_call_virt_check_flags(unsigned long flags, const char *call)
        local_irq_restore(flags);
 }
 
-/*
- * Arch code can implement the following three template macros, avoiding
- * reptition for the void/non-void return cases of {__,}efi_call_virt:
- *
- *  * arch_efi_call_virt_setup
- *
- *    Sets up the environment for the call (e.g. switching page tables,
- *    allowing kernel-mode use of floating point, if required).
- *
- *  * arch_efi_call_virt
- *
- *    Performs the call. The last expression in the macro must be the call
- *    itself, allowing the logic to be shared by the void and non-void
- *    cases.
- *
- *  * arch_efi_call_virt_teardown
- *
- *    Restores the usual kernel environment once the call has returned.
- */
-
-#define efi_call_virt(f, args...)                                      \
-({                                                                     \
-       efi_status_t __s;                                               \
-       unsigned long flags;                                            \
-       arch_efi_call_virt_setup();                                     \
-       local_save_flags(flags);                                        \
-       __s = arch_efi_call_virt(f, args);                              \
-       efi_call_virt_check_flags(flags, __stringify(f));               \
-       arch_efi_call_virt_teardown();                                  \
-       __s;                                                            \
-})
-
-#define __efi_call_virt(f, args...)                                    \
-({                                                                     \
-       unsigned long flags;                                            \
-       arch_efi_call_virt_setup();                                     \
-       local_save_flags(flags);                                        \
-       arch_efi_call_virt(f, args);                                    \
-       efi_call_virt_check_flags(flags, __stringify(f));               \
-       arch_efi_call_virt_teardown();                                  \
-})
-
 /*
  * According to section 7.1 of the UEFI spec, Runtime Services are not fully
  * reentrant, and there are particular combinations of calls that need to be