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