X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FPeiHobLib%2FHobLib.c;h=f971e59945aaabb042dedd787a3e98cdc0943f4d;hb=c7a54f2560479abe75b51383940b057cac321d22;hp=31389ad28b7b1e617172849db0b1fc20e04333ed;hpb=d5b86e43cf23787da85fcf862807c1f6714bfac2;p=mirror_edk2.git diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c index 31389ad28b..f971e59945 100644 --- a/MdePkg/Library/PeiHobLib/HobLib.c +++ b/MdePkg/Library/PeiHobLib/HobLib.c @@ -12,17 +12,11 @@ **/ -// -// The package level header files this module uses -// + #include -// -// The protocols, PPI and GUID defintions for this module -// + #include -// -// The Library classes this module consumes -// + #include #include #include @@ -410,6 +404,39 @@ BuildFvHob ( Hob->Length = Length; } +/** + Builds a EFI_HOB_TYPE_FV2 HOB. + + This function builds a EFI_HOB_TYPE_FV2 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 FvName The name of the Firmware Volume. + @param FileName The name of the file. + +**/ +VOID +EFIAPI +BuildFv2Hob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN CONST EFI_GUID *FvName, + IN CONST EFI_GUID *FileName + ) +{ + EFI_HOB_FIRMWARE_VOLUME2 *Hob; + + Hob = InternalPeiCreateHob (EFI_HOB_TYPE_FV2, sizeof (EFI_HOB_FIRMWARE_VOLUME2)); + + Hob->BaseAddress = BaseAddress; + Hob->Length = Length; + CopyGuid (&Hob->FvName, FvName); + CopyGuid (&Hob->FileName, FileName); +} + /** Builds a Capsule Volume HOB.