]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update TcgPei and TrEEPei driver to make gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMax...
authorDong, Guo <guo.dong@intel.com>
Wed, 20 Aug 2014 09:37:26 +0000 (09:37 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Aug 2014 09:37:26 +0000 (09:37 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15848 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Tcg/TcgPei/TcgPei.c
SecurityPkg/Tcg/TcgPei/TcgPei.inf
SecurityPkg/Tcg/TrEEPei/TrEEPei.c
SecurityPkg/Tcg/TrEEPei/TrEEPei.inf

index f2650a20f3791847895e91755194d06e3b85c025..0c00e286cef60ce4a63502c3e5f2f01aa211de39 100644 (file)
@@ -37,6 +37,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PcdLib.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/BaseLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #include "TpmComm.h"\r
 \r
 \r
 #include "TpmComm.h"\r
 \r
@@ -48,10 +49,10 @@ EFI_PEI_PPI_DESCRIPTOR  mTpmInitializedPpiList = {
   NULL\r
 };\r
 \r
   NULL\r
 };\r
 \r
-EFI_PLATFORM_FIRMWARE_BLOB mMeasuredBaseFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo;\r
 UINT32 mMeasuredBaseFvIndex = 0;\r
 \r
 UINT32 mMeasuredBaseFvIndex = 0;\r
 \r
-EFI_PLATFORM_FIRMWARE_BLOB mMeasuredChildFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredChildFvInfo;\r
 UINT32 mMeasuredChildFvIndex = 0;\r
 \r
 EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *mMeasurementExcludedFvPpi;\r
 UINT32 mMeasuredChildFvIndex = 0;\r
 \r
 EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *mMeasurementExcludedFvPpi;\r
@@ -369,8 +370,8 @@ MeasureFvImage (
   //\r
   // Add new FV into the measured FV list.\r
   //\r
   //\r
   // Add new FV into the measured FV list.\r
   //\r
-  ASSERT (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported));\r
-  if (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+  ASSERT (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  if (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase   = FvBase;\r
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength;\r
     mMeasuredBaseFvIndex++;\r
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase   = FvBase;\r
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength;\r
     mMeasuredBaseFvIndex++;\r
@@ -484,8 +485,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
   //\r
   if (Fv->ParentFvName != NULL || Fv->ParentFileName != NULL ) {\r
     \r
   //\r
   if (Fv->ParentFvName != NULL || Fv->ParentFileName != NULL ) {\r
     \r
-    ASSERT (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported));\r
-    if (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+    ASSERT (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+    if (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
       //\r
       // Check whether FV is in the measured child FV list.\r
       //\r
       //\r
       // Check whether FV is in the measured child FV list.\r
       //\r
@@ -667,6 +668,11 @@ PeimEntryMP (
                );\r
   // Do not check status, because it is optional\r
 \r
                );\r
   // Do not check status, because it is optional\r
 \r
+  mMeasuredBaseFvInfo  = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  ASSERT (mMeasuredBaseFvInfo != NULL);\r
+  mMeasuredChildFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  ASSERT (mMeasuredChildFvInfo != NULL);\r
+\r
   TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;\r
   Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle);\r
   if (EFI_ERROR (Status)) {\r
   TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;\r
   Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle);\r
   if (EFI_ERROR (Status)) {\r
index cf90eaec81d37654194e4facb0111aa8ac69f35a..c63771396f1071e742ccd2b6d2c075564ac29c90 100644 (file)
@@ -48,6 +48,7 @@
   PeiServicesTablePointerLib\r
   BaseLib\r
   PcdLib\r
   PeiServicesTablePointerLib\r
   BaseLib\r
   PcdLib\r
+  MemoryAllocationLib\r
 \r
 [Guids]\r
   gTcgEventEntryHobGuid\r
 \r
 [Guids]\r
   gTcgEventEntryHobGuid\r
index 001a45b3100fb525e449633c3e840cc04a7f7584..8e2bc748ff41b2b94a0bc3037994cf438a01b75f 100644 (file)
@@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Protocol/TrEEProtocol.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Protocol/TrEEProtocol.h>\r
 #include <Library/PerformanceLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #define PERF_ID_TREE_PEI  0x3080\r
 \r
 \r
 #define PERF_ID_TREE_PEI  0x3080\r
 \r
@@ -63,10 +64,10 @@ EFI_PEI_PPI_DESCRIPTOR  mTpmInitializedPpiList = {
   NULL\r
 };\r
 \r
   NULL\r
 };\r
 \r
-EFI_PLATFORM_FIRMWARE_BLOB mMeasuredBaseFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo;\r
 UINT32 mMeasuredBaseFvIndex = 0;\r
 \r
 UINT32 mMeasuredBaseFvIndex = 0;\r
 \r
-EFI_PLATFORM_FIRMWARE_BLOB mMeasuredChildFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredChildFvInfo;\r
 UINT32 mMeasuredChildFvIndex = 0;\r
 \r
 /**\r
 UINT32 mMeasuredChildFvIndex = 0;\r
 \r
 /**\r
@@ -592,6 +593,11 @@ PeimEntryMP (
                );\r
   // Do not check status, because it is optional\r
 \r
                );\r
   // Do not check status, because it is optional\r
 \r
+  mMeasuredBaseFvInfo  = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  ASSERT (mMeasuredBaseFvInfo != NULL);\r
+  mMeasuredChildFvInfo = (EFI_PLATFORM_FIRMWARE_BLOB *) AllocateZeroPool (sizeof (EFI_PLATFORM_FIRMWARE_BLOB) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  ASSERT (mMeasuredChildFvInfo != NULL);\r
+  \r
   if (PcdGet8 (PcdTpm2ScrtmPolicy) == 1) {\r
     Status = MeasureCRTMVersion ();\r
     ASSERT_EFI_ERROR (Status);\r
   if (PcdGet8 (PcdTpm2ScrtmPolicy) == 1) {\r
     Status = MeasureCRTMVersion ();\r
     ASSERT_EFI_ERROR (Status);\r
index f5fb3d1acb96215c711daafa598d80d9ffd9d765..15e24f5f0eb605e278e0de61e3c3432da76695f7 100644 (file)
@@ -44,6 +44,7 @@
   Tpm2DeviceLib\r
   HashLib\r
   PerformanceLib\r
   Tpm2DeviceLib\r
   HashLib\r
   PerformanceLib\r
+  MemoryAllocationLib\r
 \r
 [Guids]\r
   gTcgEventEntryHobGuid\r
 \r
 [Guids]\r
   gTcgEventEntryHobGuid\r