TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm12SelfTest.c
Go to the documentation of this file.
1
10#include <PiPei.h>
12#include <Library/BaseLib.h>
13#include <Library/DebugLib.h>
15
26EFIAPI
28 VOID
29 )
30{
31 EFI_STATUS Status;
32 TPM_RQU_COMMAND_HDR Command;
33 TPM_RSP_COMMAND_HDR Response;
34 UINT32 Length;
35
36 //
37 // send Tpm command TPM_ORD_ContinueSelfTest
38 //
39 Command.tag = SwapBytes16 (TPM_TAG_RQU_COMMAND);
40 Command.paramSize = SwapBytes32 (sizeof (Command));
41 Command.ordinal = SwapBytes32 (TPM_ORD_ContinueSelfTest);
42 Length = sizeof (Response);
43 Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);
44 if (EFI_ERROR (Status)) {
45 return Status;
46 }
47
48 if (SwapBytes32 (Response.returnCode) != TPM_SUCCESS) {
49 DEBUG ((DEBUG_ERROR, "Tpm12ContinueSelfTest: Response Code error! 0x%08x\r\n", SwapBytes32 (Response.returnCode)));
50 return EFI_DEVICE_ERROR;
51 }
52
53 return Status;
54}
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition: SwapBytes16.c:25
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition: SwapBytes32.c:25
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition: Tpm12Tis.c:453
EFI_STATUS EFIAPI Tpm12ContinueSelfTest(VOID)
Definition: Tpm12SelfTest.c:27
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29