]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c
SecurityPkg: Tcg2Dxe: Report correct FinalEventLog size
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Config / Tcg2ConfigDriver.c
index 881368345b82981c7b304ca2734ce232f1ff1659..968670f04d5122d4412348bf5ce6dfc5c8bdcc78 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The module entry point for Tcg2 configuration module.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -158,20 +158,6 @@ Tcg2ConfigDriverEntryPoint (
   PrivateData->PCRBanksDesired = CurrentActivePCRBanks;\r
   UpdateDefaultPCRBanks (Tcg2ConfigBin + sizeof(UINT32), ReadUnaligned32((UINT32 *)Tcg2ConfigBin) - sizeof(UINT32), CurrentActivePCRBanks);\r
 \r
-  //\r
-  // Save to variable so platform driver can get it.\r
-  //\r
-  Status = gRT->SetVariable (\r
-                  TCG2_STORAGE_NAME,\r
-                  &gTcg2ConfigFormSetGuid,\r
-                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
-                  sizeof(Tcg2Configuration),\r
-                  &Tcg2Configuration\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n"));\r
-  }\r
-\r
   //\r
   // Sync data from PCD to variable, so that we do not need detect again in S3 phase.\r
   //\r
@@ -184,6 +170,7 @@ Tcg2ConfigDriverEntryPoint (
   }\r
 \r
   PrivateData->TpmDeviceDetected = Tcg2DeviceDetection.TpmDeviceDetected;\r
+  Tcg2Configuration.TpmDevice = Tcg2DeviceDetection.TpmDeviceDetected;\r
 \r
   //\r
   // Save to variable so platform driver can get it.\r
@@ -207,6 +194,20 @@ Tcg2ConfigDriverEntryPoint (
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
+  //\r
+  // Save to variable so platform driver can get it.\r
+  //\r
+  Status = gRT->SetVariable (\r
+                  TCG2_STORAGE_NAME,\r
+                  &gTcg2ConfigFormSetGuid,\r
+                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
+                  sizeof(Tcg2Configuration),\r
+                  &Tcg2Configuration\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n"));\r
+  }\r
+\r
   //\r
   // We should lock Tcg2DeviceDetection, because it contains information needed at S3.\r
   //\r