From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YHFnP-0002xV-HL for mharc-grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFnJ-0002lr-Fl for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHFnE-00086W-Ui for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:49 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:37092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHFnE-00085x-Fy for grub-devel@gnu.org; Fri, 30 Jan 2015 12:55:44 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0UHtbWV003719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Jan 2015 17:55:38 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHtalb025737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 30 Jan 2015 17:55:37 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0UHtaRl025719; Fri, 30 Jan 2015 17:55:36 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:35 -0800 From: Daniel Kiper To: xen-devel@lists.xenproject.org, grub-devel@gnu.org Subject: [PATCH 14/18] efi: create efi_variables() Date: Fri, 30 Jan 2015 18:54:18 +0100 Message-Id: <1422640462-28103-15-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: acsinet21.oracle.com [141.146.126.237] 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:54 -0000 ..which collects variable store parameters. We need this to support multiboot2 protocol on EFI platforms. Signed-off-by: Daniel Kiper --- xen/common/efi/boot.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index cf0fbc2..2379022 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -822,6 +822,29 @@ static void __init setup_efi_pci(void) efi_bs->FreePool(handles); } +static void __init efi_variables(void) +{ + EFI_STATUS status; + + status = (efi_rs->Hdr.Revision >> 16) >= 2 ? + efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS, + &efi_boot_max_var_store_size, + &efi_boot_remain_var_store_size, + &efi_boot_max_var_size) : + EFI_INCOMPATIBLE_VERSION; + if ( EFI_ERROR(status) ) + { + efi_boot_max_var_store_size = 0; + efi_boot_remain_var_store_size = 0; + efi_boot_max_var_size = status; + PrintStr(L"Warning: Could not query variable store: "); + DisplayUint(status, 0); + PrintStr(newline); + } +} + static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz) { if ( bpp < 0 ) @@ -1061,23 +1084,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) setup_efi_pci(); /* Get snapshot of variable store parameters. */ - status = (efi_rs->Hdr.Revision >> 16) >= 2 ? - efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE | - EFI_VARIABLE_BOOTSERVICE_ACCESS | - EFI_VARIABLE_RUNTIME_ACCESS, - &efi_boot_max_var_store_size, - &efi_boot_remain_var_store_size, - &efi_boot_max_var_size) : - EFI_INCOMPATIBLE_VERSION; - if ( EFI_ERROR(status) ) - { - efi_boot_max_var_store_size = 0; - efi_boot_remain_var_store_size = 0; - efi_boot_max_var_size = status; - PrintStr(L"Warning: Could not query variable store: "); - DisplayUint(status, 0); - PrintStr(newline); - } + efi_variables(); efi_arch_memory_setup(); -- 1.7.10.4