summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-10-03 21:41:27 +0800
committerStar Zeng <star.zeng@intel.com>2017-10-10 20:54:37 +0800
commite4623bd5e6c269cd5fabb3a456a08d92fb508917 (patch)
tree03a392609a6bec8f3a37ee8c5a60ba202621b737 /IntelFrameworkPkg
parent5450086c52fa3c02c2e509fe94085fd9c863e37a (diff)
downloadedk2-e4623bd5e6c269cd5fabb3a456a08d92fb508917.tar.gz
edk2-e4623bd5e6c269cd5fabb3a456a08d92fb508917.tar.bz2
edk2-e4623bd5e6c269cd5fabb3a456a08d92fb508917.zip
IntelFrameworkPkg PeiHobLibFramework: Implement BuildFv3Hob
Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'IntelFrameworkPkg')
-rw-r--r--IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c b/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c
index 223e56a9db..eb89b4a535 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,60 @@ 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.