From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZOsq6-0004ah-Du for mharc-grub-devel@gnu.org; Mon, 10 Aug 2015 15:34:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOsq3-0004ZT-69 for grub-devel@gnu.org; Mon, 10 Aug 2015 15:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOspy-0001h8-IW for grub-devel@gnu.org; Mon, 10 Aug 2015 15:34:27 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOspy-0001h4-C2 for grub-devel@gnu.org; Mon, 10 Aug 2015 15:34:22 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7AJYA45008306 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Aug 2015 19:34:12 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t7AJY9VK017970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 10 Aug 2015 19:34:09 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t7AJY9GC005706; Mon, 10 Aug 2015 19:34:09 GMT Received: from l.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Aug 2015 12:34:09 -0700 Received: by l.oracle.com (Postfix, from userid 1000) id 4B8E16A3C73; Mon, 10 Aug 2015 15:34:06 -0400 (EDT) Date: Mon, 10 Aug 2015 15:34:06 -0400 From: Konrad Rzeszutek Wilk To: Daniel Kiper Subject: Re: [Xen-devel] [PATCH v2 16/23] efi: split out efi_variables() Message-ID: <20150810193406.GM13576@l.oracle.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-17-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437402558-7313-17-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: jgross@suse.com, grub-devel@gnu.org, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, gang.wei@intel.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, xen-devel@lists.xenproject.org, wei.liu2@citrix.com, richard.l.maliszewski@intel.com, qiaowei.ren@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: Mon, 10 Aug 2015 19:34:28 -0000 On Mon, Jul 20, 2015 at 04:29:11PM +0200, Daniel Kiper wrote: > ..which collects variable store parameters. We want to re-use this > code to support multiboot2 protocol on EFI platforms. > > Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk > --- > v2 - suggestions/fixes: > - improve commit message > (suggested by Jan Beulich). > --- > 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 fd62125..177697a 100644 > --- a/xen/common/efi/boot.c > +++ b/xen/common/efi/boot.c > @@ -837,6 +837,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 ) > @@ -1078,23 +1101,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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel