XenevaOS
Loading...
Searching...
No Matches
UefiTcgPlatform.h
Go to the documentation of this file.
1
15#ifndef __UEFI_TCG_PLATFORM_H__
16#define __UEFI_TCG_PLATFORM_H__
17
20#include <Uefi.h>
21
22//
23// Standard event types
24//
25#define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
26#define EV_NO_ACTION ((TCG_EVENTTYPE) 0x00000003)
27#define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
28#define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
29#define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
30#define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009)
31#define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B)
32
33//
34// EFI specific event types
35//
36#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
37#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
38#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
39#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
40#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
41#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
42#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
43#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
44#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
45#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
46#define EV_EFI_VARIABLE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE0)
47
48#define EFI_CALLING_EFI_APPLICATION \
49 "Calling EFI Application from Boot Option"
50#define EFI_RETURNING_FROM_EFI_APPLICATOIN \
51 "Returning from EFI Application from Boot Option"
52#define EFI_EXIT_BOOT_SERVICES_INVOCATION \
53 "Exit Boot Services Invocation"
54#define EFI_EXIT_BOOT_SERVICES_FAILED \
55 "Exit Boot Services Returned with Failure"
56#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \
57 "Exit Boot Services Returned with Success"
58
59
60#define EV_POSTCODE_INFO_POST_CODE "POST CODE"
61#define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1)
62
63#define EV_POSTCODE_INFO_SMM_CODE "SMM CODE"
64#define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1)
65
66#define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA"
67#define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1)
68
69#define EV_POSTCODE_INFO_BIS_CODE "BIS CODE"
70#define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1)
71
72#define EV_POSTCODE_INFO_UEFI_PI "UEFI PI"
73#define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1)
74
75#define EV_POSTCODE_INFO_OPROM "Embedded Option ROM"
76#define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1)
77
78#define FIRMWARE_DEBUGGER_EVENT_STRING "UEFI Debug Mode"
79#define FIRMWARE_DEBUGGER_EVENT_STRING_LEN (sizeof(FIRMWARE_DEBUGGER_EVENT_STRING) - 1)
80
81//
82// Set structure alignment to 1-byte
83//
84#pragma pack (1)
85
99
100#define TSS_EVENT_DATA_MAX_SIZE 256
101
111
122
136
147
163
179
180//
181// For TrEE1.0 compatibility
182//
183typedef struct {
185 UINT64 UnicodeNameLength; // The TCG Definition used UINTN
186 UINT64 VariableDataLength; // The TCG Definition used UINTN
187 CHAR16 UnicodeName[1];
188 INT8 VariableData[1];
190
196
197//
198// Crypto Agile Log Entry Format
199//
207
208//
209// TCG PCR Event2 Header
210// Follow TCG EFI Protocol Spec 5.2 Crypto Agile Log Entry Format
211//
218
219//
220// Log Header Entry Data
221//
222typedef struct {
223 //
224 // TCG defined hashing algorithm ID.
225 //
227 //
228 // The size of the digest for the respective hashing algorithm.
229 //
232
233#define TCG_EfiSpecIDEventStruct_SIGNATURE_02 "Spec ID Event02"
234#define TCG_EfiSpecIDEventStruct_SIGNATURE_03 "Spec ID Event03"
235
236#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM12 1
237#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM12 2
238#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM12 2
239
240#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM2 2
241#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM2 0
242#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2 0
243
244typedef struct {
245 UINT8 signature[16];
246 //
247 // The value for the Platform Class.
248 // The enumeration is defined in the TCG ACPI Specification Client Common Header.
249 //
251 //
252 // The TCG EFI Platform Specification minor version number this BIOS supports.
253 // Any BIOS supporting version (1.22) MUST set this value to 02h.
254 // Any BIOS supporting version (2.0) SHALL set this value to 0x00.
255 //
257 //
258 // The TCG EFI Platform Specification major version number this BIOS supports.
259 // Any BIOS supporting version (1.22) MUST set this value to 01h.
260 // Any BIOS supporting version (2.0) SHALL set this value to 0x02.
261 //
263 //
264 // The TCG EFI Platform Specification errata for this specification this BIOS supports.
265 // Any BIOS supporting version and errata (1.22) MUST set this value to 02h.
266 // Any BIOS supporting version and errata (2.0) SHALL set this value to 0x00.
267 //
269 //
270 // Specifies the size of the UINTN fields used in various data structures used in this specification.
271 // 0x01 indicates UINT32 and 0x02 indicates UINT64.
272 //
274 //
275 // This field is added in "Spec ID Event03".
276 // The number of hashing algorithms used in this event log (except the first event).
277 // All events in this event log use all hashing algorithms defined here.
278 //
279//UINT32 numberOfAlgorithms;
280 //
281 // This field is added in "Spec ID Event03".
282 // An array of size numberOfAlgorithms of value pairs.
283 //
284//TCG_EfiSpecIdEventAlgorithmSize digestSize[numberOfAlgorithms];
285 //
286 // Size in bytes of the VendorInfo field.
287 // Maximum value SHALL be FFh bytes.
288 //
289//UINT8 vendorInfoSize;
290 //
291 // Provided for use by the BIOS implementer.
292 // The value might be used, for example, to provide more detailed information about the specific BIOS such as BIOS revision numbers, etc.
293 // The values within this field are not standardized and are implementer-specific.
294 // Platform-specific or -unique information SHALL NOT be provided in this field.
295 //
296//UINT8 vendorInfo[vendorInfoSize];
298
299
300
301#define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality"
302
303
304//
305// PC Client PTP spec Table 8 Relationship between Locality and Locality Attribute
306//
307#define LOCALITY_0_INDICATOR 0x01
308#define LOCALITY_1_INDICATOR 0x02
309#define LOCALITY_2_INDICATOR 0x03
310#define LOCALITY_3_INDICATOR 0x04
311#define LOCALITY_4_INDICATOR 0x05
312
313
314//
315// Startup Locality Event
316//
319 //
320 // The Locality Indicator which sent the TPM2_Startup command
321 //
324
325
326//
327// Restore original structure alignment
328//
329#pragma pack ()
330
331#endif
332
333
UINT64 UINTN
Definition ProcessorBind.h:118
unsigned short CHAR16
Definition ProcessorBind.h:105
signed char INT8
Definition ProcessorBind.h:110
unsigned int UINT32
Definition ProcessorBind.h:102
UINT32 TPM_PCRINDEX
Definition Tpm12.h:140
UINT64 EFI_PHYSICAL_ADDRESS
Definition UefiBaseType.h:54
struct tdTCG_EfiStartupLocalityEvent TCG_EfiStartupLocalityEvent
UINT32 TCG_EVENTTYPE
Definition UefiTcgPlatform.h:86
TPM_DIGEST TCG_DIGEST
Definition UefiTcgPlatform.h:88
struct tdTCG_PCR_EVENT TCG_PCR_EVENT
TPM_PCRINDEX TCG_PCRINDEX
Definition UefiTcgPlatform.h:87
struct tdTCG_PCR_EVENT2 TCG_PCR_EVENT2
struct tdEFI_IMAGE_LOAD_EVENT EFI_IMAGE_LOAD_EVENT
struct tdEFI_VARIABLE_DATA EFI_VARIABLE_DATA
struct tdTCG_PCR_EVENT2_HDR TCG_PCR_EVENT2_HDR
struct tdEFI_GPT_DATA EFI_GPT_DATA
struct tdUEFI_VARIABLE_DATA UEFI_VARIABLE_DATA
struct tdEFI_PLATFORM_FIRMWARE_BLOB EFI_PLATFORM_FIRMWARE_BLOB
struct tdEFI_HANDOFF_TABLE_POINTERS EFI_HANDOFF_TABLE_POINTERS
struct tdTCG_PCR_EVENT_HDR TCG_PCR_EVENT_HDR
unsigned short UINT16
Definition actypes.h:237
unsigned char UINT8
Definition actypes.h:236
COMPILER_DEPENDENT_UINT64 UINT64
Definition actypes.h:239
Definition UefiSpec.h:1949
Definition DevicePath.h:49
Definition UefiGpt.h:88
Definition UefiGpt.h:33
Definition UefiTcgPlatform.h:183
EFI_GUID VariableName
Definition UefiTcgPlatform.h:184
UINT64 VariableDataLength
Definition UefiTcgPlatform.h:186
UINT64 UnicodeNameLength
Definition UefiTcgPlatform.h:185
Definition Base.h:281
Definition UefiTcgPlatform.h:244
UINT8 uintnSize
Definition UefiTcgPlatform.h:273
UINT32 platformClass
Definition UefiTcgPlatform.h:250
UINT8 specVersionMinor
Definition UefiTcgPlatform.h:256
UINT8 specErrata
Definition UefiTcgPlatform.h:268
UINT8 specVersionMajor
Definition UefiTcgPlatform.h:262
Definition UefiTcgPlatform.h:222
UINT16 digestSize
Definition UefiTcgPlatform.h:230
UINT16 algorithmId
Definition UefiTcgPlatform.h:226
Definition Tpm20.h:1079
Definition UefiTcgPlatform.h:191
EFI_PARTITION_TABLE_HEADER EfiPartitionHeader
Definition UefiTcgPlatform.h:192
EFI_PARTITION_ENTRY Partitions[1]
Definition UefiTcgPlatform.h:194
UINTN NumberOfPartitions
Definition UefiTcgPlatform.h:193
Definition UefiTcgPlatform.h:143
UINTN NumberOfTables
Definition UefiTcgPlatform.h:144
EFI_CONFIGURATION_TABLE TableEntry[1]
Definition UefiTcgPlatform.h:145
Definition UefiTcgPlatform.h:129
UINTN ImageLinkTimeAddress
Definition UefiTcgPlatform.h:132
UINTN ImageLengthInMemory
Definition UefiTcgPlatform.h:131
UINTN LengthOfDevicePath
Definition UefiTcgPlatform.h:133
EFI_DEVICE_PATH_PROTOCOL DevicePath[1]
Definition UefiTcgPlatform.h:134
EFI_PHYSICAL_ADDRESS ImageLocationInMemory
Definition UefiTcgPlatform.h:130
Definition UefiTcgPlatform.h:118
EFI_PHYSICAL_ADDRESS BlobBase
Definition UefiTcgPlatform.h:119
UINT64 BlobLength
Definition UefiTcgPlatform.h:120
Definition UefiTcgPlatform.h:156
EFI_GUID VariableName
Definition UefiTcgPlatform.h:157
UINTN UnicodeNameLength
Definition UefiTcgPlatform.h:158
UINTN VariableDataLength
Definition UefiTcgPlatform.h:159
INT8 VariableData[1]
Driver or platform-specific data.
Definition UefiTcgPlatform.h:161
CHAR16 UnicodeName[1]
Definition UefiTcgPlatform.h:160
Definition UefiTcgPlatform.h:317
UINT8 StartupLocality
Definition UefiTcgPlatform.h:322
UINT8 Signature[16]
Definition UefiTcgPlatform.h:318
Definition UefiTcgPlatform.h:212
TPML_DIGEST_VALUES Digests
Definition UefiTcgPlatform.h:215
TCG_PCRINDEX PCRIndex
Definition UefiTcgPlatform.h:213
TCG_EVENTTYPE EventType
Definition UefiTcgPlatform.h:214
UINT32 EventSize
Definition UefiTcgPlatform.h:216
Definition UefiTcgPlatform.h:200
TPML_DIGEST_VALUES Digest
Definition UefiTcgPlatform.h:203
UINT8 Event[1]
Definition UefiTcgPlatform.h:205
TCG_EVENTTYPE EventType
Definition UefiTcgPlatform.h:202
TCG_PCRINDEX PCRIndex
Definition UefiTcgPlatform.h:201
UINT32 EventSize
Definition UefiTcgPlatform.h:204
Definition UefiTcgPlatform.h:105
TCG_PCRINDEX PCRIndex
Definition UefiTcgPlatform.h:106
TCG_EVENTTYPE EventType
Definition UefiTcgPlatform.h:107
TCG_DIGEST Digest
Definition UefiTcgPlatform.h:108
UINT32 EventSize
Definition UefiTcgPlatform.h:109
Definition UefiTcgPlatform.h:92
UINT8 Event[1]
The event data.
Definition UefiTcgPlatform.h:97
UINT32 EventSize
Size of the event data.
Definition UefiTcgPlatform.h:96
TCG_DIGEST Digest
Value extended into PCRIndex.
Definition UefiTcgPlatform.h:95
TCG_EVENTTYPE EventType
TCG EFI event type.
Definition UefiTcgPlatform.h:94
TCG_PCRINDEX PCRIndex
PCRIndex event extended to.
Definition UefiTcgPlatform.h:93
Definition Tpm12.h:447
Definition UefiTcgPlatform.h:172
INT8 VariableData[1]
Driver or platform-specific data.
Definition UefiTcgPlatform.h:177
UINT64 UnicodeNameLength
Definition UefiTcgPlatform.h:174
EFI_GUID VariableName
Definition UefiTcgPlatform.h:173
CHAR16 UnicodeName[1]
Definition UefiTcgPlatform.h:176
UINT64 VariableDataLength
Definition UefiTcgPlatform.h:175