public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 3/5] IntelFrameworkPkg PeiHobLibFramework: Implement BuildFv3Hob
Date: Wed,  4 Oct 2017 22:21:19 +0800	[thread overview]
Message-ID: <20171004142121.7404-4-star.zeng@intel.com> (raw)
In-Reply-To: <20171004142121.7404-1-star.zeng@intel.com>

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 .../Library/PeiHobLibFramework/HobLib.c            | 54 +++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c b/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
index 223e56a9db12..c7e6d4b75aba 100644
--- a/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
+++ b/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
@@ -5,7 +5,7 @@
  This library instance uses EFI_HOB_TYPE_CV defined in Intel framework HOB specification v0.9
  to implement HobLib BuildCvHob() API. 
 
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
@@ -612,6 +612,58 @@ 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
+  )
+{
+  EFI_HOB_FIRMWARE_VOLUME3  *Hob;
+
+  if (!InternalCheckFvAlignment (BaseAddress, Length)) {
+    ASSERT (FALSE);
+    return;
+  }
+
+  Hob = InternalPeiCreateHob (EFI_HOB_TYPE_FV3, (UINT16) sizeof (EFI_HOB_FIRMWARE_VOLUME3));
+  if (Hob == NULL) {
+    return;
+  }
+
+  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.
 
   This function builds a Capsule Volume HOB.
-- 
2.13.3.windows.1



  parent reply	other threads:[~2017-10-04 14:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 14:21 [PATCH 0/5] Propagate PEI-phase FV authentication status to DXE Star Zeng
2017-10-04 14:21 ` [PATCH 1/5] MdePkg PiHob.h: Add FV3 HOB definitions Star Zeng
2017-10-04 14:21 ` [PATCH 2/5] MdePkg HobLib: Add BuildFv3Hob API Star Zeng
2017-10-04 15:38   ` Laszlo Ersek
2017-10-05  6:46     ` Zeng, Star
2017-10-04 14:21 ` Star Zeng [this message]
2017-10-04 14:21 ` [PATCH 4/5] MdeModulePkg Core: Propagate PEI-phase FV authentication status to DXE Star Zeng
2017-10-04 14:21 ` [PATCH 5/5] IntelFrameworkModulePkg FwVolDxe: Get FV auth status propagated from PEI Star Zeng
2017-10-09  7:44 ` [PATCH 0/5] Propagate PEI-phase FV authentication status to DXE Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171004142121.7404-4-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox