[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/18] efi: run EFI specific code on EFI platform only
From: |
Daniel Kiper |
Subject: |
[PATCH 07/18] efi: run EFI specific code on EFI platform only |
Date: |
Fri, 30 Jan 2015 18:54:11 +0100 |
Signed-off-by: Daniel Kiper <address@hidden>
---
xen/arch/x86/shutdown.c | 3 ++-
xen/common/efi/boot.c | 5 +++++
xen/common/efi/runtime.c | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 21f6cf5..1c8336f 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -504,7 +504,8 @@ void machine_restart(unsigned int delay_millisecs)
tboot_shutdown(TB_SHUTDOWN_REBOOT);
}
- efi_reset_system(reboot_mode != 0);
+ if ( efi_platform )
+ efi_reset_system(reboot_mode != 0);
/* Rebooting needs to touch the page at absolute address 0. */
*((unsigned short *)__va(0x472)) = reboot_mode;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8aafcfd..89d081d 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1154,6 +1154,11 @@ void __init efi_init_memory(void)
} *extra, *extra_head = NULL;
#endif
+#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+ if ( !efi_platform )
+ return;
+#endif
+
printk(XENLOG_INFO "EFI memory map:\n");
for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
{
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index b229c69..7c767e4 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -164,6 +164,9 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
{
unsigned int i, n;
+ if ( !efi_platform )
+ return -ENOSYS;
+
switch ( idx )
{
case XEN_FW_EFI_VERSION:
@@ -298,6 +301,9 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
EFI_STATUS status = EFI_NOT_STARTED;
int rc = 0;
+ if ( !efi_platform )
+ return -ENOSYS;
+
switch ( op->function )
{
case XEN_EFI_get_time:
--
1.7.10.4
- [PATCH 01/18] x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags, (continued)
- [PATCH 01/18] x86/boot/reloc: mask out MBI_BOOTDEV from mbi flags, Daniel Kiper, 2015/01/30
- [PATCH 02/18] x86/boot/reloc: create generic alloc and copy functions, Daniel Kiper, 2015/01/30
- [PATCH 03/18] x86/boot: use %ecx instead of %eax, Daniel Kiper, 2015/01/30
- [PATCH 04/18] xen/x86: add multiboot2 protocol support, Daniel Kiper, 2015/01/30
- [PATCH 05/18] efi: split efi_enabled to efi_platform and efi_loader, Daniel Kiper, 2015/01/30
- [PATCH 06/18] x86: remove commented out stale references to efi_enabled, Daniel Kiper, 2015/01/30
- [PATCH 08/18] efi: build xen.gz with EFI code, Daniel Kiper, 2015/01/30
- [PATCH 07/18] efi: run EFI specific code on EFI platform only,
Daniel Kiper <=
- [PATCH 12/18] efi: create efi_find_gop_mode(), Daniel Kiper, 2015/01/30
- [PATCH 09/18] efi: create efi_init(), Daniel Kiper, 2015/01/30
- [PATCH 10/18] efi: create efi_console_set_mode(), Daniel Kiper, 2015/01/30
- [PATCH 11/18] efi: create efi_get_gop(), Daniel Kiper, 2015/01/30
- [PATCH 13/18] efi: create efi_tables(), Daniel Kiper, 2015/01/30
- [PATCH 14/18] efi: create efi_variables(), Daniel Kiper, 2015/01/30
- [PATCH 16/18] efi: create efi_exit_boot(), Daniel Kiper, 2015/01/30
- [PATCH 15/18] efi: create efi_set_gop_mode(), Daniel Kiper, 2015/01/30
- [PATCH 17/18] x86/efi: create new early memory allocator, Daniel Kiper, 2015/01/30
- [PATCH 18/18] x86: add multiboot2 protocol support for EFI platforms, Daniel Kiper, 2015/01/30