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