]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Include/EfiTpm.h
Change TPM_BASE to 0 per TPM spec.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Include / EfiTpm.h
1 /*++
2
3 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 EfiTpm.h
15
16 Abstract:
17
18 EFI definition according to TCG_EFI_Platform_1_20_Final
19
20 See http://trustedcomputinggroup.org for latest specification updates
21
22 --*/
23
24 #ifndef _EFI_TPM_H_
25 #define _EFI_TPM_H_
26
27 #include "Tiano.h"
28 #include "IndustryStandard/Tpm12.h"
29
30 //
31 // Standard event types
32 //
33 #define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
34 #define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
35 #define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
36 #define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
37
38 //
39 // EFI specific event types
40 //
41 #define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
42 #define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
43 #define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
44 #define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
45 #define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
46 #define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
47 #define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
48 #define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
49 #define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
50 #define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
51
52 //
53 // Set structure alignment to 1-byte
54 //
55 #pragma pack (1)
56
57 typedef UINT32 TCG_EVENTTYPE;
58
59 #define TCG_DIGEST TPM_DIGEST
60 #define TCG_PCRINDEX TPM_PCRINDEX
61
62 //
63 // TCG_PCR_EVENT
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 //
74 // TCG_PCR_EVENT_HDR
75 //
76 typedef struct tdTCG_PCR_EVENT_HDR {
77 TCG_PCRINDEX PCRIndex;
78 TCG_EVENTTYPE EventType;
79 TCG_DIGEST Digest;
80 UINT32 EventSize;
81 } TCG_PCR_EVENT_HDR;
82
83 //
84 // EFI_PLATFORM_FIRMWARE_BLOB
85 //
86 // BlobLength should be of type UINTN but we use UINT64 here
87 // because PEI is 32-bit while DXE is 64-bit on x64 platforms
88 //
89 typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB {
90 EFI_PHYSICAL_ADDRESS BlobBase;
91 UINT64 BlobLength;
92 } EFI_PLATFORM_FIRMWARE_BLOB;
93
94 //
95 // EFI_IMAGE_LOAD_EVENT
96 //
97 // This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
98 // EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
99 //
100 typedef struct tdEFI_IMAGE_LOAD_EVENT {
101 EFI_PHYSICAL_ADDRESS ImageLocationInMemory;
102 UINTN ImageLengthInMemory;
103 UINTN ImageLinkTimeAddress;
104 UINTN LengthOfDevicePath;
105 EFI_DEVICE_PATH_PROTOCOL DevicePath[1];
106 } EFI_IMAGE_LOAD_EVENT;
107
108 //
109 // EFI_HANDOFF_TABLE_POINTERS
110 //
111 // This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
112 // the measurement of given configuration tables.
113 //
114 typedef struct tdEFI_HANDOFF_TABLE_POINTERS {
115 UINTN NumberOfTables;
116 EFI_CONFIGURATION_TABLE TableEntry[1];
117 } EFI_HANDOFF_TABLE_POINTERS;
118
119 //
120 // EFI_VARIABLE_DATA
121 //
122 // This structure serves as the header for measuring variables. The name of the
123 // variable (in Unicode format) should immediately follow, then the variable
124 // data.
125 //
126 typedef struct tdEFI_VARIABLE_DATA {
127 EFI_GUID VariableName;
128 UINTN UnicodeNameLength;
129 UINTN VariableDataLength;
130 CHAR16 UnicodeName[1];
131 INT8 VariableData[1]; // Driver or platform-specific data
132 } EFI_VARIABLE_DATA;
133
134 //
135 // Restore original structure alignment
136 //
137 #pragma pack ()
138
139 #endif // _EFI_TPM_H_