3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. 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
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.
18 EFI definition according to TCG_EFI_Platform_1_20_Final
20 See http://trustedcomputinggroup.org for latest specification updates
30 // The start of TPM return codes
32 #define TPM_BASE (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))
33 #include "IndustryStandard/Tpm12.h"
36 // Standard event types
38 #define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
39 #define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
40 #define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
41 #define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
44 // EFI specific event types
46 #define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
47 #define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
48 #define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
49 #define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
50 #define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
51 #define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
52 #define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
53 #define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
54 #define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
55 #define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
58 // Set structure alignment to 1-byte
60 #pragma pack (push, 1)
62 typedef UINT32 TCG_EVENTTYPE
;
64 #define TCG_DIGEST TPM_DIGEST
65 #define TCG_PCRINDEX TPM_PCRINDEX
70 typedef struct tdTCG_PCR_EVENT
{
71 TCG_PCRINDEX PCRIndex
; // PCRIndex event extended to
72 TCG_EVENTTYPE EventType
; // TCG EFI event type
73 TCG_DIGEST Digest
; // Value extended into PCRIndex
74 UINT32 EventSize
; // Size of the event data
75 UINT8 Event
[1]; // The event data
81 typedef struct tdTCG_PCR_EVENT_HDR
{
82 TCG_PCRINDEX PCRIndex
;
83 TCG_EVENTTYPE EventType
;
89 // EFI_PLATFORM_FIRMWARE_BLOB
91 // BlobLength should be of type UINTN but we use UINT64 here
92 // because PEI is 32-bit while DXE is 64-bit on x64 platforms
94 typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB
{
95 EFI_PHYSICAL_ADDRESS BlobBase
;
97 } EFI_PLATFORM_FIRMWARE_BLOB
;
100 // EFI_IMAGE_LOAD_EVENT
102 // This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
103 // EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
105 typedef struct tdEFI_IMAGE_LOAD_EVENT
{
106 EFI_PHYSICAL_ADDRESS ImageLocationInMemory
;
107 UINTN ImageLengthInMemory
;
108 UINTN ImageLinkTimeAddress
;
109 UINTN LengthOfDevicePath
;
110 EFI_DEVICE_PATH_PROTOCOL DevicePath
[1];
111 } EFI_IMAGE_LOAD_EVENT
;
114 // EFI_HANDOFF_TABLE_POINTERS
116 // This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
117 // the measurement of given configuration tables.
119 typedef struct tdEFI_HANDOFF_TABLE_POINTERS
{
120 UINTN NumberOfTables
;
121 EFI_CONFIGURATION_TABLE TableEntry
[1];
122 } EFI_HANDOFF_TABLE_POINTERS
;
127 // This structure serves as the header for measuring variables. The name of the
128 // variable (in Unicode format) should immediately follow, then the variable
131 typedef struct tdEFI_VARIABLE_DATA
{
132 EFI_GUID VariableName
;
133 UINTN UnicodeNameLength
;
134 UINTN VariableDataLength
;
135 CHAR16 UnicodeName
[1];
136 INT8 VariableData
[1]; // Driver or platform-specific data
140 // Restore original structure alignment
144 #endif // _EFI_TPM_H_