From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YHFn1-0002Yx-5v for mharc-grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFmw-0002RO-CO for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHFmq-0007q8-AM for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:26 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:36850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFmq-0007py-4L for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:20 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0UHt9vE003189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Jan 2015 17:55:10 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHt8Fk010004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 30 Jan 2015 17:55:09 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHt7du001676; Fri, 30 Jan 2015 17:55:07 GMT Received: from olila.local.net-space.pl (/10.175.253.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Jan 2015 09:55:06 -0800 From: Daniel Kiper To: xen-devel@lists.xenproject.org, grub-devel@gnu.org Subject: [PATCH 07/18] efi: run EFI specific code on EFI platform only Date: Fri, 30 Jan 2015 18:54:11 +0100 Message-Id: <1422640462-28103-8-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: jgross@suse.com, keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2015 17:55:30 -0000 Signed-off-by: Daniel Kiper --- 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