/* Find DXE core from FV and build DXE core HOBs. */
EFI_STATUS UniversalLoadDxeCore(IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv, OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
/* Find DXE core from FV and build DXE core HOBs. */
EFI_STATUS UniversalLoadDxeCore(IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv, OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
{
  EFI_STATUS            Status;
  EFI_FFS_FILE_HEADER   *FileHeader;
  VOID                  *PeCoffImage;
  EFI_PHYSICAL_ADDRESS  ImageAddress;
  UINT64                ImageSize;
  Status = FvFindFileByTypeGuid (DxeFv, EFI_FV_FILETYPE_DXE_CORE, NULL, &FileHeader);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = FileFindSection (FileHeader, EFI_SECTION_PE32, (VOID **)&PeCoffImage);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = LoadPeCoffImage (PeCoffImage, &ImageAddress, &ImageSize, DxeCoreEntryPoint);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  BuildModuleHob (&FileHeader->Name, ImageAddress, EFI_SIZE_TO_PAGES ((UINT32)ImageSize) * EFI_PAGE_SIZE, *DxeCoreEntryPoint);
  return EFI_SUCCESS;
}