TianoCore EDK2
master
Loading...
Searching...
No Matches
Tpm12Support.c
Go to the documentation of this file.
1
10
#include <
Library/BaseLib.h
>
11
#include <
Library/Tpm12DeviceLib.h
>
12
13
#include "
Tpm12Support.h
"
14
15
#pragma pack (1)
16
typedef
struct
{
17
TPM_RSP_COMMAND_HDR
Hdr;
18
TPM_CURRENT_TICKS
CurrentTicks;
19
}
TPM_RSP_GET_TICKS
;
20
#pragma pack ()
21
32
STATIC
33
EFI_STATUS
34
TestTpm12
(
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
70
EFI_STATUS
71
InternalTpm12Detect
(
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
}
BaseLib.h
SwapBytes16
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition:
SwapBytes16.c:25
SwapBytes32
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition:
SwapBytes32.c:25
STATIC
#define STATIC
Definition:
Base.h:264
Tpm12DeviceLib.h
Tpm12RequestUseTpm
EFI_STATUS EFIAPI Tpm12RequestUseTpm(VOID)
Definition:
Tpm12Tis.c:555
Tpm12SubmitCommand
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition:
Tpm12Tis.c:453
InternalTpm12Detect
EFI_STATUS InternalTpm12Detect(VOID)
Definition:
Tpm12Support.c:71
TestTpm12
STATIC EFI_STATUS TestTpm12()
Definition:
Tpm12Support.c:34
Tpm12Support.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
TPM_RSP_GET_TICKS
Definition:
Tpm12Support.c:16
tdTPM_CURRENT_TICKS
Definition:
Tpm12.h:1267
tdTPM_RQU_COMMAND_HDR
Definition:
Tpm12.h:2148
tdTPM_RSP_COMMAND_HDR
Definition:
Tpm12.h:2157
OvmfPkg
Tcg
Tcg2Config
Tpm12Support.c
Generated on Fri Nov 15 2024 18:01:21 for TianoCore EDK2 by
1.9.6