mirror of https://github.com/acidanthera/audk.git
Fix two issues in PeiCore.
1. HOB address is not 8 byte alignment. 2. FV with the max supported PEIM can't be dispatched. Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14993 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
98c4caa1e9
commit
9b8e61be26
|
@ -49,7 +49,7 @@ DiscoverPeimsAndOrderWithApriori (
|
||||||
UINTN PeimIndex;
|
UINTN PeimIndex;
|
||||||
UINTN PeimCount;
|
UINTN PeimCount;
|
||||||
EFI_GUID *Guid;
|
EFI_GUID *Guid;
|
||||||
EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
|
EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1];
|
||||||
EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
|
EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
|
||||||
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
|
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
|
||||||
EFI_FV_FILE_INFO FileInfo;
|
EFI_FV_FILE_INFO FileInfo;
|
||||||
|
@ -75,20 +75,21 @@ DiscoverPeimsAndOrderWithApriori (
|
||||||
//
|
//
|
||||||
// Go ahead to scan this Fv, and cache FileHandles within it.
|
// Go ahead to scan this Fv, and cache FileHandles within it.
|
||||||
//
|
//
|
||||||
for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
|
Status = EFI_NOT_FOUND;
|
||||||
|
for (PeimCount = 0; PeimCount <= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
|
||||||
Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);
|
Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);
|
||||||
if (Status != EFI_SUCCESS) {
|
if (Status != EFI_SUCCESS || PeimCount == FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Private->CurrentFvFileHandles[PeimCount] = FileHandle;
|
Private->CurrentFvFileHandles[PeimCount] = FileHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check whether the count of Peims exceeds the max support PEIMs in a FV image
|
// Check whether the count of Peims exceeds the max support PEIMs in a FV image
|
||||||
// If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
|
// If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
|
||||||
//
|
//
|
||||||
ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));
|
ASSERT ((Status != EFI_SUCCESS) || (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get Apriori File handle
|
// Get Apriori File handle
|
||||||
|
@ -1001,7 +1002,10 @@ PeiDispatcher (
|
||||||
HoleMemBase = TopOfNewStack;
|
HoleMemBase = TopOfNewStack;
|
||||||
HoleMemSize = TemporaryRamSize - PeiTemporaryRamSize - TemporaryStackSize;
|
HoleMemSize = TemporaryRamSize - PeiTemporaryRamSize - TemporaryStackSize;
|
||||||
if (HoleMemSize != 0) {
|
if (HoleMemSize != 0) {
|
||||||
BaseOfNewHeap = BaseOfNewHeap + HoleMemSize;
|
//
|
||||||
|
// Make sure HOB List start address is 8 byte alignment.
|
||||||
|
//
|
||||||
|
BaseOfNewHeap = ALIGN_VALUE (BaseOfNewHeap + HoleMemSize, 8);
|
||||||
}
|
}
|
||||||
if (BaseOfNewHeap >= (UINTN)SecCoreData->PeiTemporaryRamBase) {
|
if (BaseOfNewHeap >= (UINTN)SecCoreData->PeiTemporaryRamBase) {
|
||||||
Private->HeapOffsetPositive = TRUE;
|
Private->HeapOffsetPositive = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue