From b5412eac9eaccaed53ab32f6c3dd016e71f44a0e Mon Sep 17 00:00:00 2001 From: "Dong, Guo" Date: Wed, 20 Aug 2014 09:37:26 +0000 Subject: Update TcgPei and TrEEPei driver to make gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported to be used as patchable PCD instead of Fixed PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dong, Guo Reviewed-by: Gao, Liming git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15848 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TrEEPei/TrEEPei.c | 10 ++++++++-- SecurityPkg/Tcg/TrEEPei/TrEEPei.inf | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'SecurityPkg/Tcg/TrEEPei') diff --git a/SecurityPkg/Tcg/TrEEPei/TrEEPei.c b/SecurityPkg/Tcg/TrEEPei/TrEEPei.c index 001a45b310..8e2bc748ff 100644 --- a/SecurityPkg/Tcg/TrEEPei/TrEEPei.c +++ b/SecurityPkg/Tcg/TrEEPei/TrEEPei.c @@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #define PERF_ID_TREE_PEI 0x3080 @@ -63,10 +64,10 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList = { NULL }; -EFI_PLATFORM_FIRMWARE_BLOB mMeasuredBaseFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; +EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo; UINT32 mMeasuredBaseFvIndex = 0; -EFI_PLATFORM_FIRMWARE_BLOB mMeasuredChildFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; +EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredChildFvInfo; UINT32 mMeasuredChildFvIndex = 0; /** @@ -592,6 +593,11 @@ PeimEntryMP ( ); // Do not check status, because it is optional + mMeasuredBaseFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + ASSERT (mMeasuredBaseFvInfo != NULL); + mMeasuredChildFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported)); + ASSERT (mMeasuredChildFvInfo != NULL); + if (PcdGet8 (PcdTpm2ScrtmPolicy) == 1) { Status = MeasureCRTMVersion (); ASSERT_EFI_ERROR (Status); diff --git a/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf b/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf index f5fb3d1acb..15e24f5f0e 100644 --- a/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf +++ b/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf @@ -44,6 +44,7 @@ Tpm2DeviceLib HashLib PerformanceLib + MemoryAllocationLib [Guids] gTcgEventEntryHobGuid -- cgit v1.2.3