]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/TcgDxe/TpmComm.h
Add TPM2 implementation.
[mirror_edk2.git] / SecurityPkg / Tcg / TcgDxe / TpmComm.h
CommitLineData
0c18794e 1/** @file \r
2 Definitions and function prototypes used by TPM DXE driver.\r
3\r
4Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _TPM_COMM_H_\r
16#define _TPM_COMM_H_\r
17\r
18/**\r
19 Add a new entry to the Event Log.\r
20\r
21 @param[in, out] EventLogPtr Pointer to the Event Log data. \r
22 @param[in, out] LogSize Size of the Event Log. \r
23 @param[in] MaxSize Maximum size of the Event Log.\r
24 @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data structure. \r
25 @param[in] NewEventData Pointer to the new event data. \r
26 \r
27 @retval EFI_SUCCESS The new event log entry was added.\r
28 @retval EFI_OUT_OF_RESOURCES No enough memory to log the new event.\r
29\r
30**/\r
31EFI_STATUS\r
32TpmCommLogEvent (\r
33 IN OUT UINT8 **EventLogPtr,\r
34 IN OUT UINTN *LogSize,\r
35 IN UINTN MaxSize,\r
36 IN TCG_PCR_EVENT_HDR *NewEventHdr,\r
37 IN UINT8 *NewEventData\r
38 );\r
39\r
40/**\r
41 Extend a TPM PCR.\r
42\r
43 @param[in] TpmHandle TPM handle. \r
44 @param[in] DigestToExtend The 160 bit value representing the event to be recorded. \r
45 @param[in] PcrIndex The PCR to be updated.\r
46 @param[out] NewPcrValue New PCR value after extend. \r
47 \r
48 @retval EFI_SUCCESS Operation completed successfully.\r
49 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
50\r
51**/\r
52EFI_STATUS\r
53TpmCommExtend (\r
54 IN TIS_TPM_HANDLE TpmHandle,\r
55 IN TPM_DIGEST *DigestToExtend,\r
56 IN TPM_PCRINDEX PcrIndex,\r
57 OUT TPM_DIGEST *NewPcrValue\r
58 );\r
59\r
60/**\r
61 Get TPM capability flags.\r
62\r
63 @param[in] TpmHandle TPM handle. \r
64 @param[in] FlagSubcap Flag subcap. \r
65 @param[out] FlagBuffer Pointer to the buffer for returned flag structure.\r
66 @param[in] FlagSize Size of the buffer. \r
67 \r
68 @retval EFI_SUCCESS Operation completed successfully.\r
69 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
70\r
71**/\r
72EFI_STATUS\r
73TpmCommGetFlags (\r
74 IN TIS_TPM_HANDLE TpmHandle,\r
75 IN UINT32 FlagSubcap,\r
76 OUT VOID *Buffer,\r
77 IN UINTN Size\r
78 );\r
79\r
80/**\r
81 Send formatted command to TPM for execution and return formatted data from response.\r
82\r
83 @param[in] TisReg TPM Handle. \r
84 @param[in] Fmt Format control string. \r
85 @param[in] ... The variable argument list.\r
86 \r
87 @retval EFI_SUCCESS Operation completed successfully.\r
88 @retval EFI_TIMEOUT The register can't run into the expected status in time.\r
89\r
90**/\r
91EFI_STATUS\r
92EFIAPI\r
93TisPcExecute (\r
94 IN TIS_TPM_HANDLE TisReg,\r
95 IN CONST CHAR8 *Fmt,\r
96 ...\r
97 );\r
98\r
99#endif // _TPM_COMM_H_\r