TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm2Test.c
Go to the documentation of this file.
1
13#include <Library/BaseLib.h>
14#include <Library/DebugLib.h>
15
16#pragma pack(1)
17
18typedef struct {
20 TPMI_YES_NO FullTest;
22
23typedef struct {
26
27#pragma pack()
28
41EFIAPI
43 IN TPMI_YES_NO FullTest
44 )
45{
46 EFI_STATUS Status;
49 UINT32 ResultBufSize;
50
51 Cmd.Header.tag = SwapBytes16 (TPM_ST_NO_SESSIONS);
52 Cmd.Header.paramSize = SwapBytes32 (sizeof (Cmd));
53 Cmd.Header.commandCode = SwapBytes32 (TPM_CC_SelfTest);
54 Cmd.FullTest = FullTest;
55
56 ResultBufSize = sizeof (Res);
57 Status = Tpm2SubmitCommand (sizeof (Cmd), (UINT8 *)&Cmd, &ResultBufSize, (UINT8 *)&Res);
58
59 return Status;
60}
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition: SwapBytes16.c:25
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition: SwapBytes32.c:25
#define IN
Definition: Base.h:279
EFI_STATUS EFIAPI Tpm2SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
EFI_STATUS EFIAPI Tpm2SelfTest(IN TPMI_YES_NO FullTest)
Definition: Tpm2Test.c:42
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29