]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
Enhance the check for resource section data.
[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
267669ba
LG
29\r
30//\r
31// EFI specific event types\r
32//\r
33#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)\r
34#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)\r
35#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)\r
36#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)\r
37#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)\r
38#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)\r
39#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)\r
40#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)\r
41#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)\r
42#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)\r
43\r
267669ba
LG
44#define EFI_CALLING_EFI_APPLICATION \\r
45 "Calling EFI Application from Boot Option"\r
46#define EFI_RETURNING_FROM_EFI_APPLICATOIN \\r
47 "Returning from EFI Application from Boot Option"\r
48#define EFI_EXIT_BOOT_SERVICES_INVOCATION \\r
49 "Exit Boot Services Invocation"\r
50#define EFI_EXIT_BOOT_SERVICES_FAILED \\r
51 "Exit Boot Services Returned with Failure"\r
52#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \\r
53 "Exit Boot Services Returned with Success"\r
54\r
55//\r
56// Set structure alignment to 1-byte\r
57//\r
a04ad3f0 58#pragma pack (1)\r
267669ba
LG
59\r
60typedef UINT32 TCG_EVENTTYPE;\r
992f22b9
LG
61typedef TPM_PCRINDEX TCG_PCRINDEX;\r
62typedef TPM_DIGEST TCG_DIGEST;\r
fb5148a0 63///\r
3ed785e9 64/// Event Log Entry Structure Definition\r
fb5148a0 65///\r
267669ba 66typedef struct tdTCG_PCR_EVENT {\r
3ed785e9 67 TCG_PCRINDEX PCRIndex; ///< PCRIndex event extended to\r
68 TCG_EVENTTYPE EventType; ///< TCG EFI event type\r
69 TCG_DIGEST Digest; ///< Value extended into PCRIndex\r
70 UINT32 EventSize; ///< Size of the event data\r
71 UINT8 Event[1]; ///< The event data\r
267669ba
LG
72} TCG_PCR_EVENT;\r
73\r
3ed785e9 74#define TSS_EVENT_DATA_MAX_SIZE 256\r
75\r
fb5148a0 76///\r
77/// TCG_PCR_EVENT_HDR\r
78///\r
267669ba
LG
79typedef struct tdTCG_PCR_EVENT_HDR {\r
80 TCG_PCRINDEX PCRIndex;\r
81 TCG_EVENTTYPE EventType;\r
82 TCG_DIGEST Digest;\r
83 UINT32 EventSize;\r
84} TCG_PCR_EVENT_HDR;\r
85\r
fb5148a0 86///\r
87/// EFI_PLATFORM_FIRMWARE_BLOB\r
88///\r
89/// BlobLength should be of type UINTN but we use UINT64 here\r
90/// because PEI is 32-bit while DXE is 64-bit on x64 platforms\r
91///\r
267669ba
LG
92typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB {\r
93 EFI_PHYSICAL_ADDRESS BlobBase;\r
94 UINT64 BlobLength;\r
95} EFI_PLATFORM_FIRMWARE_BLOB;\r
96\r
fb5148a0 97///\r
98/// EFI_IMAGE_LOAD_EVENT\r
99///\r
100/// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,\r
101/// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER\r
102///\r
267669ba
LG
103typedef struct tdEFI_IMAGE_LOAD_EVENT {\r
104 EFI_PHYSICAL_ADDRESS ImageLocationInMemory;\r
105 UINTN ImageLengthInMemory;\r
106 UINTN ImageLinkTimeAddress;\r
107 UINTN LengthOfDevicePath;\r
108 EFI_DEVICE_PATH_PROTOCOL DevicePath[1];\r
109} EFI_IMAGE_LOAD_EVENT;\r
110\r
fb5148a0 111///\r
112/// EFI_HANDOFF_TABLE_POINTERS\r
113///\r
114/// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate\r
115/// the measurement of given configuration tables.\r
116///\r
267669ba 117typedef struct tdEFI_HANDOFF_TABLE_POINTERS {\r
3ed785e9 118 UINTN NumberOfTables;\r
267669ba
LG
119 EFI_CONFIGURATION_TABLE TableEntry[1];\r
120} EFI_HANDOFF_TABLE_POINTERS;\r
121\r
fb5148a0 122///\r
123/// EFI_VARIABLE_DATA\r
124///\r
125/// This structure serves as the header for measuring variables. The name of the\r
126/// variable (in Unicode format) should immediately follow, then the variable\r
127/// data.\r
128///\r
267669ba
LG
129typedef struct tdEFI_VARIABLE_DATA {\r
130 EFI_GUID VariableName;\r
131 UINTN UnicodeNameLength;\r
132 UINTN VariableDataLength;\r
133 CHAR16 UnicodeName[1];\r
3ed785e9 134 INT8 VariableData[1]; ///< Driver or platform-specific data\r
267669ba
LG
135} EFI_VARIABLE_DATA;\r
136\r
137typedef struct tdEFI_GPT_DATA {\r
138 EFI_PARTITION_TABLE_HEADER EfiPartitionHeader;\r
139 UINTN NumberOfPartitions; \r
140 EFI_PARTITION_ENTRY Partitions[1];\r
141} EFI_GPT_DATA;\r
142\r
143//\r
144// Restore original structure alignment\r
145//\r
a04ad3f0 146#pragma pack ()\r
267669ba
LG
147\r
148#endif\r
149\r
150\r