TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm12Support.c
Go to the documentation of this file.
1
10#include <Library/BaseLib.h>
12
13#include "Tpm12Support.h"
14
15#pragma pack (1)
16typedef struct {
18 TPM_CURRENT_TICKS CurrentTicks;
20#pragma pack ()
21
35 )
36{
37 EFI_STATUS Status;
38 TPM_RQU_COMMAND_HDR Command;
39 TPM_RSP_GET_TICKS Response;
40 UINT32 Length;
41
42 Command.tag = SwapBytes16 (TPM_TAG_RQU_COMMAND);
43 Command.paramSize = SwapBytes32 (sizeof (Command));
44 Command.ordinal = SwapBytes32 (TPM_ORD_GetTicks);
45
46 Length = sizeof (Response);
47 Status = Tpm12SubmitCommand (
48 sizeof (Command),
49 (UINT8 *)&Command,
50 &Length,
51 (UINT8 *)&Response
52 );
53 if (EFI_ERROR (Status)) {
54 return Status;
55 }
56
57 return EFI_SUCCESS;
58}
59
72 VOID
73 )
74{
75 EFI_STATUS Status;
76
77 Status = Tpm12RequestUseTpm ();
78 if (EFI_ERROR (Status)) {
79 return Status;
80 }
81
82 return TestTpm12 ();
83}
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition: SwapBytes16.c:25
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition: SwapBytes32.c:25
#define STATIC
Definition: Base.h:264
EFI_STATUS EFIAPI Tpm12RequestUseTpm(VOID)
Definition: Tpm12Tis.c:555
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition: Tpm12Tis.c:453
EFI_STATUS InternalTpm12Detect(VOID)
Definition: Tpm12Support.c:71
STATIC EFI_STATUS TestTpm12()
Definition: Tpm12Support.c:34
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112