From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B838D21CF58C0 for ; Wed, 4 Oct 2017 08:35:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2526A13201; Wed, 4 Oct 2017 15:38:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2526A13201 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-111.rdu2.redhat.com [10.10.120.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DE256362A; Wed, 4 Oct 2017 15:38:53 +0000 (UTC) To: Star Zeng , edk2-devel@lists.01.org Cc: Liming Gao , Ard Biesheuvel References: <20171004142121.7404-1-star.zeng@intel.com> <20171004142121.7404-3-star.zeng@intel.com> From: Laszlo Ersek Message-ID: <65f88cc6-6b8d-f99e-e216-b249fb4204c1@redhat.com> Date: Wed, 4 Oct 2017 17:38:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171004142121.7404-3-star.zeng@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 04 Oct 2017 15:38:56 +0000 (UTC) Subject: Re: [PATCH 2/5] MdePkg HobLib: Add BuildFv3Hob API X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:35:35 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Star, On 10/04/17 16:21, Star Zeng wrote: > Add BuildFv3Hob API in HobLib.h and implement the API > in HobLib instances PeiHobLib, DxeHobLib and DxeCoreHobLib. > > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdePkg/Include/Library/HobLib.h | 34 ++++++++++++++++++++-- > MdePkg/Library/DxeCoreHobLib/HobLib.c | 35 ++++++++++++++++++++++- > MdePkg/Library/DxeHobLib/HobLib.c | 32 +++++++++++++++++++++ > MdePkg/Library/PeiHobLib/HobLib.c | 54 ++++++++++++++++++++++++++++++++++- > 4 files changed, 151 insertions(+), 4 deletions(-) > > diff --git a/MdePkg/Include/Library/HobLib.h b/MdePkg/Include/Library/HobLib.h > index fc48703826c5..6f1f7b3f5f20 100644 > --- a/MdePkg/Include/Library/HobLib.h > +++ b/MdePkg/Include/Library/HobLib.h > @@ -6,9 +6,9 @@ > defined in the PI Specification. > A HOB is a Hand-Off Block, defined in the Framework architecture, that > allows the PEI phase to pass information to the DXE phase. HOBs are position > - independent and can be relocated easily to different memory memory locations. > + independent and can be relocated easily to different memory locations. > > -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > which accompanies this distribution. The full text of the license may be found at > @@ -343,6 +343,36 @@ BuildFv2Hob ( > ); > > /** > + Builds a EFI_HOB_TYPE_FV3 HOB. > + > + This function builds a EFI_HOB_TYPE_FV3 HOB. > + It can only be invoked during PEI phase; > + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. > + > + If there is no additional space for HOB creation, then ASSERT(). > + If the FvImage buffer is not at its required alignment, then ASSERT(). > + > + @param BaseAddress The base address of the Firmware Volume. > + @param Length The size of the Firmware Volume in bytes. > + @param AuthenticationStatus The authentication status. > + @param ExtractedFv TRUE if the FV was extracted as a file within another firmware volume. > + FALSE otherwise. > + @param FvName The name of the Firmware Volume. Valid only if IsExtractedFv is TRUE > + @param FileName The name of the file. Valid only if IsExtractedFv is TRUE > + > +**/ > +VOID > +EFIAPI > +BuildFv3Hob ( > + IN EFI_PHYSICAL_ADDRESS BaseAddress, > + IN UINT64 Length, > + IN UINT32 AuthenticationStatus, > + IN BOOLEAN ExtractedFv, > + IN CONST EFI_GUID *FvName, OPTIONAL > + IN CONST EFI_GUID *FileName OPTIONAL > + ); > + > +/** > Builds a Capsule Volume HOB. > > This function builds a Capsule Volume HOB. do we need to copy the implementation(s) of this function to other instances of HobLib? edk2 has the following HobLib instances: 1 ArmVirtPkg/Library/ArmVirtDxeHobLib/ArmVirtDxeHobLib.inf 2 EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf 3 IntelFrameworkPkg/Library/PeiHobLibFramework/PeiHobLibFramework.inf 4 MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf 5 MdePkg/Library/DxeHobLib/DxeHobLib.inf 6 MdePkg/Library/PeiHobLib/PeiHobLib.inf Instances #4 through #6 are extended in this patch; instance #3 is extended in the next patch. Instances #1 and #2 are not changed. Is that OK? (For example, some of the ArmVirt platforms use instance #1 for all DXE and "later" modules. Some other ArmVirt platforms use instance #2.) Thanks, Laszlo