18EFI_GUID mInternalTpm2DeviceInterfaceGuid = {
19 0x349cf818, 0xc0ba, 0x4c43, { 0x92, 0x9a, 0xc8, 0xa1, 0xb1, 0xb3, 0xd2, 0x55 }
57 IN UINT32 InputParameterBlockSize,
58 IN UINT8 *InputParameterBlock,
59 IN OUT UINT32 *OutputParameterBlockSize,
60 IN UINT8 *OutputParameterBlock
66 if (Tpm2DeviceInterface ==
NULL) {
67 return EFI_UNSUPPORTED;
70 return Tpm2DeviceInterface->Tpm2SubmitCommand (
71 InputParameterBlockSize,
73 OutputParameterBlockSize,
94 if (Tpm2DeviceInterface ==
NULL) {
95 return EFI_UNSUPPORTED;
98 return Tpm2DeviceInterface->Tpm2RequestUseTpm ();
119 DEBUG ((DEBUG_WARN,
"WARNING: Tpm2RegisterTpm2DeviceLib - does not support %g registration\n", &Tpm2Device->ProviderGuid));
120 return EFI_UNSUPPORTED;
124 if (Tpm2DeviceInterface !=
NULL) {
128 DEBUG ((DEBUG_INFO,
"Tpm2RegisterTpm2DeviceLib - Override\n"));
129 CopyMem (Tpm2DeviceInterface, Tpm2Device,
sizeof (*Tpm2Device));
132 Tpm2Device =
BuildGuidDataHob (&mInternalTpm2DeviceInterfaceGuid, Tpm2Device,
sizeof (*Tpm2Device));
133 if (Tpm2Device !=
NULL) {
136 return EFI_OUT_OF_RESOURCES;
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
#define DEBUG(Expression)
#define PcdGetPtr(TokenName)
TPM2_DEVICE_INTERFACE * InternalGetTpm2DeviceInterface(VOID)
EFI_STATUS EFIAPI Tpm2RegisterTpm2DeviceLib(IN TPM2_DEVICE_INTERFACE *Tpm2Device)
EFI_STATUS EFIAPI Tpm2SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
EFI_STATUS EFIAPI Tpm2RequestUseTpm(VOID)