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:c0b::229; helo=mail-it0-x229.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 63A0421F303FE for ; Thu, 5 Oct 2017 01:37:28 -0700 (PDT) Received: by mail-it0-x229.google.com with SMTP id c195so418704itb.1 for ; Thu, 05 Oct 2017 01:40:50 -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=QkWbHL8Fsy4ExHO17+sWNjBmaKFKqatwlqx0id+x+Ho=; b=eYOhXMVNVi5PREjyyINxzUOGHAhwww5B/2DHCKYzXFkDs0UOZhGIbm2h87omPtscfy 6pNDktom93InAzuiR4z7O0CMMenraD4eseZcyBjZ05ExOTBSQXx32ExWUuPTr9QW/VDv zNa+n2GPzdz50ukI+QDYoha+AVyLw9ShRPlPw= 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=QkWbHL8Fsy4ExHO17+sWNjBmaKFKqatwlqx0id+x+Ho=; b=rCoxjC5WpewcV2N5HIFqPUTEqT7ntrvZl2yri9vVnsDEfbrht3g2iipg+L99A5HahO ZSgpjcMILkbqk81Fhsbx1eMY3ClHbiuMzSPa6wJLb774S56v+2BdCHFU+uvz/48xUJUD tCNNochjgA6bWVo5dhHvg6OOQ01t6Vasu5j4K9fVu76fF/q+GdFDMgEfaNX5Pyep4msB JlBwQCY7EpVGFh25PXNq4lio1Ba27NR9rZwxdJqru/1EvSfdqNl1ZR+dMh8K0Fkaskl/ gP2JO3DCOy997l/Y592dn/ak4GdmwXsYC0n4JvBwaUYpz01/QWR44dS9bSeI8KkfnUkX 5EGw== X-Gm-Message-State: AMCzsaWE+48kEzcrFTg3KsmjOVFEipMuR34OBTJNgl5JnMtMa+8wFQnt CVFJTK6GpCd6rKlquwSR8Oj+xmiNhrWFwVYlDsZF8fE33OM= X-Google-Smtp-Source: AOwi7QDlrbT0Km2qIalHa7bvq9oXdYm07bNTuLzMmonI4Dak11nezlriQopiZv6EtgdbNxP+5KOzxeo09XtJ7/qxGbw= X-Received: by 10.36.40.13 with SMTP id h13mr33228654ith.48.1507192849921; Thu, 05 Oct 2017 01:40:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Thu, 5 Oct 2017 01:40:49 -0700 (PDT) In-Reply-To: <20171005082111.15908-2-star.zeng@intel.com> References: <20171005082111.15908-1-star.zeng@intel.com> <20171005082111.15908-2-star.zeng@intel.com> From: Ard Biesheuvel Date: Thu, 5 Oct 2017 09:40:49 +0100 Message-ID: To: Star Zeng Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Laszlo Ersek , Liming Gao Subject: Re: [PATCH V2 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 08:37:28 -0000 Content-Type: text/plain; charset="UTF-8" On 5 October 2017 at 09:21, 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 Reviewed-by: Ard Biesheuvel > --- > EmbeddedPkg/Library/PrePiHobLib/Hob.c | 44 +++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/EmbeddedPkg/Library/PrePiHobLib/Hob.c b/EmbeddedPkg/Library/PrePiHobLib/Hob.c > index aff532259ef4..aff8ea05797b 100644 > --- a/EmbeddedPkg/Library/PrePiHobLib/Hob.c > +++ b/EmbeddedPkg/Library/PrePiHobLib/Hob.c > @@ -1,6 +1,7 @@ > /** @file > > Copyright (c) 2010, Apple Inc. All rights reserved.
> + Copyright (c) 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 > @@ -601,7 +602,50 @@ 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, 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 >