44#define PERF_ID_TCG2_PEI 0x3080
48 EFI_TCG2_EVENT_LOG_FORMAT LogFormat;
52 { &gTcgEventEntryHobGuid, EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 },
53 { &gTcgEvent2EntryHobGuid, EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 },
56BOOLEAN mImageInMemory =
FALSE;
60 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
61 &gPeiTpmInitializedPpiGuid,
66 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
67 &gPeiTpmInitializationDonePpiGuid,
100 IN UINT8 *NewEventData
108 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
116#define FIRMWARE_BLOB_GROWTH_STEP 4
119UINT32 mMeasuredMaxBaseFvIndex = 0;
120UINT32 mMeasuredBaseFvIndex = 0;
123UINT32 mMeasuredMaxChildFvIndex = 0;
124UINT32 mMeasuredChildFvIndex = 0;
128#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)"
130 UINT8 BlobDescriptionSize;
131 UINT8 BlobDescription[
sizeof (FV_HANDOFF_TABLE_DESC)];
178 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
179 &gEfiPeiFirmwareVolumeInfoPpiGuid,
183 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
184 &gEfiPeiFirmwareVolumeInfo2PpiGuid,
188 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
189 &gEfiEndOfPeiSignalPpiGuid,
219 MeasuredHobData =
NULL;
231 if (MeasuredHobData !=
NULL) {
235 MeasuredHobData->Num = mMeasuredBaseFvIndex + mMeasuredChildFvIndex;
263 EFI_TCG2_EVENT_ALGORITHM_BITMAP TpmHashAlgorithmBitmap;
264 EFI_TCG2_EVENT_ALGORITHM_BITMAP BiosHashAlgorithmBitmap;
265 UINT32 TpmActivePcrBanks;
266 UINT32 NewTpmActivePcrBanks;
268 UINT32 NewTpm2PcrMask;
270 DEBUG ((DEBUG_ERROR,
"SyncPcrAllocationsAndPcrMask!\n"));
278 DEBUG ((DEBUG_INFO,
"Tpm2GetCapabilitySupportedAndActivePcrs - TpmHashAlgorithmBitmap: 0x%08x\n", TpmHashAlgorithmBitmap));
279 DEBUG ((DEBUG_INFO,
"Tpm2GetCapabilitySupportedAndActivePcrs - TpmActivePcrBanks 0x%08x\n", TpmActivePcrBanks));
281 Tpm2PcrMask =
PcdGet32 (PcdTpm2HashMask);
282 if (Tpm2PcrMask == 0) {
287 PcdSet32S (PcdTpm2HashMask, TpmActivePcrBanks);
288 Tpm2PcrMask = TpmActivePcrBanks;
291 DEBUG ((DEBUG_INFO,
"Tpm2PcrMask 0x%08x\n", Tpm2PcrMask));
302 BiosHashAlgorithmBitmap =
PcdGet32 (PcdTcg2HashAlgorithmBitmap);
303 DEBUG ((DEBUG_INFO,
"Tcg2HashAlgorithmBitmap: 0x%08x\n", BiosHashAlgorithmBitmap));
305 if (((TpmActivePcrBanks & Tpm2PcrMask) != TpmActivePcrBanks) ||
306 ((TpmActivePcrBanks & BiosHashAlgorithmBitmap) != TpmActivePcrBanks))
308 DEBUG ((DEBUG_INFO,
"TpmActivePcrBanks & Tpm2PcrMask = 0x%08x\n", (TpmActivePcrBanks & Tpm2PcrMask)));
309 DEBUG ((DEBUG_INFO,
"TpmActivePcrBanks & BiosHashAlgorithmBitmap = 0x%08x\n", (TpmActivePcrBanks & BiosHashAlgorithmBitmap)));
310 NewTpmActivePcrBanks = TpmActivePcrBanks;
311 NewTpmActivePcrBanks &= Tpm2PcrMask;
312 NewTpmActivePcrBanks &= BiosHashAlgorithmBitmap;
313 DEBUG ((DEBUG_INFO,
"NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBanks));
315 DEBUG ((DEBUG_INFO,
"%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __func__, TpmActivePcrBanks, NewTpmActivePcrBanks));
317 if (NewTpmActivePcrBanks == 0) {
318 DEBUG ((DEBUG_ERROR,
"%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
321 DEBUG ((DEBUG_ERROR,
"Tpm2PcrAllocateBanks (TpmHashAlgorithmBitmap: 0x%08x, NewTpmActivePcrBanks: 0x%08x)\n", TpmHashAlgorithmBitmap, NewTpmActivePcrBanks));
323 if (EFI_ERROR (Status)) {
327 DEBUG ((DEBUG_ERROR,
"%a - Failed to reallocate PCRs!\n", __func__));
342 if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) {
343 NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap;
345 DEBUG ((DEBUG_INFO,
"%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __func__, Tpm2PcrMask, NewTpm2PcrMask));
346 if (NewTpm2PcrMask == 0) {
347 DEBUG ((DEBUG_ERROR,
"%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
351 Status =
PcdSet32S (PcdTpm2HashMask, NewTpm2PcrMask);
352 DEBUG ((DEBUG_ERROR,
"Set PcdTpm2Hash Mask to 0x%08x\n", NewTpm2PcrMask));
371 IN UINT8 *NewEventData
378 UINT32 SupportedEventLogs;
382 SupportedEventLogs = EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2;
385 for (Index = 0; Index <
sizeof (mTcg2EventInfo)/
sizeof (mTcg2EventInfo[0]); Index++) {
386 if ((SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {
387 DEBUG ((DEBUG_INFO,
" LogFormat - 0x%08x\n", mTcg2EventInfo[Index].LogFormat));
388 switch (mTcg2EventInfo[Index].LogFormat) {
389 case EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2:
391 if (!EFI_ERROR (Status)) {
393 &gTcgEventEntryHobGuid,
394 sizeof (*NewEventHdr) + NewEventHdr->EventSize
396 if (HobData ==
NULL) {
397 RetStatus = EFI_OUT_OF_RESOURCES;
401 CopyMem (HobData, NewEventHdr,
sizeof (*NewEventHdr));
402 HobData = (VOID *)((UINT8 *)HobData +
sizeof (*NewEventHdr));
403 CopyMem (HobData, NewEventData, NewEventHdr->EventSize);
407 case EFI_TCG2_EVENT_LOG_FORMAT_TCG_2:
413 &gTcgEvent2EntryHobGuid,
414 sizeof (TcgPcrEvent2->PCRIndex) + sizeof (TcgPcrEvent2->EventType) +
GetDigestListSize (DigestList) +
sizeof (TcgPcrEvent2->EventSize) + NewEventHdr->EventSize
416 if (HobData ==
NULL) {
417 RetStatus = EFI_OUT_OF_RESOURCES;
421 TcgPcrEvent2 = HobData;
422 TcgPcrEvent2->PCRIndex = NewEventHdr->PCRIndex;
423 TcgPcrEvent2->EventType = NewEventHdr->EventType;
424 DigestBuffer = (UINT8 *)&TcgPcrEvent2->Digest;
426 CopyMem (DigestBuffer, &NewEventHdr->EventSize, sizeof (TcgPcrEvent2->EventSize));
427 DigestBuffer = DigestBuffer +
sizeof (TcgPcrEvent2->EventSize);
428 CopyMem (DigestBuffer, NewEventData, NewEventHdr->EventSize);
466 IN UINT8 *NewEventData
473 return EFI_DEVICE_ERROR;
476 if (((Flags & EDKII_TCG_PRE_HASH) != 0) || ((Flags & EDKII_TCG_PRE_HASH_LOG_ONLY) != 0)) {
477 ZeroMem (&DigestList,
sizeof (DigestList));
478 CopyMem (&DigestList, HashData,
sizeof (DigestList));
480 if ((Flags & EDKII_TCG_PRE_HASH) != 0 ) {
482 NewEventHdr->PCRIndex,
488 NewEventHdr->PCRIndex,
495 if (!EFI_ERROR (Status)) {
496 Status =
LogHashEvent (&DigestList, NewEventHdr, NewEventData);
499 if (Status == EFI_DEVICE_ERROR) {
500 DEBUG ((DEBUG_ERROR,
"HashLogExtendEvent - %r. Disable TPM.\n", Status));
504 (
PcdGet32 (PcdStatusCodeSubClassTpmDevice) | EFI_P_EC_INTERFACE_ERROR)
531 TcgEventHdr.PCRIndex = 0;
532 TcgEventHdr.EventType = EV_S_CRTM_VERSION;
533 TcgEventHdr.EventSize = (UINT32)
StrSize ((CHAR16 *)
PcdGetPtr (PcdFirmwareVersionString));
538 (UINT8 *)
PcdGetPtr (PcdFirmwareVersionString),
539 TcgEventHdr.EventSize,
541 (UINT8 *)
PcdGetPtr (PcdFirmwareVersionString)
588 return &FvExtHeader->
FvName;
636 &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid,
639 (VOID **)&MeasurementExcludedFvPpi
641 if (!EFI_ERROR (Status)) {
642 for (Index = 0; Index < MeasurementExcludedFvPpi->Count; Index++) {
643 if ( (MeasurementExcludedFvPpi->Fv[Index].FvBase == FvBase)
644 && (MeasurementExcludedFvPpi->Fv[Index].FvLength == FvLength))
646 DEBUG ((DEBUG_INFO,
"The FV which is excluded by Tcg2Pei starts at: 0x%x\n", FvBase));
647 DEBUG ((DEBUG_INFO,
"The FV which is excluded by Tcg2Pei has the size: 0x%x\n", FvLength));
654 }
while (!EFI_ERROR (Status));
659 for (Index = 0; Index < mMeasuredBaseFvIndex; Index++) {
660 if ((mMeasuredBaseFvInfo[Index].BlobBase == FvBase) && (mMeasuredBaseFvInfo[Index].BlobLength == FvLength)) {
661 DEBUG ((DEBUG_INFO,
"The FV which is already measured by Tcg2Pei starts at: 0x%x\n", FvBase));
662 DEBUG ((DEBUG_INFO,
"The FV which is already measured by Tcg2Pei has the size: 0x%x\n", FvLength));
671 Tpm2HashMask =
PcdGet32 (PcdTpm2HashMask);
674 &gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid,
677 (VOID **)&PrehashedFvPpi
679 if (!EFI_ERROR (Status) && (PrehashedFvPpi->FvBase == FvBase) && (PrehashedFvPpi->FvLength == FvLength)) {
685 PreHashInfo = (
HASH_INFO *)(PrehashedFvPpi + 1);
686 for (Index = 0, DigestCount = 0; Index < PrehashedFvPpi->Count; Index++) {
687 DEBUG ((DEBUG_INFO,
"Hash Algo ID in PrehashedFvPpi=0x%x\n", PreHashInfo->HashAlgoId));
689 if ((Tpm2HashMask & HashAlgoMask) != 0 ) {
693 WriteUnaligned16 (&(DigestList.digests[DigestCount].hashAlg), PreHashInfo->HashAlgoId);
695 &DigestList.digests[DigestCount].digest,
697 PreHashInfo->HashSize
703 Tpm2HashMask &= ~HashAlgoMask;
706 PreHashInfo = (
HASH_INFO *)((UINT8 *)(PreHashInfo + 1) + PreHashInfo->HashSize);
715 }
while (!EFI_ERROR (Status));
723 while (Hob.Raw !=
NULL) {
724 MigratedFvInfo = GET_GUID_HOB_DATA (Hob);
725 if ((MigratedFvInfo->FvNewBase == (UINT32)FvBase) && (MigratedFvInfo->FvLength == (UINT32)FvLength)) {
734 Hob.Raw = GET_NEXT_HOB (Hob);
741 if (
PcdGet32 (PcdTcgPfpMeasurementRevision) >= TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105) {
742 FvBlob2.BlobDescriptionSize =
sizeof (FvBlob2.BlobDescription);
743 CopyMem (FvBlob2.BlobDescription, FV_HANDOFF_TABLE_DESC, sizeof (FvBlob2.BlobDescription));
745 if (FvName !=
NULL) {
746 AsciiSPrint ((CHAR8 *)FvBlob2.BlobDescription, sizeof (FvBlob2.BlobDescription),
"Fv(%g)", FvName);
749 FvBlob2.BlobBase = FvOrgBase;
750 FvBlob2.BlobLength = FvLength;
751 TcgEventHdr.PCRIndex = 0;
752 TcgEventHdr.EventType = EV_EFI_PLATFORM_FIRMWARE_BLOB2;
753 TcgEventHdr.EventSize =
sizeof (FvBlob2);
754 EventData = &FvBlob2;
756 FvBlob.BlobBase = FvOrgBase;
757 FvBlob.BlobLength = FvLength;
758 TcgEventHdr.PCRIndex = 0;
759 TcgEventHdr.EventType = EV_EFI_PLATFORM_FIRMWARE_BLOB;
760 TcgEventHdr.EventSize =
sizeof (FvBlob);
764 if (Tpm2HashMask == 0) {
772 (UINT8 *)&DigestList,
773 (
UINTN)
sizeof (DigestList),
777 DEBUG ((DEBUG_INFO,
"The pre-hashed FV which is extended & logged by Tcg2Pei starts at: 0x%x\n", FvBase));
778 DEBUG ((DEBUG_INFO,
"The pre-hashed FV which is extended & logged by Tcg2Pei has the size: 0x%x\n", FvLength));
786 (UINT8 *)(
UINTN)FvDataBase,
791 DEBUG ((DEBUG_INFO,
"The FV which is measured by Tcg2Pei starts at: 0x%x\n", FvBase));
792 DEBUG ((DEBUG_INFO,
"The FV which is measured by Tcg2Pei has the size: 0x%x\n", FvLength));
795 if (EFI_ERROR (Status)) {
796 DEBUG ((DEBUG_ERROR,
"The FV which failed to be measured starts at: 0x%x\n", FvBase));
803 if (mMeasuredBaseFvIndex >= mMeasuredMaxBaseFvIndex) {
809 ASSERT (mMeasuredBaseFvInfo !=
NULL);
810 mMeasuredMaxBaseFvIndex = mMeasuredMaxBaseFvIndex + FIRMWARE_BLOB_GROWTH_STEP;
813 mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobBase = FvBase;
814 mMeasuredBaseFvInfo[mMeasuredBaseFvIndex].BlobLength = FvLength;
815 mMeasuredBaseFvIndex++;
838 PERF_START_EX (mFileHandle,
"EventRec",
"Tcg2Pei", 0, PERF_ID_TCG2_PEI);
869 PERF_END_EX (mFileHandle,
"EventRec",
"Tcg2Pei", 0, PERF_ID_TCG2_PEI + 1);
909 if (EFI_ERROR (Status)) {
918 if (mMeasuredChildFvIndex >= mMeasuredMaxChildFvIndex) {
924 ASSERT (mMeasuredChildFvInfo !=
NULL);
925 mMeasuredMaxChildFvIndex = mMeasuredMaxChildFvIndex + FIRMWARE_BLOB_GROWTH_STEP;
931 for (Index = 0; Index < mMeasuredChildFvIndex; Index++) {
938 mMeasuredChildFvInfo[mMeasuredChildFvIndex].BlobLength = Fv->
FvInfoSize;
939 mMeasuredChildFvIndex++;
969 if (
PcdGet8 (PcdTpm2ScrtmPolicy) == 1) {
974 if (EFI_ERROR (Status)) {
1010 TcgEvent.PCRIndex = PCRIndex;
1011 TcgEvent.EventType = EV_SEPARATOR;
1012 TcgEvent.EventSize = (UINT32)
sizeof (EventData);
1013 return HashLogExtendEvent (&mEdkiiTcgPpi, 0, (UINT8 *)&EventData, TcgEvent.EventSize, &TcgEvent, (UINT8 *)&EventData);
1036 BOOLEAN S3ErrorReport;
1041 DEBUG ((DEBUG_INFO,
"No TPM2 instance required!\n"));
1042 return EFI_UNSUPPORTED;
1046 DEBUG ((DEBUG_ERROR,
"TPM2 error!\n"));
1047 return EFI_DEVICE_ERROR;
1056 if (BootMode != BOOT_ON_S3_RESUME) {
1057 Status = (**PeiServices).RegisterForShadow (FileHandle);
1058 if (Status == EFI_ALREADY_STARTED) {
1059 mImageInMemory =
TRUE;
1060 mFileHandle = FileHandle;
1061 }
else if (Status == EFI_NOT_FOUND) {
1066 if (!mImageInMemory) {
1071 if (EFI_ERROR (Status)) {
1072 DEBUG ((DEBUG_ERROR,
"TPM2 not detected!\n"));
1076 S3ErrorReport =
FALSE;
1077 if (
PcdGet8 (PcdTpm2InitializationPolicy) == 1) {
1078 if (BootMode == BOOT_ON_S3_RESUME) {
1080 if (EFI_ERROR (Status)) {
1082 if (!EFI_ERROR (Status)) {
1083 S3ErrorReport =
TRUE;
1090 if (EFI_ERROR (Status)) {
1100 if (S3ErrorReport) {
1108 for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) {
1110 if (EFI_ERROR (Status)) {
1111 DEBUG ((DEBUG_ERROR,
"Separator Event with Error not Measured. Error!\n"));
1119 if (BootMode != BOOT_ON_S3_RESUME) {
1120 if (
PcdGet8 (PcdTpm2SelfTestPolicy) == 1) {
1122 if (EFI_ERROR (Status)) {
1142 if (mImageInMemory) {
1148 if (EFI_ERROR (Status)) {
1149 DEBUG ((DEBUG_ERROR,
"TPM2 error! Build Hob\n"));
1153 (
PcdGet32 (PcdStatusCodeSubClassTpmDevice) | EFI_P_EC_INTERFACE_ERROR)
VOID EFIAPI ResetCold(VOID)
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
EFI_STATUS EFIAPI PeiServicesFfsFindNextVolume(IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle)
EFI_STATUS EFIAPI PeiServicesGetBootMode(OUT EFI_BOOT_MODE *BootMode)
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiServicesNotifyPpi(IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI PeiServicesFfsGetVolumeInfo(IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_FV_INFO *VolumeInfo)
EFI_STATUS EFIAPI HashAndExtend(IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define REPORT_STATUS_CODE(Type, Value)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
#define PcdSet32S(TokenName, Value)
#define PcdGetPtr(TokenName)
VOID * EFI_PEI_FILE_HANDLE
EFI_STATUS EFIAPI PeimEntryMA(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
VOID * GetFvName(IN EFI_PHYSICAL_ADDRESS FvBase, IN UINT64 FvLength)
EFI_STATUS MeasureCRTMVersion(VOID)
EFI_STATUS EFIAPI FirmwareVolumeInfoPpiNotifyCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS LogHashEvent(IN TPML_DIGEST_VALUES *DigestList, IN OUT TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData)
EFI_STATUS MeasureMainBios(VOID)
EFI_STATUS MeasureSeparatorEventWithError(IN TPM_PCRINDEX PCRIndex)
EFI_STATUS PeimEntryMP(IN EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI EndofPeiSignalNotifyCallBack(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
VOID SyncPcrAllocationsAndPcrMask(VOID)
EFI_STATUS EFIAPI HashLogExtendEvent(IN EDKII_TCG_PPI *This, IN UINT64 Flags, IN UINT8 *HashData, IN UINTN HashDataLen, IN TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData)
EFI_STATUS MeasureFvImage(IN EFI_PHYSICAL_ADDRESS FvBase, IN UINT64 FvLength)
UINT32 GetHashMaskFromAlgo(IN TPMI_ALG_HASH HashAlgo)
VOID * CopyDigestListToBuffer(IN OUT VOID *Buffer, IN TPML_DIGEST_VALUES *DigestList, IN UINT32 HashAlgorithmMask)
EFI_STATUS EFIAPI Tpm2GetCapabilitySupportedAndActivePcrs(OUT UINT32 *TpmHashAlgorithmBitmap, OUT UINT32 *ActivePcrBanks)
EFI_STATUS EFIAPI Tpm2SelfTest(IN TPMI_YES_NO FullTest)
EFI_STATUS EFIAPI Tpm2Startup(IN TPM_SU StartupType)
EFI_STATUS EFIAPI Tpm2PcrAllocateBanks(IN TPM2B_AUTH *PlatformAuth OPTIONAL, IN UINT32 SupportedPCRBanks, IN UINT32 PCRBanks)
UINT32 EFIAPI GetDigestListSize(IN TPML_DIGEST_VALUES *DigestList)
EFI_STATUS EFIAPI Tpm2PcrExtend(IN TPMI_DH_PCR PcrHandle, IN TPML_DIGEST_VALUES *Digests)
EFI_STATUS EFIAPI Tpm2PcrReadForActiveBank(IN TPMI_DH_PCR PcrHandle, OUT TPML_DIGEST *HashList)
EFI_STATUS EFIAPI GetDigestFromDigestList(IN TPMI_ALG_HASH HashAlg, IN TPML_DIGEST_VALUES *DigestList, OUT VOID *Digest)
EFI_STATUS EFIAPI Tpm2RequestUseTpm(VOID)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_GUID * ParentFileName