X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FTcg%2FTcg2Config%2FTcg2ConfigDriver.c;h=968670f04d5122d4412348bf5ce6dfc5c8bdcc78;hp=881368345b82981c7b304ca2734ce232f1ff1659;hb=518b6f6565095f328bd90589874fb1abfee27afd;hpb=8e997ab8d32ea9c4882912ad514e6a20901cf54e diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c index 881368345b..968670f04d 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c @@ -1,7 +1,7 @@ /** @file The module entry point for Tcg2 configuration module. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials 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 @@ -158,20 +158,6 @@ Tcg2ConfigDriverEntryPoint ( PrivateData->PCRBanksDesired = CurrentActivePCRBanks; UpdateDefaultPCRBanks (Tcg2ConfigBin + sizeof(UINT32), ReadUnaligned32((UINT32 *)Tcg2ConfigBin) - sizeof(UINT32), CurrentActivePCRBanks); - // - // Save to variable so platform driver can get it. - // - Status = gRT->SetVariable ( - TCG2_STORAGE_NAME, - &gTcg2ConfigFormSetGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - sizeof(Tcg2Configuration), - &Tcg2Configuration - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); - } - // // Sync data from PCD to variable, so that we do not need detect again in S3 phase. // @@ -184,6 +170,7 @@ Tcg2ConfigDriverEntryPoint ( } PrivateData->TpmDeviceDetected = Tcg2DeviceDetection.TpmDeviceDetected; + Tcg2Configuration.TpmDevice = Tcg2DeviceDetection.TpmDeviceDetected; // // Save to variable so platform driver can get it. @@ -207,6 +194,20 @@ Tcg2ConfigDriverEntryPoint ( ASSERT_EFI_ERROR (Status); } + // + // Save to variable so platform driver can get it. + // + Status = gRT->SetVariable ( + TCG2_STORAGE_NAME, + &gTcg2ConfigFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof(Tcg2Configuration), + &Tcg2Configuration + ); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); + } + // // We should lock Tcg2DeviceDetection, because it contains information needed at S3. //