]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Include/Ppi/Tcg.h
SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY
[mirror_edk2.git] / SecurityPkg / Include / Ppi / Tcg.h
CommitLineData
b630feee
JY
1/** @file\r
2 TCG PPI services.\r
3\r
4Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef _TCG_PPI_H_\r
10#define _TCG_PPI_H_\r
11\r
12#include <IndustryStandard/UefiTcgPlatform.h>\r
13\r
14typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;\r
15\r
16//\r
17// This bit is shall be set when HashData is the pre-hash digest.\r
18//\r
19#define EDKII_TCG_PRE_HASH 0x0000000000000001\r
20\r
547067dd
QZ
21//\r
22// This bit is shall be set when HashData is the pre-hash digest and log only.\r
23//\r
24#define EDKII_TCG_PRE_HASH_LOG_ONLY 0x0000000000000002\r
25\r
b630feee
JY
26/**\r
27 Tpm measure and log data, and extend the measurement result into a specific PCR.\r
28\r
29 @param[in] This Indicates the calling context\r
30 @param[in] Flags Bitmap providing additional information\r
31 @param[in] HashData If BIT0 of Flags is 0, it is physical address of the\r
32 start of the data buffer to be hashed, extended, and logged.\r
33 If BIT0 of Flags is 1, it is physical address of the\r
34 start of the pre-hash data buffter to be extended, and logged.\r
35 The pre-hash data format is TPML_DIGEST_VALUES.\r
36 @param[in] HashDataLen The length, in bytes, of the buffer referenced by HashData.\r
37 @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data structure.\r
38 @param[in] NewEventData Pointer to the new event data.\r
39\r
40 @retval EFI_SUCCESS Operation completed successfully.\r
41 @retval EFI_UNSUPPORTED TPM device not available.\r
42 @retval EFI_OUT_OF_RESOURCES Out of memory.\r
43 @retval EFI_DEVICE_ERROR The operation was unsuccessful.\r
44**/\r
45typedef\r
46EFI_STATUS\r
47(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(\r
48 IN EDKII_TCG_PPI *This,\r
49 IN UINT64 Flags,\r
50 IN UINT8 *HashData,\r
51 IN UINTN HashDataLen,\r
52 IN TCG_PCR_EVENT_HDR *NewEventHdr,\r
53 IN UINT8 *NewEventData\r
54 );\r
55\r
56///\r
57/// The EFI_TCG Protocol abstracts TCG activity.\r
58///\r
59struct _EDKII_TCG_PPI {\r
60 EDKII_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;\r
61};\r
62\r
63extern EFI_GUID gEdkiiTcgPpiGuid;\r
64\r
65#endif\r