61 Cmd.Header.commandCode =
SwapBytes32 (TPM_CC_Startup);
64 ResultBufSize =
sizeof (Res);
65 Status =
Tpm2SubmitCommand (
sizeof (Cmd), (UINT8 *)&Cmd, &ResultBufSize, (UINT8 *)&Res);
66 if (EFI_ERROR (Status)) {
70 ResponseCode =
SwapBytes32 (Res.Header.responseCode);
71 switch (ResponseCode) {
73 DEBUG ((DEBUG_INFO,
"TPM2Startup: TPM_RC_SUCCESS\n"));
75 case TPM_RC_INITIALIZE:
77 DEBUG ((DEBUG_INFO,
"TPM2Startup: TPM_RC_INITIALIZE\n"));
80 DEBUG ((DEBUG_ERROR,
"Tpm2Startup: Response Code error! 0x%08x\r\n", ResponseCode));
81 return EFI_DEVICE_ERROR;
96 IN TPM_SU ShutdownType
102 UINT32 ResultBufSize;
106 Cmd.Header.commandCode =
SwapBytes32 (TPM_CC_Shutdown);
109 ResultBufSize =
sizeof (Res);
110 Status =
Tpm2SubmitCommand (
sizeof (Cmd), (UINT8 *)&Cmd, &ResultBufSize, (UINT8 *)&Res);
111 if (EFI_ERROR (Status)) {
115 if (
SwapBytes32 (Res.Header.responseCode) != TPM_RC_SUCCESS) {
116 DEBUG ((DEBUG_ERROR,
"Tpm2Shutdown: Response Code error! 0x%08x\r\n",
SwapBytes32 (Res.Header.responseCode)));
117 return EFI_DEVICE_ERROR;
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
#define DEBUG(Expression)
EFI_STATUS EFIAPI Tpm2SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
EFI_STATUS EFIAPI Tpm2Startup(IN TPM_SU StartupType)
EFI_STATUS EFIAPI Tpm2Shutdown(IN TPM_SU ShutdownType)