25 IN EFI_FV_FILETYPE FileType,
40 EndOfFirmwareVolume = CurrentAddress + FirmwareVolumePtr->FvLength;
45 for (EndOfFile = CurrentAddress + FirmwareVolumePtr->HeaderLength; ; ) {
46 CurrentAddress = (EndOfFile + 7) & 0xfffffffffffffff8ULL;
47 if (CurrentAddress > EndOfFirmwareVolume) {
52 if (IS_FFS_FILE2 (File)) {
53 Size = FFS_FILE2_SIZE (File);
54 if (Size <= 0x00FFFFFF) {
64 EndOfFile = CurrentAddress + Size;
65 if (EndOfFile > EndOfFirmwareVolume) {
72 if (File->
Type != FileType) {
79 if (IS_FFS_FILE2 (File)) {
86 CurrentAddress = (EndOfSection + 3) & 0xfffffffffffffffcULL;
89 if (IS_SECTION2 (Section)) {
90 Size = SECTION2_SIZE (Section);
91 if (Size <= 0x00FFFFFF) {
101 EndOfSection = CurrentAddress + Size;
102 if (EndOfSection > EndOfFile) {
103 return EFI_NOT_FOUND;
109 if ((Section->Type ==
EFI_SECTION_PE32) || (Section->Type == EFI_SECTION_TE)) {
110 if (File->
Type == FileType) {
111 if (IS_SECTION2 (Section)) {
125 if (*CoreImageBase != 0) {
158 Status =
FindImageBase (SecCoreFirmwareVolumePtr, EFI_FV_FILETYPE_SECURITY_CORE, &SecCoreImageBase);
172 Status =
FindImageBase (PeiCoreFirmwareVolumePtr, EFI_FV_FILETYPE_PEI_CORE, &PeiCoreImageBase);
185 Status = PeCoffLoaderGetEntryPoint ((VOID *)(
UINTN)PeiCoreImageBase, (VOID **)PeiCoreEntryPoint);
186 if (EFI_ERROR (Status)) {
187 *PeiCoreEntryPoint = 0;
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI FindImageBase(IN EFI_FIRMWARE_VOLUME_HEADER *FirmwareVolumePtr, IN EFI_FV_FILETYPE FileType, OUT EFI_PHYSICAL_ADDRESS *CoreImageBase)
VOID EFIAPI FindAndReportEntryPoints(IN EFI_FIRMWARE_VOLUME_HEADER *SecCoreFirmwareVolumePtr, IN EFI_FIRMWARE_VOLUME_HEADER *PeiCoreFirmwareVolumePtr, OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint)
#define ASSERT_EFI_ERROR(StatusParameter)
#define FFS_FILE_SIZE(FfsFileHeaderPtr)
#define SECTION_SIZE(SectionHeaderPtr)
VOID(EFIAPI * EFI_PEI_CORE_ENTRY_POINT)(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
UINT64 EFI_PHYSICAL_ADDRESS
PHYSICAL_ADDRESS ImageAddress