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