]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Include/Protocol/DataHub.h
1. Removed the unnecessary #include statements and include files
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Protocol / DataHub.h
CommitLineData
21b50a27 1/** @file\r
2 The data hub protocol is used both by agents wishing to log\r
3 data and those wishing to be made aware of all information that\r
4 has been logged.\r
5\r
6 For more information please look at Intel Platform Innovation \r
7 Framework for EFI Data Hub Specification.\r
8\r
9 Copyright (c) 2006, Intel Corporation \r
10 All rights reserved. This program and the accompanying materials \r
11 are licensed and made available under the terms and conditions of the BSD License \r
12 which accompanies this distribution. The full text of the license may be found at \r
13 http://opensource.org/licenses/bsd-license.php \r
14\r
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
17\r
18 Module Name: DataHub.h\r
19\r
20 @par Revision Reference:\r
21 This protocol is defined in Framework for EFI Data Hub Specification.\r
22 Version 0.9.\r
23\r
24**/\r
25\r
26#ifndef __DATA_HUB_H__\r
27#define __DATA_HUB_H__\r
28\r
29#define EFI_DATA_HUB_PROTOCOL_GUID \\r
30 { \\r
31 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
32 }\r
33\r
34//\r
35// EFI generic Data Hub Header\r
36//\r
37// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
38// data. The format of the data is defined by the DataRecordGuid.\r
39//\r
40// If EFI_DATA_RECORD_HEADER is extended in the future the Version number must\r
41// change and the HeaderSize will change if the definition of\r
42// EFI_DATA_RECORD_HEADER is extended.\r
43//\r
44// The logger is responcible for initializing:\r
45// Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
46//\r
47// The Data Hub driver is responcible for initializing:\r
48// LogTime and LogMonotonicCount.\r
49//\r
50#define EFI_DATA_RECORD_HEADER_VERSION 0x0100\r
51typedef struct {\r
52 UINT16 Version;\r
53 UINT16 HeaderSize;\r
54 UINT32 RecordSize;\r
55 EFI_GUID DataRecordGuid;\r
56 EFI_GUID ProducerName;\r
57 UINT64 DataRecordClass;\r
58 EFI_TIME LogTime;\r
59 UINT64 LogMonotonicCount;\r
60} EFI_DATA_RECORD_HEADER;\r
61\r
62//\r
63// Definition of DataRecordClass. These are used to filter out class types\r
64// at a very high level. The DataRecordGuid still defines the format of\r
65// the data. See DateHub.doc for rules on what can and can not be a\r
66// new DataRecordClass\r
67//\r
68#define EFI_DATA_RECORD_CLASS_DEBUG 0x0000000000000001\r
69#define EFI_DATA_RECORD_CLASS_ERROR 0x0000000000000002\r
70#define EFI_DATA_RECORD_CLASS_DATA 0x0000000000000004\r
71#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
72\r
73//\r
74// Forward reference for pure ANSI compatability\r
75//\r
76typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
77\r
78/**\r
79 Logs a data record to the system event log.\r
80\r
81 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
82 \r
83 @param description\r
84 \r
85 @param DataRecordGuid A GUID that indicates the format of the data passed into RawData.\r
86 \r
87 @param ProducerName A GUID that indicates the identity of the caller to this API.\r
88 \r
89 @param DataRecordClass This class indicates the generic type of the data record. \r
90 \r
91 @param RawData The DataRecordGuid-defined data to be logged.\r
92 \r
93 @param RawDataSize The size in bytes of RawData.\r
94\r
95 @retval EFI_SUCCESS Data was logged.\r
96 \r
97 @retval EFI_OUT_OF_RESOURCES Data was not logged due to lack of system resources.\r
98\r
99**/\r
100typedef\r
101EFI_STATUS\r
102(EFIAPI *EFI_DATA_HUB_LOG_DATA) (\r
103 IN EFI_DATA_HUB_PROTOCOL *This,\r
104 IN EFI_GUID *DataRecordGuid,\r
105 IN EFI_GUID *ProducerName,\r
106 IN UINT64 DataRecordClass,\r
107 IN VOID *RawData,\r
108 IN UINT32 RawDataSize\r
109 );\r
110\r
111/**\r
112 Allows the system data log to be searched.\r
113\r
114 @param This The EFI_DATA_HUB_PROTOCOL instance. \r
115 \r
116 @param MonotonicCount On input, it specifies the Record to return. \r
117 An input of zero means to return the first record.\r
118 \r
119 @param FilterDriver If FilterDriver is not passed in a MonotonicCount of zero, \r
120 it means to return the first data record. If FilterDriver is passed in, \r
121 then a MonotonicCount of zero means to return the first data not yet read \r
122 by FilterDriver.\r
123 \r
124 @param Record Returns a dynamically allocated memory buffer with a data \r
125 record that matches MonotonicCount.\r
126\r
127 @retval EFI_SUCCESS Data was returned in Record.\r
128 \r
129 @retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.\r
130 \r
131 @retval EFI_NOT_FOUND MonotonicCount does not match any data record \r
132 in the system. If a MonotonicCount of zero was passed in, then no \r
133 data records exist in the system.\r
134 \r
135 @retval EFI_OUT_OF_RESOURCES Record was not returned due to lack \r
136 of system resources.\r
137\r
138**/\r
139typedef\r
140EFI_STATUS\r
141(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD) (\r
142 IN EFI_DATA_HUB_PROTOCOL *This,\r
143 IN OUT UINT64 *MonotonicCount,\r
144 IN EFI_EVENT *FilterDriver OPTIONAL,\r
145 OUT EFI_DATA_RECORD_HEADER **Record\r
146 );\r
147\r
148/**\r
149 Registers an event to be signaled every time a data record is logged in the system.\r
150\r
151 @param This The EFI_DATA_HUB_PROTOCOL instance. \r
152 \r
153 @param FilterEvent The EFI_EVENT to signal whenever data that matches \r
154 FilterClass is logged in the system. \r
155 \r
156 @param FilterTpl The maximum EFI_TPL at which FilterEvent can be signaled.\r
157 It is strongly recommended that you use the lowest EFI_TPL possible. \r
158 \r
159 @param FilterClass FilterEvent will be signaled whenever a bit \r
160 in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass. \r
161 If FilterClass is zero, no class-based filtering will be performed. \r
162 \r
163 @param FilterDataRecordGuid FilterEvent will be signaled whenever \r
164 FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid. \r
165 If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed. \r
166\r
167 @retval EFI_SUCCESS The filter driver event was registered\r
168 \r
169 @retval EFI_ALREADY_STARTED FilterEvent was previously registered and cannot be registered again.\r
170 \r
171 @retval EFI_OUT_OF_RESOURCES The filter driver event was not registered\r
172 due to lack of system resources.\r
173\r
174**/\r
175typedef\r
176EFI_STATUS\r
177(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER) (\r
178 IN EFI_DATA_HUB_PROTOCOL *This,\r
179 IN EFI_EVENT FilterEvent,\r
180 IN EFI_TPL FilterTpl,\r
181 IN UINT64 FilterClass,\r
182 IN EFI_GUID *FilterDataRecordGuid OPTIONAL\r
183 );\r
184\r
185/**\r
186 Stops a filter driver from being notified when data records are logged.\r
187\r
188 @param This The EFI_DATA_HUB_PROTOCOL instance. \r
189 \r
190 @param FilterEvent The EFI_EVENT to remove from the list of events to be \r
191 signaled every time errors are logged.\r
192\r
193 @retval EFI_SUCCESS The filter driver represented by FilterEvent was shut off.\r
194 \r
195 @retval EFI_NOT_FOUND FilterEvent did not exist.\r
196\r
197**/\r
198typedef\r
199EFI_STATUS\r
200(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER) (\r
201 IN EFI_DATA_HUB_PROTOCOL *This,\r
202 IN EFI_EVENT FilterEvent\r
203 );\r
204\r
205/**\r
206 @par Protocol Description:\r
207 This protocol is used to log information and register filter drivers \r
208 to receive data records.\r
209\r
210 @param LogData\r
211 Logs a data record. \r
212\r
213 @param GetNextDataRecord\r
214 Gets a data record. Used both to view the memory-based log and to \r
215 get information about which data records have been consumed by a filter driver.\r
216\r
217 @param RegisterFilterDriver\r
218 Allows the registration of an EFI event to act as a filter driver for all data records that are logged. \r
219\r
220 @param UnregisterFilterDriver\r
221 Used to remove a filter driver that was added with RegisterFilterDriver(). \r
222\r
223**/\r
224struct _EFI_DATA_HUB_PROTOCOL {\r
225 EFI_DATA_HUB_LOG_DATA LogData;\r
226 EFI_DATA_HUB_GET_NEXT_RECORD GetNextRecord;\r
227 EFI_DATA_HUB_REGISTER_FILTER_DRIVER RegisterFilterDriver;\r
228 EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
229};\r
230\r
231extern EFI_GUID gEfiDataHubProtocolGuid;\r
232\r
233#endif\r