mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 08:34:07 +02:00
MdeModulePkg: PeiCore: Fix PEI Multiple Sub-FV Support issue
FirmwareVolmeInfoPpiNotifyCallback is re-enterable during FV process. Since PrivateData->FVCount increases when processing each sub FVs, need to cache Parent FV count in stack before processing any sub FV. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com>
This commit is contained in:
parent
298454472b
commit
7147077b16
@ -2,7 +2,7 @@
|
|||||||
Pei Core Firmware File System service routines.
|
Pei Core Firmware File System service routines.
|
||||||
|
|
||||||
Copyright (c) 2015 HP Development Company, L.P.
|
Copyright (c) 2015 HP Development Company, L.P.
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -545,6 +545,7 @@ FirmwareVolmeInfoPpiNotifyCallback (
|
|||||||
EFI_PEI_FILE_HANDLE FileHandle;
|
EFI_PEI_FILE_HANDLE FileHandle;
|
||||||
VOID *DepexData;
|
VOID *DepexData;
|
||||||
BOOLEAN IsFvInfo2;
|
BOOLEAN IsFvInfo2;
|
||||||
|
UINTN CurFvCount;
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
|
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
|
||||||
@ -610,10 +611,11 @@ FirmwareVolmeInfoPpiNotifyCallback (
|
|||||||
PrivateData->Fv[PrivateData->FvCount].FvPpi = FvPpi;
|
PrivateData->Fv[PrivateData->FvCount].FvPpi = FvPpi;
|
||||||
PrivateData->Fv[PrivateData->FvCount].FvHandle = FvHandle;
|
PrivateData->Fv[PrivateData->FvCount].FvHandle = FvHandle;
|
||||||
PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = FvInfo2Ppi.AuthenticationStatus;
|
PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = FvInfo2Ppi.AuthenticationStatus;
|
||||||
|
CurFvCount = PrivateData->FvCount;
|
||||||
DEBUG ((
|
DEBUG ((
|
||||||
EFI_D_INFO,
|
EFI_D_INFO,
|
||||||
"The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
|
"The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
|
||||||
(UINT32) PrivateData->FvCount,
|
(UINT32) CurFvCount,
|
||||||
(VOID *) FvInfo2Ppi.FvInfo,
|
(VOID *) FvInfo2Ppi.FvInfo,
|
||||||
FvInfo2Ppi.FvInfoSize,
|
FvInfo2Ppi.FvInfoSize,
|
||||||
FvHandle
|
FvHandle
|
||||||
@ -647,8 +649,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, PrivateData->FvCount - 1, FvHandle));
|
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, CurFvCount, FvHandle));
|
||||||
ProcessFvFile (PrivateData, &PrivateData->Fv[PrivateData->FvCount - 1], FileHandle);
|
ProcessFvFile (PrivateData, &PrivateData->Fv[CurFvCount], FileHandle);
|
||||||
}
|
}
|
||||||
} while (FileHandle != NULL);
|
} while (FileHandle != NULL);
|
||||||
} else {
|
} else {
|
||||||
@ -2216,6 +2218,7 @@ ThirdPartyFvPpiNotifyCallback (
|
|||||||
UINTN FvIndex;
|
UINTN FvIndex;
|
||||||
EFI_PEI_FILE_HANDLE FileHandle;
|
EFI_PEI_FILE_HANDLE FileHandle;
|
||||||
VOID *DepexData;
|
VOID *DepexData;
|
||||||
|
UINTN CurFvCount;
|
||||||
|
|
||||||
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
|
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
|
||||||
FvPpi = (EFI_PEI_FIRMWARE_VOLUME_PPI*) Ppi;
|
FvPpi = (EFI_PEI_FIRMWARE_VOLUME_PPI*) Ppi;
|
||||||
@ -2264,10 +2267,11 @@ ThirdPartyFvPpiNotifyCallback (
|
|||||||
PrivateData->Fv[PrivateData->FvCount].FvPpi = FvPpi;
|
PrivateData->Fv[PrivateData->FvCount].FvPpi = FvPpi;
|
||||||
PrivateData->Fv[PrivateData->FvCount].FvHandle = FvHandle;
|
PrivateData->Fv[PrivateData->FvCount].FvHandle = FvHandle;
|
||||||
PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = AuthenticationStatus;
|
PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = AuthenticationStatus;
|
||||||
|
CurFvCount = PrivateData->FvCount;
|
||||||
DEBUG ((
|
DEBUG ((
|
||||||
EFI_D_INFO,
|
EFI_D_INFO,
|
||||||
"The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
|
"The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
|
||||||
(UINT32) PrivateData->FvCount,
|
(UINT32) CurFvCount,
|
||||||
(VOID *) FvInfo,
|
(VOID *) FvInfo,
|
||||||
FvInfoSize,
|
FvInfoSize,
|
||||||
FvHandle
|
FvHandle
|
||||||
@ -2301,8 +2305,8 @@ ThirdPartyFvPpiNotifyCallback (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, PrivateData->FvCount - 1, FvHandle));
|
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, CurFvCount, FvHandle));
|
||||||
ProcessFvFile (PrivateData, &PrivateData->Fv[PrivateData->FvCount - 1], FileHandle);
|
ProcessFvFile (PrivateData, &PrivateData->Fv[CurFvCount], FileHandle);
|
||||||
}
|
}
|
||||||
} while (FileHandle != NULL);
|
} while (FileHandle != NULL);
|
||||||
} while (TRUE);
|
} while (TRUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user