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