Revision: 15848
          http://sourceforge.net/p/edk2/code/15848
Author:   gdong1
Date:     2014-08-20 09:37:26 +0000 (Wed, 20 Aug 2014)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Gao, Liming <[email protected]>

Modified Paths:
--------------
    trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.c
    trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.inf
    trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.c
    trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf

Modified: trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.c
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.c  2014-08-20 07:41:38 UTC (rev 
15847)
+++ trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.c  2014-08-20 09:37:26 UTC (rev 
15848)
@@ -37,6 +37,7 @@
 #include <Library/PcdLib.h>
 #include <Library/PeiServicesTablePointerLib.h>
 #include <Library/BaseLib.h>
+#include <Library/MemoryAllocationLib.h>
 
 #include "TpmComm.h"
 
@@ -48,10 +49,10 @@
   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;
 
 EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI 
*mMeasurementExcludedFvPpi;
@@ -369,8 +370,8 @@
   //
   // Add new FV into the measured FV list.
   //
-  ASSERT (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported));
-  if (mMeasuredBaseFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {
+  ASSERT (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));
+  if (mMeasuredBaseFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase   = FvBase;
     mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength;
     mMeasuredBaseFvIndex++;
@@ -484,8 +485,8 @@
   //
   if (Fv->ParentFvName != NULL || Fv->ParentFileName != NULL ) {
     
-    ASSERT (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported));
-    if (mMeasuredChildFvIndex < FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {
+    ASSERT (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported));
+    if (mMeasuredChildFvIndex < PcdGet32 (PcdPeiCoreMaxFvSupported)) {
       //
       // Check whether FV is in the measured child FV list.
       //
@@ -667,6 +668,11 @@
                );
   // 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);
+
   TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;
   Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle);
   if (EFI_ERROR (Status)) {

Modified: trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.inf
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.inf        2014-08-20 07:41:38 UTC 
(rev 15847)
+++ trunk/edk2/SecurityPkg/Tcg/TcgPei/TcgPei.inf        2014-08-20 09:37:26 UTC 
(rev 15848)
@@ -48,6 +48,7 @@
   PeiServicesTablePointerLib
   BaseLib
   PcdLib
+  MemoryAllocationLib
 
 [Guids]
   gTcgEventEntryHobGuid

Modified: trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.c
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.c        2014-08-20 07:41:38 UTC 
(rev 15847)
+++ trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.c        2014-08-20 09:37:26 UTC 
(rev 15848)
@@ -39,6 +39,7 @@
 #include <Library/PeiServicesTablePointerLib.h>
 #include <Protocol/TrEEProtocol.h>
 #include <Library/PerformanceLib.h>
+#include <Library/MemoryAllocationLib.h>
 
 #define PERF_ID_TREE_PEI  0x3080
 
@@ -63,10 +64,10 @@
   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 @@
                );
   // 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);

Modified: trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf      2014-08-20 07:41:38 UTC 
(rev 15847)
+++ trunk/edk2/SecurityPkg/Tcg/TrEEPei/TrEEPei.inf      2014-08-20 09:37:26 UTC 
(rev 15848)
@@ -44,6 +44,7 @@
   Tpm2DeviceLib
   HashLib
   PerformanceLib
+  MemoryAllocationLib
 
 [Guids]
   gTcgEventEntryHobGuid

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to