summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/efi.h
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-01-10 22:48:30 +0400
committerMatt Fleming <matt.fleming@intel.com>2014-03-05 01:43:14 +0400
commit4f9dbcfc40299ddaa780fe8c1cd74998c1be3af5 (patch)
treef6d2f85b23fae5ee8d9da79f30c47351aa890d5b /arch/x86/include/asm/efi.h
parentb8ff87a6158886771677e6dc8139bac6e3cba717 (diff)
downloadlinux-4f9dbcfc40299ddaa780fe8c1cd74998c1be3af5.tar.xz
x86/efi: Add mixed runtime services support
Setup the runtime services based on whether we're booting in EFI native mode or not. For non-native mode we need to thunk from 64-bit into 32-bit mode before invoking the EFI runtime services. Using the runtime services after SetVirtualAddressMap() is slightly more complicated because we need to ensure that all the addresses we pass to the firmware are below the 4GB boundary so that they can be addressed with 32-bit pointers, see efi_setup_page_tables(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/include/asm/efi.h')
-rw-r--r--arch/x86/include/asm/efi.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 85856868507b..85935e6f69f3 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -154,6 +154,27 @@ static inline bool efi_is_native(void)
extern struct console early_efi_console;
extern void parse_efi_setup(u64 phys_addr, u32 data_len);
+
+#ifdef CONFIG_EFI_MIXED
+extern void efi_thunk_runtime_setup(void);
+extern efi_status_t efi_thunk_set_virtual_address_map(
+ void *phys_set_virtual_address_map,
+ unsigned long memory_map_size,
+ unsigned long descriptor_size,
+ u32 descriptor_version,
+ efi_memory_desc_t *virtual_map);
+#else
+static inline void efi_thunk_runtime_setup(void) {}
+static inline efi_status_t efi_thunk_set_virtual_address_map(
+ void *phys_set_virtual_address_map,
+ unsigned long memory_map_size,
+ unsigned long descriptor_size,
+ u32 descriptor_version,
+ efi_memory_desc_t *virtual_map)
+{
+ return EFI_SUCCESS;
+}
+#endif /* CONFIG_EFI_MIXED */
#else
/*
* IF EFI is not configured, have the EFI calls return -ENOSYS.