+/**\r
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.\r
+ \r
+ This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using \r
+ the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.\r
+ If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().\r
+ If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().\r
+\r
+ \r
+ @param FvFormat Unique identifier of the format of the memory-mapped firmware volume.\r
+ This parameter is optional and may be NULL. \r
+ If NULL is specified, the EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.\r
+ @param FvInfo Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume. \r
+ The format of this buffer is specific to the FvFormat. For memory-mapped firmware volumes, \r
+ this typically points to the first byte of the firmware volume.\r
+ @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped firmware volumes, \r
+ this is typically the size of the firmware volume.\r
+ @param ParentFvName If the new firmware volume originated from a file in a different firmware volume, \r
+ then this parameter specifies the GUID name of the originating firmware volume.\r
+ Otherwise, this parameter must be NULL.\r
+ @param ParentFileName If the new firmware volume originated from a file in a different firmware volume, \r
+ then this parameter specifies the GUID file name of the originating firmware file.\r
+ Otherwise, this parameter must be NULL.\r
+**/\r
+VOID\r
+EFIAPI\r
+PeiServicesInstallFvInfoPpi (\r
+ IN CONST EFI_GUID *FvFormat, OPTIONAL\r
+ IN CONST VOID *FvInfo,\r
+ IN UINT32 FvInfoSize,\r
+ IN CONST EFI_GUID *ParentFvName, OPTIONAL\r
+ IN CONST EFI_GUID *ParentFileName OPTIONAL\r
+ )\r
+{\r
+ EFI_STATUS Status; \r
+ EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *FvInfoPpi;\r
+ EFI_PEI_PPI_DESCRIPTOR *FvInfoPpiDescriptor;\r
+ EFI_GUID *ParentFvNameValue;\r
+ EFI_GUID *ParentFileNameValue;\r
+\r
+ ParentFvNameValue = NULL;\r
+ ParentFileNameValue = NULL;\r
+ FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));\r
+ ASSERT(FvInfoPpi != NULL);\r
+\r
+ if (FvFormat != NULL) {\r
+ CopyGuid (&FvInfoPpi->FvFormat, FvFormat);\r
+ } else {\r
+ CopyGuid (&FvInfoPpi->FvFormat, &gEfiFirmwareFileSystem2Guid);\r
+ }\r
+ FvInfoPpi->FvInfo = (VOID *) FvInfo;\r
+ FvInfoPpi->FvInfoSize = FvInfoSize;\r
+ if (ParentFvName != NULL) {\r
+ ParentFvNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFvName);\r
+ ASSERT (ParentFvNameValue != NULL);\r
+ FvInfoPpi->ParentFvName = ParentFvNameValue;\r
+ }\r
+ if (ParentFileName != NULL) {\r
+ ParentFileNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFileName);\r
+ ASSERT (ParentFileNameValue != NULL);\r
+ FvInfoPpi->ParentFileName = ParentFileNameValue;\r
+ }\r
+\r
+ FvInfoPpiDescriptor = AllocateCopyPool (sizeof(EFI_PEI_PPI_DESCRIPTOR), mPpiListTemplate);\r
+ ASSERT (FvInfoPpiDescriptor != NULL);\r
+\r
+ FvInfoPpiDescriptor->Ppi = (VOID *) FvInfoPpi;\r
+ Status = PeiServicesInstallPpi (FvInfoPpiDescriptor);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+}\r
+\r