From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22a; helo=mail-io0-x22a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2149A21CF58D9 for ; Thu, 5 Oct 2017 00:51:49 -0700 (PDT) Received: by mail-io0-x22a.google.com with SMTP id 101so382395ioj.3 for ; Thu, 05 Oct 2017 00:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8S7qdUmoZUFgGzAN+Q9U9efHdkIiLsD0V87+ebiFxSk=; b=iXEXsqLygjAhjNMjhbDfXgFGLPKdpOx6QN+SqQQP2kxm1DBGY5yNCGKE8t0+m+1D2b EmK4rlCdD1oB4wxlQMd7lis5ehCqVt3kiiQVUBud7zXfN5WQZwk3dnGM6A4ASM04WP68 d6dUbBd7n8fcGenvgTtdMX8yxcSy3bXCWCiy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8S7qdUmoZUFgGzAN+Q9U9efHdkIiLsD0V87+ebiFxSk=; b=nhWcHGHViodYyHZPkSn86iNdqgZo41KjnN3TFRs71t05BPlleNyxcbCzyGhjIGP2tC +I8BT+odSn7z8cybOf0/1ApeWh9Xu2fJBLOoftDaM9e7BvJzz8iuCj0uqNcNBVlzsTQi PYgf71R5qnZNv2DrLmZSdhNAfwsECzDctIifEdBaB5bTsi/xaIPLzjM/bOX8SPt5kXeZ Me5vKFwMyG+MeO2YtVQ7qmajttwb2cKrn1wSXdvUDMBVPcZrsjxVGh42oUrsUDxLiGYe baGTyLBXHkLDPUuL1gGWkhKOAEwOgHvmLzKDGvYIxa3Jo0uaSzdqy6scIdQxP82Qujwn 45hg== X-Gm-Message-State: AMCzsaWr8TE+txKw5zz+AUPTDO+G5CD+Rhy5MZxA8pOkhRNS14Ms8wRp XxDagYnkAlXCX0ZwiYB8fXBPRyCgKmYnKuDM6IG/SQ== X-Google-Smtp-Source: AOwi7QBTBs6opjKApzycyhf/jnzwE6RanzrTqMkHykfm+Pq6rQczjtEV5uJerhZL5BTBvqkEdkn5Or9xMss1OXb/agQ= X-Received: by 10.107.53.213 with SMTP id k82mr475184ioo.179.1507190111198; Thu, 05 Oct 2017 00:55:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Thu, 5 Oct 2017 00:55:10 -0700 (PDT) In-Reply-To: <20171005063327.4872-2-star.zeng@intel.com> References: <20171005063327.4872-1-star.zeng@intel.com> <20171005063327.4872-2-star.zeng@intel.com> From: Ard Biesheuvel Date: Thu, 5 Oct 2017 08:55:10 +0100 Message-ID: To: Star Zeng Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Laszlo Ersek , Liming Gao Subject: Re: [PATCH 1/2] EmbeddedPkg PrePiHobLib: Implement BuildFv3Hob 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: Thu, 05 Oct 2017 07:51:50 -0000 Content-Type: text/plain; charset="UTF-8" On 5 October 2017 at 07:33, Star Zeng wrote: > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Laszlo Ersek > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > EmbeddedPkg/Library/PrePiHobLib/Hob.c | 43 ++++++++++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > > diff --git a/EmbeddedPkg/Library/PrePiHobLib/Hob.c b/EmbeddedPkg/Library/PrePiHobLib/Hob.c > index aff532259ef4..a681587d3ee0 100644 > --- a/EmbeddedPkg/Library/PrePiHobLib/Hob.c > +++ b/EmbeddedPkg/Library/PrePiHobLib/Hob.c > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2010, Apple Inc. All rights reserved.
> + Copyright (c) 2010 - 2017, Apple Inc. All rights reserved.
> You may want to change this :-) > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -601,7 +601,48 @@ BuildFv2Hob ( > CopyGuid (&Hob->FileName, FileName); > } > > +/** > + 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(). > + > + @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 > + ) > +{ > + EFI_HOB_FIRMWARE_VOLUME3 *Hob; > + > + Hob = CreateHob (EFI_HOB_TYPE_FV3, (UINT16) sizeof (EFI_HOB_FIRMWARE_VOLUME3)); > > + Hob->BaseAddress = BaseAddress; > + Hob->Length = Length; > + Hob->AuthenticationStatus = AuthenticationStatus; > + Hob->ExtractedFv = ExtractedFv; > + if (ExtractedFv) { > + CopyGuid (&Hob->FvName, FvName); > + CopyGuid (&Hob->FileName, FileName); > + } > +} > > /** > Builds a Capsule Volume HOB. > -- > 2.13.3.windows.1 >