)\r
{\r
EFI_STATUS Status;\r
- EFI_GUID DxeCoreFileName;\r
+ EFI_FV_FILE_INFO DxeCoreFileInfo;\r
EFI_PHYSICAL_ADDRESS DxeCoreAddress;\r
UINT64 DxeCoreSize;\r
EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint;\r
}\r
\r
//\r
- // Look in all the FVs present in PEI and find the DXE Core\r
+ // Look in all the FVs present in PEI and find the DXE Core FileHandle\r
//\r
- FileHandle = DxeIplFindDxeCore (&DxeCoreFileName);\r
+ FileHandle = DxeIplFindDxeCore ();\r
\r
//\r
// Load the DXE Core from a Firmware Volume, may use LoadFile ppi to do this for save code size.\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ //\r
+ // Get the DxeCore File Info from the FileHandle for the DxeCore GUID file name.\r
+ //\r
+ Status = PeiServicesFfsGetFileInfo (FileHandle, &DxeCoreFileInfo);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
//\r
// Add HOB for the DXE Core\r
//\r
BuildModuleHob (\r
- &DxeCoreFileName,\r
+ &DxeCoreFileInfo.FileName,\r
DxeCoreAddress,\r
EFI_SIZE_TO_PAGES ((UINTN) DxeCoreSize) * EFI_PAGE_SIZE,\r
DxeCoreEntryPoint\r
Searches DxeCore in all firmware Volumes and loads the first\r
instance that contains DxeCore.\r
\r
- @param DxeCoreFileName A Pointer to the EFI_GUID to contain\r
- the output DxeCore GUID file name.\r
-\r
@return FileHandle of DxeCore to load DxeCore.\r
\r
**/\r
EFI_PEI_FILE_HANDLE\r
DxeIplFindDxeCore (\r
- OUT EFI_GUID *DxeCoreFileName\r
+ VOID\r
)\r
{\r
EFI_STATUS Status;\r
UINTN Instance;\r
EFI_PEI_FV_HANDLE VolumeHandle;\r
EFI_PEI_FILE_HANDLE FileHandle;\r
- EFI_FV_FILE_INFO FvFileInfo;\r
\r
Instance = 0;\r
while (TRUE) {\r
Status = PeiServicesFfsFindNextFile (EFI_FV_FILETYPE_DXE_CORE, VolumeHandle, &FileHandle);\r
if (!EFI_ERROR (Status)) {\r
//\r
- // Find DxeCore FileHandle in this volume, then we skip other firmware volume.\r
+ // Find DxeCore FileHandle in this volume, then we skip other firmware volume and\r
+ // return the FileHandle.\r
//\r
- break;\r
+ return FileHandle;\r
}\r
//\r
// We cannot find DxeCore in this firmware volume, then search the next volume.\r
}\r
\r
//\r
- // Extract the DxeCore GUID file name.\r
+ // We should never reach here.\r
//\r
- Status = PeiServicesFfsGetFileInfo (FileHandle, &FvFileInfo);\r
- ASSERT_EFI_ERROR (Status);\r
- CopyGuid (DxeCoreFileName, &FvFileInfo.FileName);\r
-\r
- //\r
- // Return the FileHandle to load DxeCore from this volume.\r
- //\r
- return FileHandle;\r
+ ASSERT (FALSE);\r
+ return NULL;\r
}\r
\r
\r
// Call GetInfo to get the size and attribute of input guided section data.\r
//\r
Status = ExtractGuidedSectionGetInfo (\r
- InputSection,\r
- &OutputBufferSize,\r
- &ScratchBufferSize,\r
- &SectionAttribute\r
- );\r
+ InputSection,\r
+ &OutputBufferSize,\r
+ &ScratchBufferSize,\r
+ &SectionAttribute\r
+ );\r
\r
if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status));\r