]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | TcgService.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final\r | |
19 | \r | |
20 | See http://trustedcomputinggroup.org for the latest specification\r | |
21 | \r | |
22 | --*/\r | |
23 | \r | |
24 | #ifndef _TCG_SERVICE_PROTOCOL_H_\r | |
25 | #define _TCG_SERVICE_PROTOCOL_H_\r | |
26 | \r | |
27 | #include <EfiTpm.h>\r | |
28 | \r | |
29 | #define EFI_TCG_PROTOCOL_GUID \\r | |
30 | {0xf541796d, 0xa62e, 0x4954, 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd}\r | |
31 | \r | |
32 | #define TSS_EVENT_DATA_MAX_SIZE 256\r | |
33 | \r | |
34 | EFI_FORWARD_DECLARATION (EFI_TCG_PROTOCOL);\r | |
35 | \r | |
36 | //\r | |
37 | // Set structure alignment to 1-byte\r | |
38 | //\r | |
39 | #pragma pack (push, 1)\r | |
40 | \r | |
41 | typedef struct {\r | |
42 | UINT8 Major;\r | |
43 | UINT8 Minor;\r | |
44 | UINT8 RevMajor;\r | |
45 | UINT8 RevMinor;\r | |
46 | } TCG_VERSION;\r | |
47 | \r | |
48 | typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {\r | |
49 | UINT8 Size; // Size of this structure\r | |
50 | TCG_VERSION StructureVersion; \r | |
51 | TCG_VERSION ProtocolSpecVersion;\r | |
52 | UINT8 HashAlgorithmBitmap; // Hash algorithms \r | |
53 | // this protocol is capable of : 01=SHA-1\r | |
54 | BOOLEAN TPMPresentFlag; // 00h = TPM not present\r | |
55 | BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated\r | |
56 | } TCG_EFI_BOOT_SERVICE_CAPABILITY;\r | |
57 | \r | |
58 | typedef UINT32 TCG_ALGORITHM_ID;\r | |
59 | \r | |
60 | //\r | |
61 | // Restore original structure alignment\r | |
62 | //\r | |
63 | #pragma pack (pop)\r | |
64 | \r | |
65 | typedef\r | |
66 | EFI_STATUS\r | |
67 | (EFIAPI *EFI_TCG_STATUS_CHECK) (\r | |
68 | IN EFI_TCG_PROTOCOL *This,\r | |
69 | OUT TCG_EFI_BOOT_SERVICE_CAPABILITY\r | |
70 | *ProtocolCapability,\r | |
71 | OUT UINT32 *TCGFeatureFlags,\r | |
72 | OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,\r | |
73 | OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r | |
74 | );\r | |
75 | \r | |
76 | typedef\r | |
77 | EFI_STATUS\r | |
78 | (EFIAPI *EFI_TCG_HASH_ALL) (\r | |
79 | IN EFI_TCG_PROTOCOL *This,\r | |
80 | IN UINT8 *HashData,\r | |
81 | IN UINT64 HashDataLen,\r | |
82 | IN TCG_ALGORITHM_ID AlgorithmId,\r | |
83 | IN OUT UINT64 *HashedDataLen,\r | |
84 | IN OUT UINT8 **HashedDataResult\r | |
85 | );\r | |
86 | \r | |
87 | typedef\r | |
88 | EFI_STATUS\r | |
89 | (EFIAPI *EFI_TCG_LOG_EVENT) (\r | |
90 | IN EFI_TCG_PROTOCOL *This,\r | |
91 | IN TCG_PCR_EVENT *TCGLogData,\r | |
92 | IN OUT UINT32 *EventNumber,\r | |
93 | IN UINT32 Flags\r | |
94 | );\r | |
95 | \r | |
96 | typedef\r | |
97 | EFI_STATUS\r | |
98 | (EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (\r | |
99 | IN EFI_TCG_PROTOCOL *This,\r | |
100 | IN UINT32 TpmInputParamterBlockSize,\r | |
101 | IN UINT8 *TpmInputParamterBlock,\r | |
102 | IN UINT32 TpmOutputParameterBlockSize,\r | |
103 | IN UINT8 *TpmOutputParameterBlock\r | |
104 | );\r | |
105 | \r | |
106 | typedef\r | |
107 | EFI_STATUS\r | |
108 | (EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (\r | |
109 | IN EFI_TCG_PROTOCOL *This,\r | |
110 | IN UINT8 *HashData,\r | |
111 | IN UINT64 HashDataLen,\r | |
112 | IN TCG_ALGORITHM_ID AlgorithmId,\r | |
113 | IN OUT TCG_PCR_EVENT *TCGLogData,\r | |
114 | IN OUT UINT32 *EventNumber,\r | |
115 | OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r | |
116 | );\r | |
117 | \r | |
118 | typedef struct _EFI_TCG_PROTOCOL {\r | |
119 | EFI_TCG_STATUS_CHECK StatusCheck;\r | |
120 | EFI_TCG_HASH_ALL HashAll;\r | |
121 | EFI_TCG_LOG_EVENT LogEvent;\r | |
122 | EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;\r | |
123 | EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;\r | |
124 | } EFI_TCG_PROTOCOL;\r | |
125 | \r | |
126 | extern EFI_GUID gEfiTcgProtocolGuid;\r | |
127 | \r | |
128 | #endif\r |