]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/DataHub.h
add UefiPxeBcDxe in Nt32 platform.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / DataHub.h
CommitLineData
79964ac8 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
79964ac8 6 This protocol is defined in Framework for EFI Data Hub Specification.\r
7 Version 0.9.\r
8\r
87d63447 9 Copyright (c) 2007 - 2009, 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
736e104f 14\r
87d63447 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
736e104f 17\r
79964ac8 18**/\r
19\r
d2be628f 20#ifndef __DATA_HUB_H__\r
21#define __DATA_HUB_H__\r
79964ac8 22\r
23#define EFI_DATA_HUB_PROTOCOL_GUID \\r
24 { \\r
25 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
26 }\r
27\r
28//\r
29// EFI generic Data Hub Header\r
30//\r
31// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
32// data. The format of the data is defined by the DataRecordGuid.\r
33//\r
5259c97d 34// If EFI_DATA_RECORD_HEADER is extended in the future, the Version number and HeaderSize must\r
35// change. \r
79964ac8 36//\r
37// The logger is responcible for initializing:\r
38// Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
39//\r
40// The Data Hub driver is responcible for initializing:\r
41// LogTime and LogMonotonicCount.\r
42//\r
43#define EFI_DATA_RECORD_HEADER_VERSION 0x0100\r
44typedef struct {\r
45 UINT16 Version;\r
46 UINT16 HeaderSize;\r
47 UINT32 RecordSize;\r
48 EFI_GUID DataRecordGuid;\r
49 EFI_GUID ProducerName;\r
50 UINT64 DataRecordClass;\r
51 EFI_TIME LogTime;\r
52 UINT64 LogMonotonicCount;\r
53} EFI_DATA_RECORD_HEADER;\r
54\r
55//\r
56// Definition of DataRecordClass. These are used to filter out class types\r
57// at a very high level. The DataRecordGuid still defines the format of\r
5259c97d 58// the data. See the Data Hub Specification for rules on what can and can not be a\r
79964ac8 59// new DataRecordClass\r
60//\r
61#define EFI_DATA_RECORD_CLASS_DEBUG 0x0000000000000001\r
62#define EFI_DATA_RECORD_CLASS_ERROR 0x0000000000000002\r
63#define EFI_DATA_RECORD_CLASS_DATA 0x0000000000000004\r
64#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
65\r
66//\r
67// Forward reference for pure ANSI compatability\r
68//\r
69typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
70\r
71/**\r
72 Logs a data record to the system event log.\r
73\r
74 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
79964ac8 75 @param DataRecordGuid A GUID that indicates the format of the data passed into RawData.\r
76 @param ProducerName A GUID that indicates the identity of the caller to this API.\r
77 @param DataRecordClass This class indicates the generic type of the data record.\r
78 @param RawData The DataRecordGuid-defined data to be logged.\r
79 @param RawDataSize The size in bytes of RawData.\r
80\r
81 @retval EFI_SUCCESS Data was logged.\r
82 @retval EFI_OUT_OF_RESOURCES Data was not logged due to lack of system resources.\r
83\r
84**/\r
85typedef\r
86EFI_STATUS\r
69686d56 87(EFIAPI *EFI_DATA_HUB_LOG_DATA)(\r
79964ac8 88 IN EFI_DATA_HUB_PROTOCOL *This,\r
89 IN EFI_GUID *DataRecordGuid,\r
90 IN EFI_GUID *ProducerName,\r
91 IN UINT64 DataRecordClass,\r
92 IN VOID *RawData,\r
93 IN UINT32 RawDataSize\r
94 );\r
95\r
96/**\r
97 Allows the system data log to be searched.\r
98\r
99 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
100 @param MonotonicCount On input, it specifies the Record to return.\r
5259c97d 101 An input of zero means to return the first record, as does an input of one.\r
79964ac8 102 @param FilterDriver If FilterDriver is not passed in a MonotonicCount of zero,\r
103 it means to return the first data record. If FilterDriver is passed in,\r
104 then a MonotonicCount of zero means to return the first data not yet read\r
105 by FilterDriver.\r
106 @param Record Returns a dynamically allocated memory buffer with a data\r
107 record that matches MonotonicCount.\r
108\r
109 @retval EFI_SUCCESS Data was returned in Record.\r
110 @retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.\r
111 @retval EFI_NOT_FOUND MonotonicCount does not match any data record\r
112 in the system. If a MonotonicCount of zero was passed in, then no\r
113 data records exist in the system.\r
114 @retval EFI_OUT_OF_RESOURCES Record was not returned due to lack\r
115 of system resources.\r
e8998550 116 @note: Inconsistent with specification here: \r
5259c97d 117 In Framework for EFI Data Hub Specification, Version 0.9, This definition is named as\r
118 EFI_DATA_HUB_GET_NEXT_DATA_RECORD. The inconsistency is maintained for backward compatibility. \r
79964ac8 119**/\r
120typedef\r
121EFI_STATUS\r
69686d56 122(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD)(\r
79964ac8 123 IN EFI_DATA_HUB_PROTOCOL *This,\r
124 IN OUT UINT64 *MonotonicCount,\r
125 IN EFI_EVENT *FilterDriver OPTIONAL,\r
126 OUT EFI_DATA_RECORD_HEADER **Record\r
127 );\r
128\r
129/**\r
130 Registers an event to be signaled every time a data record is logged in the system.\r
131\r
132 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
133 @param FilterEvent The EFI_EVENT to signal whenever data that matches\r
134 FilterClass is logged in the system.\r
135 @param FilterTpl The maximum EFI_TPL at which FilterEvent can be signaled.\r
136 It is strongly recommended that you use the lowest EFI_TPL possible.\r
137 @param FilterClass FilterEvent will be signaled whenever a bit\r
138 in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass.\r
139 If FilterClass is zero, no class-based filtering will be performed.\r
140 @param FilterDataRecordGuid FilterEvent will be signaled whenever\r
141 FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid.\r
142 If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed.\r
143\r
144 @retval EFI_SUCCESS The filter driver event was registered\r
145 @retval EFI_ALREADY_STARTED FilterEvent was previously registered and cannot be registered again.\r
146 @retval EFI_OUT_OF_RESOURCES The filter driver event was not registered\r
147 due to lack of system resources.\r
e8998550 148 @note: Inconsistent with specification here: \r
5259c97d 149 In Framework for EFI Data Hub Specification, Version 0.9, This definition is named as\r
150 EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER. The inconsistency is maintained for backward compatibility. \r
79964ac8 151**/\r
152typedef\r
153EFI_STATUS\r
69686d56 154(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER)(\r
79964ac8 155 IN EFI_DATA_HUB_PROTOCOL *This,\r
156 IN EFI_EVENT FilterEvent,\r
157 IN EFI_TPL FilterTpl,\r
158 IN UINT64 FilterClass,\r
159 IN EFI_GUID *FilterDataRecordGuid OPTIONAL\r
160 );\r
161\r
162/**\r
163 Stops a filter driver from being notified when data records are logged.\r
164\r
165 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
166 @param FilterEvent The EFI_EVENT to remove from the list of events to be\r
167 signaled every time errors are logged.\r
168\r
169 @retval EFI_SUCCESS The filter driver represented by FilterEvent was shut off.\r
170 @retval EFI_NOT_FOUND FilterEvent did not exist.\r
e8998550 171 @note: Inconsistent with specification here: \r
5259c97d 172 In Framework for EFI Data Hub Specification, Version 0.9, This definition is named as\r
173 EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER. The inconsistency is maintained for backward compatibility. \r
79964ac8 174**/\r
175typedef\r
176EFI_STATUS\r
69686d56 177(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER)(\r
79964ac8 178 IN EFI_DATA_HUB_PROTOCOL *This,\r
179 IN EFI_EVENT FilterEvent\r
180 );\r
181\r
182/**\r
79964ac8 183 This protocol is used to log information and register filter drivers\r
184 to receive data records.\r
79964ac8 185**/\r
186struct _EFI_DATA_HUB_PROTOCOL {\r
4e97801c 187 ///\r
188 /// Logs a data record.\r
189 ///\r
190 EFI_DATA_HUB_LOG_DATA LogData; \r
191 \r
192 ///\r
193 /// Gets a data record. Used both to view the memory-based log and to\r
194 /// get information about which data records have been consumed by a filter driver.\r
195 ///\r
79964ac8 196 EFI_DATA_HUB_GET_NEXT_RECORD GetNextRecord;\r
4e97801c 197 \r
198 ///\r
199 /// Allows the registration of an EFI event to act as a filter driver for all data records that are logged.\r
200 ///\r
79964ac8 201 EFI_DATA_HUB_REGISTER_FILTER_DRIVER RegisterFilterDriver;\r
4e97801c 202 \r
203 ///\r
204 /// Used to remove a filter driver that was added with RegisterFilterDriver().\r
205 ///\r
79964ac8 206 EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
207};\r
208\r
209extern EFI_GUID gEfiDataHubProtocolGuid;\r
210\r
211#endif\r