efi/libstub: Add definitions for console input and events
[linux-2.6-microblaze.git] / arch / x86 / include / asm / efi.h
index cdcf48d..89dcc7a 100644 (file)
@@ -9,6 +9,7 @@
 #include <asm/nospec-branch.h>
 #include <asm/mmu_context.h>
 #include <linux/build_bug.h>
+#include <linux/kernel.h>
 
 extern unsigned long efi_fw_vendor, efi_config_table;
 
@@ -178,8 +179,10 @@ extern void efi_free_boot_services(void);
 extern pgd_t * __init efi_uv1_memmap_phys_prolog(void);
 extern void __init efi_uv1_memmap_phys_epilog(pgd_t *save_pgd);
 
+/* kexec external ABI */
 struct efi_setup_data {
        u64 fw_vendor;
+       u64 __unused;
        u64 tables;
        u64 smbios;
        u64 reserved[8];
@@ -223,14 +226,21 @@ efi_status_t efi_set_virtual_address_map(unsigned long memory_map_size,
 
 /* arch specific definitions used by the stub code */
 
-__attribute_const__ bool efi_is_64bit(void);
+#ifdef CONFIG_EFI_MIXED
+
+#define ARCH_HAS_EFISTUB_WRAPPERS
+
+static inline bool efi_is_64bit(void)
+{
+       extern const bool efi_is64;
+
+       return efi_is64;
+}
 
 static inline bool efi_is_native(void)
 {
        if (!IS_ENABLED(CONFIG_X86_64))
                return true;
-       if (!IS_ENABLED(CONFIG_EFI_MIXED))
-               return true;
        return efi_is_64bit();
 }
 
@@ -284,6 +294,15 @@ static inline u32 efi64_convert_status(efi_status_t status)
 #define __efi64_argmap_allocate_pool(type, size, buffer)               \
        ((type), (size), efi64_zero_upper(buffer))
 
+#define __efi64_argmap_create_event(type, tpl, f, c, event)            \
+       ((type), (tpl), (f), (c), efi64_zero_upper(event))
+
+#define __efi64_argmap_set_timer(event, type, time)                    \
+       ((event), (type), lower_32_bits(time), upper_32_bits(time))
+
+#define __efi64_argmap_wait_for_event(num, event, index)               \
+       ((num), (event), efi64_zero_upper(index))
+
 #define __efi64_argmap_handle_protocol(handle, protocol, interface)    \
        ((handle), (protocol), efi64_zero_upper(interface))
 
@@ -305,6 +324,10 @@ static inline u32 efi64_convert_status(efi_status_t status)
 #define __efi64_argmap_load_file(protocol, path, policy, bufsize, buf) \
        ((protocol), (path), (policy), efi64_zero_upper(bufsize), (buf))
 
+/* Graphics Output Protocol */
+#define __efi64_argmap_query_mode(gop, mode, size, info)               \
+       ((gop), (mode), efi64_zero_upper(size), efi64_zero_upper(info))
+
 /*
  * The macros below handle the plumbing for the argument mapping. To add a
  * mapping for a specific EFI method, simply define a macro
@@ -333,15 +356,26 @@ static inline u32 efi64_convert_status(efi_status_t status)
 
 #define efi_bs_call(func, ...)                                         \
        (efi_is_native()                                                \
-               ? efi_system_table()->boottime->func(__VA_ARGS__)       \
-               : __efi64_thunk_map(efi_table_attr(efi_system_table(),  \
-                               boottime), func, __VA_ARGS__))
+               ? efi_system_table->boottime->func(__VA_ARGS__)         \
+               : __efi64_thunk_map(efi_table_attr(efi_system_table,    \
+                                                  boottime),           \
+                                   func, __VA_ARGS__))
 
 #define efi_rt_call(func, ...)                                         \
        (efi_is_native()                                                \
-               ? efi_system_table()->runtime->func(__VA_ARGS__)        \
-               : __efi64_thunk_map(efi_table_attr(efi_system_table(),  \
-                               runtime), func, __VA_ARGS__))
+               ? efi_system_table->runtime->func(__VA_ARGS__)          \
+               : __efi64_thunk_map(efi_table_attr(efi_system_table,    \
+                                                  runtime),            \
+                                   func, __VA_ARGS__))
+
+#else /* CONFIG_EFI_MIXED */
+
+static inline bool efi_is_64bit(void)
+{
+       return IS_ENABLED(CONFIG_X86_64);
+}
+
+#endif /* CONFIG_EFI_MIXED */
 
 extern bool efi_reboot_required(void);
 extern bool efi_is_table_address(unsigned long phys_addr);