TianoCore EDK2 master
Loading...
Searching...
No Matches
TrEEProtocol.h
Go to the documentation of this file.
1
9#ifndef __TREE_H__
10#define __TREE_H__
11
14
15#define EFI_TREE_PROTOCOL_GUID \
16 {0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f}
17
19
20typedef struct _TREE_VERSION {
21 UINT8 Major;
22 UINT8 Minor;
24
25typedef UINT32 TREE_EVENT_LOG_BITMAP;
26typedef UINT32 TREE_EVENT_LOG_FORMAT;
27
28#define TREE_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
29
31 //
32 // Allocated size of the structure passed in
33 //
34 UINT8 Size;
35 //
36 // Version of the TREE_BOOT_SERVICE_CAPABILITY structure itself.
37 // For this version of the protocol, the Major version shall be set to 1
38 // and the Minor version shall be set to 0.
39 //
40 TREE_VERSION StructureVersion;
41 //
42 // Version of the TrEE protocol.
43 // For this version of the protocol, the Major version shall be set to 1
44 // and the Minor version shall be set to 0.
45 //
46 TREE_VERSION ProtocolVersion;
47 //
48 // Supported hash algorithms
49 //
50 UINT32 HashAlgorithmBitmap;
51 //
52 // Bitmap of supported event log formats
53 //
54 TREE_EVENT_LOG_BITMAP SupportedEventLogs;
55 //
56 // False = TrEE not present
57 //
58 BOOLEAN TrEEPresentFlag;
59 //
60 // Max size (in bytes) of a command that can be sent to the TrEE
61 //
62 UINT16 MaxCommandSize;
63 //
64 // Max size (in bytes) of a response that can be provided by the TrEE
65 //
66 UINT16 MaxResponseSize;
67 //
68 // 4-byte Vendor ID (see Trusted Computing Group, "TCG Vendor ID Registry,"
69 // Version 1.0, Revision 0.1, August 31, 2007, "TPM Capabilities Vendor ID" section)
70 //
71 UINT32 ManufacturerID;
73
75
76#define TREE_BOOT_HASH_ALG_SHA1 0x00000001
77#define TREE_BOOT_HASH_ALG_SHA256 0x00000002
78#define TREE_BOOT_HASH_ALG_SHA384 0x00000004
79#define TREE_BOOT_HASH_ALG_SHA512 0x00000008
80
81//
82// This bit is shall be set when an event shall be extended but not logged.
83//
84#define TREE_EXTEND_ONLY 0x0000000000000001
85//
86// This bit shall be set when the intent is to measure a PE/COFF image.
87//
88#define PE_COFF_IMAGE 0x0000000000000010
89
90typedef UINT32 TrEE_PCRINDEX;
91typedef UINT32 TrEE_EVENTTYPE;
92
93#define MAX_PCR_INDEX 23
94#define TREE_EVENT_HEADER_VERSION 1
95
96#pragma pack(1)
97
98typedef struct {
99 //
100 // Size of the event header itself (sizeof(TrEE_EVENT_HEADER)).
101 //
102 UINT32 HeaderSize;
103 //
104 // Header version. For this version of this specification, the value shall be 1.
105 //
106 UINT16 HeaderVersion;
107 //
108 // Index of the PCR that shall be extended (0 - 23).
109 //
110 TrEE_PCRINDEX PCRIndex;
111 //
112 // Type of the event that shall be extended (and optionally logged).
113 //
114 TrEE_EVENTTYPE EventType;
116
117typedef struct {
118 //
119 // Total size of the event including the Size component, the header and the Event data.
120 //
121 UINT32 Size;
122 TrEE_EVENT_HEADER Header;
123 UINT8 Event[1];
124} TrEE_EVENT;
125
126#pragma pack()
127
147typedef
150 IN EFI_TREE_PROTOCOL *This,
151 IN OUT TREE_BOOT_SERVICE_CAPABILITY *ProtocolCapability
152 );
153
171typedef
173(EFIAPI *EFI_TREE_GET_EVENT_LOG)(
174 IN EFI_TREE_PROTOCOL *This,
175 IN TREE_EVENT_LOG_FORMAT EventLogFormat,
176 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
177 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry,
178 OUT BOOLEAN *EventLogTruncated
179 );
180
200typedef
203 IN EFI_TREE_PROTOCOL *This,
204 IN UINT64 Flags,
205 IN EFI_PHYSICAL_ADDRESS DataToHash,
206 IN UINT64 DataToHashLen,
207 IN TrEE_EVENT *Event
208 );
209
224typedef
227 IN EFI_TREE_PROTOCOL *This,
228 IN UINT32 InputParameterBlockSize,
229 IN UINT8 *InputParameterBlock,
230 IN UINT32 OutputParameterBlockSize,
231 IN UINT8 *OutputParameterBlock
232 );
233
235 EFI_TREE_GET_CAPABILITY GetCapability;
236 EFI_TREE_GET_EVENT_LOG GetEventLog;
237 EFI_TREE_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
238 EFI_TREE_SUBMIT_COMMAND SubmitCommand;
239};
240
241extern EFI_GUID gEfiTrEEProtocolGuid;
242
243#endif
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_TREE_HASH_LOG_EXTEND_EVENT)(IN EFI_TREE_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN TrEE_EVENT *Event)
Definition: TrEEProtocol.h:202
EFI_STATUS(EFIAPI * EFI_TREE_GET_CAPABILITY)(IN EFI_TREE_PROTOCOL *This, IN OUT TREE_BOOT_SERVICE_CAPABILITY *ProtocolCapability)
Definition: TrEEProtocol.h:149
EFI_STATUS(EFIAPI * EFI_TREE_SUBMIT_COMMAND)(IN EFI_TREE_PROTOCOL *This, IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN UINT32 OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition: TrEEProtocol.h:226
EFI_STATUS(EFIAPI * EFI_TREE_GET_EVENT_LOG)(IN EFI_TREE_PROTOCOL *This, IN TREE_EVENT_LOG_FORMAT EventLogFormat, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry, OUT BOOLEAN *EventLogTruncated)
Definition: TrEEProtocol.h:173
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213