]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
Added SMBIOS 2.8.0 updates.
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / UefiTcgPlatform.h
CommitLineData
c311f86b 1/** @file\r
267669ba
LG
2 TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final\r
3\r
04a89420 4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
9df063a0 5 This program and the accompanying materials\r
267669ba
LG
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __UEFI_TCG_PLATFORM_H__\r
22a25d24 16#define __UEFI_TCG_PLATFORM_H__\r
267669ba
LG
17\r
18#include <IndustryStandard/Tpm12.h>\r
a979fca9 19#include <Uefi.h>\r
1fd83dd2 20\r
267669ba
LG
21//\r
22// Standard event types\r
23//\r
24#define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)\r
25#define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)\r
26#define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)\r
27#define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)\r
04a89420 28#define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009)\r
f5a859d6 29#define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B)\r
267669ba
LG
30\r
31//\r
32// EFI specific event types\r
33//\r
34#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)\r
35#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)\r
36#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)\r
37#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)\r
38#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)\r
39#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)\r
40#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)\r
41#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)\r
42#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)\r
43#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)\r
44\r
267669ba
LG
45#define EFI_CALLING_EFI_APPLICATION \\r
46 "Calling EFI Application from Boot Option"\r
47#define EFI_RETURNING_FROM_EFI_APPLICATOIN \\r
48 "Returning from EFI Application from Boot Option"\r
49#define EFI_EXIT_BOOT_SERVICES_INVOCATION \\r
50 "Exit Boot Services Invocation"\r
51#define EFI_EXIT_BOOT_SERVICES_FAILED \\r
52 "Exit Boot Services Returned with Failure"\r
53#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \\r
54 "Exit Boot Services Returned with Success"\r
55\r
2096185d 56\r
57#define EV_POSTCODE_INFO_POST_CODE "POST CODE"\r
58#define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1)\r
59\r
60#define EV_POSTCODE_INFO_SMM_CODE "SMM CODE"\r
61#define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1)\r
62\r
63#define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA"\r
64#define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1)\r
65\r
66#define EV_POSTCODE_INFO_BIS_CODE "BIS CODE"\r
67#define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1)\r
68\r
69#define EV_POSTCODE_INFO_UEFI_PI "UEFI PI"\r
70#define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1)\r
71\r
72#define EV_POSTCODE_INFO_OPROM "Embedded Option ROM"\r
73#define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1)\r
74\r
267669ba
LG
75//\r
76// Set structure alignment to 1-byte\r
77//\r
a04ad3f0 78#pragma pack (1)\r
267669ba
LG
79\r
80typedef UINT32 TCG_EVENTTYPE;\r
992f22b9
LG
81typedef TPM_PCRINDEX TCG_PCRINDEX;\r
82typedef TPM_DIGEST TCG_DIGEST;\r
fb5148a0 83///\r
3ed785e9 84/// Event Log Entry Structure Definition\r
fb5148a0 85///\r
267669ba 86typedef struct tdTCG_PCR_EVENT {\r
3ed785e9 87 TCG_PCRINDEX PCRIndex; ///< PCRIndex event extended to\r
88 TCG_EVENTTYPE EventType; ///< TCG EFI event type\r
89 TCG_DIGEST Digest; ///< Value extended into PCRIndex\r
90 UINT32 EventSize; ///< Size of the event data\r
91 UINT8 Event[1]; ///< The event data\r
267669ba
LG
92} TCG_PCR_EVENT;\r
93\r
3ed785e9 94#define TSS_EVENT_DATA_MAX_SIZE 256\r
95\r
fb5148a0 96///\r
97/// TCG_PCR_EVENT_HDR\r
98///\r
267669ba
LG
99typedef struct tdTCG_PCR_EVENT_HDR {\r
100 TCG_PCRINDEX PCRIndex;\r
101 TCG_EVENTTYPE EventType;\r
102 TCG_DIGEST Digest;\r
103 UINT32 EventSize;\r
104} TCG_PCR_EVENT_HDR;\r
105\r
fb5148a0 106///\r
107/// EFI_PLATFORM_FIRMWARE_BLOB\r
108///\r
109/// BlobLength should be of type UINTN but we use UINT64 here\r
110/// because PEI is 32-bit while DXE is 64-bit on x64 platforms\r
111///\r
267669ba
LG
112typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB {\r
113 EFI_PHYSICAL_ADDRESS BlobBase;\r
114 UINT64 BlobLength;\r
115} EFI_PLATFORM_FIRMWARE_BLOB;\r
116\r
fb5148a0 117///\r
118/// EFI_IMAGE_LOAD_EVENT\r
119///\r
120/// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,\r
121/// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER\r
122///\r
267669ba
LG
123typedef struct tdEFI_IMAGE_LOAD_EVENT {\r
124 EFI_PHYSICAL_ADDRESS ImageLocationInMemory;\r
125 UINTN ImageLengthInMemory;\r
126 UINTN ImageLinkTimeAddress;\r
127 UINTN LengthOfDevicePath;\r
128 EFI_DEVICE_PATH_PROTOCOL DevicePath[1];\r
129} EFI_IMAGE_LOAD_EVENT;\r
130\r
fb5148a0 131///\r
132/// EFI_HANDOFF_TABLE_POINTERS\r
133///\r
134/// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate\r
135/// the measurement of given configuration tables.\r
136///\r
267669ba 137typedef struct tdEFI_HANDOFF_TABLE_POINTERS {\r
3ed785e9 138 UINTN NumberOfTables;\r
267669ba
LG
139 EFI_CONFIGURATION_TABLE TableEntry[1];\r
140} EFI_HANDOFF_TABLE_POINTERS;\r
141\r
fb5148a0 142///\r
143/// EFI_VARIABLE_DATA\r
144///\r
145/// This structure serves as the header for measuring variables. The name of the\r
146/// variable (in Unicode format) should immediately follow, then the variable\r
147/// data.\r
148///\r
267669ba
LG
149typedef struct tdEFI_VARIABLE_DATA {\r
150 EFI_GUID VariableName;\r
151 UINTN UnicodeNameLength;\r
152 UINTN VariableDataLength;\r
153 CHAR16 UnicodeName[1];\r
3ed785e9 154 INT8 VariableData[1]; ///< Driver or platform-specific data\r
267669ba
LG
155} EFI_VARIABLE_DATA;\r
156\r
157typedef struct tdEFI_GPT_DATA {\r
158 EFI_PARTITION_TABLE_HEADER EfiPartitionHeader;\r
159 UINTN NumberOfPartitions; \r
160 EFI_PARTITION_ENTRY Partitions[1];\r
161} EFI_GPT_DATA;\r
162\r
163//\r
164// Restore original structure alignment\r
165//\r
a04ad3f0 166#pragma pack ()\r
267669ba
LG
167\r
168#endif\r
169\r
170\r