]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Uefi/UefiTcgPlatform.h
Fix build error
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiTcgPlatform.h
CommitLineData
c311f86b 1/** @file\r
2 \r
267669ba
LG
3 TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final\r
4\r
5 Copyright (c) 2006 - 2007, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __UEFI_TCG_PLATFORM_H__\r
17#define __UEFI_TCG_PLATFOMR_H__\r
18\r
19#include <IndustryStandard/Tpm12.h>\r
20#include <Uefi.h>\r
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
28\r
29//\r
30// EFI specific event types\r
31//\r
32#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)\r
33#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)\r
34#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)\r
35#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)\r
36#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)\r
37#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)\r
38#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)\r
39#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)\r
40#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)\r
41#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)\r
42\r
43#define TSS_EVENT_DATA_MAX_SIZE 256\r
44\r
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
56//\r
57// Set structure alignment to 1-byte\r
58//\r
59#pragma pack (push, 1)\r
60\r
61typedef UINT32 TCG_EVENTTYPE;\r
62\r
63#define TCG_DIGEST TPM_DIGEST\r
64#define TCG_PCRINDEX TPM_PCRINDEX\r
65\r
fb5148a0 66///\r
67/// TCG_PCR_EVENT\r
68///\r
267669ba
LG
69typedef struct tdTCG_PCR_EVENT {\r
70 TCG_PCRINDEX PCRIndex; // PCRIndex event extended to\r
71 TCG_EVENTTYPE EventType; // TCG EFI event type\r
72 TCG_DIGEST Digest; // Value extended into PCRIndex\r
73 UINT32 EventSize; // Size of the event data\r
74 UINT8 Event[1]; // The event data\r
75} TCG_PCR_EVENT;\r
76\r
fb5148a0 77///\r
78/// TCG_PCR_EVENT_HDR\r
79///\r
267669ba
LG
80typedef struct tdTCG_PCR_EVENT_HDR {\r
81 TCG_PCRINDEX PCRIndex;\r
82 TCG_EVENTTYPE EventType;\r
83 TCG_DIGEST Digest;\r
84 UINT32 EventSize;\r
85} TCG_PCR_EVENT_HDR;\r
86\r
fb5148a0 87///\r
88/// EFI_PLATFORM_FIRMWARE_BLOB\r
89///\r
90/// BlobLength should be of type UINTN but we use UINT64 here\r
91/// because PEI is 32-bit while DXE is 64-bit on x64 platforms\r
92///\r
267669ba
LG
93typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB {\r
94 EFI_PHYSICAL_ADDRESS BlobBase;\r
95 UINT64 BlobLength;\r
96} EFI_PLATFORM_FIRMWARE_BLOB;\r
97\r
fb5148a0 98///\r
99/// EFI_IMAGE_LOAD_EVENT\r
100///\r
101/// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,\r
102/// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER\r
103///\r
267669ba
LG
104typedef struct tdEFI_IMAGE_LOAD_EVENT {\r
105 EFI_PHYSICAL_ADDRESS ImageLocationInMemory;\r
106 UINTN ImageLengthInMemory;\r
107 UINTN ImageLinkTimeAddress;\r
108 UINTN LengthOfDevicePath;\r
109 EFI_DEVICE_PATH_PROTOCOL DevicePath[1];\r
110} EFI_IMAGE_LOAD_EVENT;\r
111\r
fb5148a0 112///\r
113/// EFI_HANDOFF_TABLE_POINTERS\r
114///\r
115/// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate\r
116/// the measurement of given configuration tables.\r
117///\r
267669ba
LG
118typedef struct tdEFI_HANDOFF_TABLE_POINTERS {\r
119 UINTN NumberOfTables;\r
120 EFI_CONFIGURATION_TABLE TableEntry[1];\r
121} EFI_HANDOFF_TABLE_POINTERS;\r
122\r
fb5148a0 123///\r
124/// EFI_VARIABLE_DATA\r
125///\r
126/// This structure serves as the header for measuring variables. The name of the\r
127/// variable (in Unicode format) should immediately follow, then the variable\r
128/// data.\r
129///\r
267669ba
LG
130typedef struct tdEFI_VARIABLE_DATA {\r
131 EFI_GUID VariableName;\r
132 UINTN UnicodeNameLength;\r
133 UINTN VariableDataLength;\r
134 CHAR16 UnicodeName[1];\r
135 INT8 VariableData[1]; // Driver or platform-specific data\r
136} EFI_VARIABLE_DATA;\r
137\r
138typedef struct tdEFI_GPT_DATA {\r
139 EFI_PARTITION_TABLE_HEADER EfiPartitionHeader;\r
140 UINTN NumberOfPartitions; \r
141 EFI_PARTITION_ENTRY Partitions[1];\r
142} EFI_GPT_DATA;\r
143\r
144//\r
145// Restore original structure alignment\r
146//\r
147#pragma pack (pop)\r
148\r
149#endif\r
150\r
151\r