]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3e99020d | 3 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
f57387d5 | 4 | This program and the accompanying materials \r |
3eb9473e | 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 | |
c7f33ca4 | 27 | #include "EfiTpm.h"\r |
3eb9473e | 28 | \r |
29 | #define EFI_TCG_PROTOCOL_GUID \\r | |
7ccf38a3 | 30 | {0xf541796d, 0xa62e, 0x4954, {0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd}}\r |
3eb9473e | 31 | \r |
c7f33ca4 | 32 | #define EFI_TCG_PLATFORM_PROTOCOL_GUID \\r |
7ccf38a3 | 33 | { 0x8c4c9a41, 0xbf56, 0x4627, {0x9e, 0xa, 0xc8, 0x38, 0x6d, 0x66, 0x11, 0x5c} }\r |
c7f33ca4 | 34 | \r |
3eb9473e | 35 | #define TSS_EVENT_DATA_MAX_SIZE 256\r |
36 | \r | |
c7f33ca4 | 37 | #define EFI_CALLING_EFI_APPLICATION \\r |
38 | "Calling EFI Application from Boot Option"\r | |
39 | #define EFI_RETURNING_FROM_EFI_APPLICATOIN \\r | |
40 | "Returning from EFI Application from Boot Option"\r | |
41 | #define EFI_EXIT_BOOT_SERVICES_INVOCATION \\r | |
42 | "Exit Boot Services Invocation"\r | |
43 | #define EFI_EXIT_BOOT_SERVICES_FAILED \\r | |
44 | "Exit Boot Services Returned with Failure"\r | |
45 | #define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \\r | |
46 | "Exit Boot Services Returned with Success"\r | |
47 | \r | |
3eb9473e | 48 | EFI_FORWARD_DECLARATION (EFI_TCG_PROTOCOL);\r |
49 | \r | |
50 | //\r | |
51 | // Set structure alignment to 1-byte\r | |
52 | //\r | |
88b6bcec | 53 | #pragma pack (1)\r |
3eb9473e | 54 | \r |
55 | typedef struct {\r | |
56 | UINT8 Major;\r | |
57 | UINT8 Minor;\r | |
58 | UINT8 RevMajor;\r | |
59 | UINT8 RevMinor;\r | |
60 | } TCG_VERSION;\r | |
61 | \r | |
62 | typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {\r | |
63 | UINT8 Size; // Size of this structure\r | |
64 | TCG_VERSION StructureVersion; \r | |
65 | TCG_VERSION ProtocolSpecVersion;\r | |
66 | UINT8 HashAlgorithmBitmap; // Hash algorithms \r | |
67 | // this protocol is capable of : 01=SHA-1\r | |
68 | BOOLEAN TPMPresentFlag; // 00h = TPM not present\r | |
69 | BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated\r | |
70 | } TCG_EFI_BOOT_SERVICE_CAPABILITY;\r | |
71 | \r | |
72 | typedef UINT32 TCG_ALGORITHM_ID;\r | |
73 | \r | |
74 | //\r | |
75 | // Restore original structure alignment\r | |
76 | //\r | |
88b6bcec | 77 | #pragma pack ()\r |
3eb9473e | 78 | \r |
79 | typedef\r | |
80 | EFI_STATUS\r | |
81 | (EFIAPI *EFI_TCG_STATUS_CHECK) (\r | |
82 | IN EFI_TCG_PROTOCOL *This,\r | |
83 | OUT TCG_EFI_BOOT_SERVICE_CAPABILITY\r | |
84 | *ProtocolCapability,\r | |
85 | OUT UINT32 *TCGFeatureFlags,\r | |
86 | OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,\r | |
87 | OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r | |
88 | );\r | |
89 | \r | |
90 | typedef\r | |
91 | EFI_STATUS\r | |
92 | (EFIAPI *EFI_TCG_HASH_ALL) (\r | |
93 | IN EFI_TCG_PROTOCOL *This,\r | |
94 | IN UINT8 *HashData,\r | |
95 | IN UINT64 HashDataLen,\r | |
96 | IN TCG_ALGORITHM_ID AlgorithmId,\r | |
97 | IN OUT UINT64 *HashedDataLen,\r | |
98 | IN OUT UINT8 **HashedDataResult\r | |
99 | );\r | |
100 | \r | |
101 | typedef\r | |
102 | EFI_STATUS\r | |
103 | (EFIAPI *EFI_TCG_LOG_EVENT) (\r | |
104 | IN EFI_TCG_PROTOCOL *This,\r | |
105 | IN TCG_PCR_EVENT *TCGLogData,\r | |
106 | IN OUT UINT32 *EventNumber,\r | |
107 | IN UINT32 Flags\r | |
108 | );\r | |
109 | \r | |
110 | typedef\r | |
111 | EFI_STATUS\r | |
112 | (EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (\r | |
113 | IN EFI_TCG_PROTOCOL *This,\r | |
3e99020d LG |
114 | IN UINT32 TpmInputParameterBlockSize,\r |
115 | IN UINT8 *TpmInputParameterBlock,\r | |
3eb9473e | 116 | IN UINT32 TpmOutputParameterBlockSize,\r |
117 | IN UINT8 *TpmOutputParameterBlock\r | |
118 | );\r | |
119 | \r | |
120 | typedef\r | |
121 | EFI_STATUS\r | |
122 | (EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (\r | |
123 | IN EFI_TCG_PROTOCOL *This,\r | |
3e99020d | 124 | IN EFI_PHYSICAL_ADDRESS HashData,\r |
3eb9473e | 125 | IN UINT64 HashDataLen,\r |
126 | IN TCG_ALGORITHM_ID AlgorithmId,\r | |
127 | IN OUT TCG_PCR_EVENT *TCGLogData,\r | |
128 | IN OUT UINT32 *EventNumber,\r | |
129 | OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r | |
130 | );\r | |
131 | \r | |
9c092841 | 132 | struct _EFI_TCG_PROTOCOL {\r |
3eb9473e | 133 | EFI_TCG_STATUS_CHECK StatusCheck;\r |
134 | EFI_TCG_HASH_ALL HashAll;\r | |
135 | EFI_TCG_LOG_EVENT LogEvent;\r | |
136 | EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;\r | |
137 | EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;\r | |
9c092841 | 138 | };\r |
3eb9473e | 139 | \r |
140 | extern EFI_GUID gEfiTcgProtocolGuid;\r | |
141 | \r | |
c7f33ca4 | 142 | //\r |
143 | // EFI TCG Platform Protocol\r | |
144 | //\r | |
145 | typedef\r | |
146 | EFI_STATUS\r | |
147 | (EFIAPI *EFI_TCG_MEASURE_PE_IMAGE) (\r | |
148 | IN BOOLEAN BootPolicy,\r | |
149 | IN EFI_PHYSICAL_ADDRESS ImageAddress,\r | |
150 | IN UINTN ImageSize,\r | |
151 | IN UINTN LinkTimeBase,\r | |
152 | IN UINT16 ImageType,\r | |
153 | IN EFI_HANDLE DeviceHandle,\r | |
154 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath\r | |
155 | );\r | |
156 | \r | |
157 | typedef\r | |
158 | EFI_STATUS\r | |
159 | (EFIAPI *EFI_TCG_MEASURE_ACTION) (\r | |
160 | IN CHAR8 *ActionString\r | |
161 | );\r | |
162 | \r | |
3e99020d LG |
163 | typedef\r |
164 | EFI_STATUS\r | |
165 | (EFIAPI *EFI_TCG_MEASURE_GPT_TABLE) (\r | |
166 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
167 | );\r | |
168 | \r | |
169 | typedef struct _EFI_TCG_PLATFORM_PROTOCOL {\r | |
c7f33ca4 | 170 | EFI_TCG_MEASURE_PE_IMAGE MeasurePeImage;\r |
171 | EFI_TCG_MEASURE_ACTION MeasureAction;\r | |
3e99020d | 172 | EFI_TCG_MEASURE_GPT_TABLE MeasureGptTable;\r |
c7f33ca4 | 173 | } EFI_TCG_PLATFORM_PROTOCOL;\r |
174 | \r | |
175 | extern EFI_GUID gEfiTcgPlatformProtocolGuid;\r | |
176 | \r | |
3eb9473e | 177 | #endif\r |