]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
50a64e5b | 2 | Provides services to log status code records.\r |
fb3df220 | 3 | \r |
50a64e5b | 4 | Copyright (c) 2006 - 2008, Intel Corporation\r |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
fb3df220 | 9 | \r |
50a64e5b | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
fb3df220 | 12 | \r |
13 | **/\r | |
14 | \r | |
15 | #ifndef __REPORT_STATUS_CODE_LIB_H__\r | |
16 | #define __REPORT_STATUS_CODE_LIB_H__\r | |
17 | \r | |
2a254b90 | 18 | #include <Pi/PiMultiPhase.h>\r |
c7d265a9 | 19 | #include <Protocol/DevicePath.h>\r |
20 | \r | |
fb3df220 | 21 | //\r |
22 | // Declare bits for PcdReportStatusCodePropertyMask\r | |
23 | //\r | |
24 | #define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001\r | |
25 | #define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002\r | |
26 | #define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004\r | |
27 | \r | |
28 | //\r | |
29 | // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed\r | |
30 | //\r | |
31 | \r | |
fb3df220 | 32 | /**\r |
33 | Converts a status code to an 8-bit POST code value.\r | |
34 | \r | |
35 | Converts the status code specified by CodeType and Value to an 8-bit POST code \r | |
36 | and returns the 8-bit POST code in PostCode. If CodeType is an \r | |
37 | EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode \r | |
38 | are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits \r | |
39 | 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned. \r | |
40 | \r | |
41 | If PostCode is NULL, then ASSERT().\r | |
42 | \r | |
43 | @param CodeType The type of status code being converted.\r | |
44 | @param Value The status code value being converted.\r | |
45 | @param PostCode A pointer to the 8-bit POST code value to return. \r | |
46 | \r | |
47 | @retval TRUE The status code specified by CodeType and Value was converted \r | |
48 | to an 8-bit POST code and returned in PostCode.\r | |
49 | @retval FALSE The status code specified by CodeType and Value could not be \r | |
50 | converted to an 8-bit POST code value.\r | |
51 | \r | |
52 | **/\r | |
53 | BOOLEAN\r | |
54 | EFIAPI\r | |
55 | CodeTypeToPostCode (\r | |
56 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
57 | IN EFI_STATUS_CODE_VALUE Value,\r | |
58 | OUT UINT8 *PostCode\r | |
59 | );\r | |
60 | \r | |
61 | \r | |
62 | /**\r | |
63 | Extracts ASSERT() information from a status code structure.\r | |
64 | \r | |
65 | Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r | |
66 | arguments specified by Filename, Description, and LineNumber. If CodeType is \r | |
67 | an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and \r | |
68 | Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract \r | |
69 | Filename, Description, and LineNumber from the optional data area of the \r | |
70 | status code buffer specified by Data. The optional data area of Data contains \r | |
71 | a Null-terminated ASCII string for the FileName, followed by a Null-terminated \r | |
72 | ASCII string for the Description, followed by a 32-bit LineNumber. If the \r | |
73 | ASSERT() information could be extracted from Data, then return TRUE. \r | |
74 | Otherwise, FALSE is returned. \r | |
75 | \r | |
76 | If Data is NULL, then ASSERT().\r | |
77 | If Filename is NULL, then ASSERT().\r | |
78 | If Description is NULL, then ASSERT().\r | |
79 | If LineNumber is NULL, then ASSERT().\r | |
80 | \r | |
81 | @param CodeType The type of status code being converted.\r | |
82 | @param Value The status code value being converted.\r | |
83 | @param Data Pointer to status code data buffer. \r | |
84 | @param Filename Pointer to the source file name that generated the ASSERT().\r | |
85 | @param Description Pointer to the description of the ASSERT().\r | |
86 | @param LineNumber Pointer to source line number that generated the ASSERT().\r | |
87 | \r | |
88 | @retval TRUE The status code specified by CodeType, Value, and Data was \r | |
89 | converted ASSERT() arguments specified by Filename, Description, \r | |
90 | and LineNumber.\r | |
91 | @retval FALSE The status code specified by CodeType, Value, and Data could \r | |
92 | not be converted to ASSERT() arguments.\r | |
93 | \r | |
94 | **/\r | |
95 | BOOLEAN\r | |
96 | EFIAPI\r | |
97 | ReportStatusCodeExtractAssertInfo (\r | |
98 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
99 | IN EFI_STATUS_CODE_VALUE Value, \r | |
100 | IN CONST EFI_STATUS_CODE_DATA *Data, \r | |
101 | OUT CHAR8 **Filename,\r | |
102 | OUT CHAR8 **Description,\r | |
103 | OUT UINT32 *LineNumber\r | |
104 | );\r | |
105 | \r | |
106 | \r | |
107 | /**\r | |
108 | Extracts DEBUG() information from a status code structure.\r | |
109 | \r | |
110 | Converts the status code specified by Data to the DEBUG() arguments specified \r | |
111 | by ErrorLevel, Marker, and Format. If type GUID in Data is \r | |
112 | EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and \r | |
113 | Format from the optional data area of the status code buffer specified by Data. \r | |
114 | The optional data area of Data contains a 32-bit ErrorLevel followed by Marker \r | |
115 | which is 12 UINTN parameters, followed by a Null-terminated ASCII string for \r | |
116 | the Format. If the DEBUG() information could be extracted from Data, then \r | |
117 | return TRUE. Otherwise, FALSE is returned.\r | |
118 | \r | |
119 | If Data is NULL, then ASSERT().\r | |
120 | If ErrorLevel is NULL, then ASSERT().\r | |
121 | If Marker is NULL, then ASSERT().\r | |
122 | If Format is NULL, then ASSERT().\r | |
123 | \r | |
124 | @param Data Pointer to status code data buffer. \r | |
125 | @param ErrorLevel Pointer to error level mask for a debug message.\r | |
126 | @param Marker Pointer to the variable argument list associated with Format.\r | |
127 | @param Format Pointer to a Null-terminated ASCII format string of a \r | |
128 | debug message.\r | |
129 | \r | |
130 | @retval TRUE The status code specified by Data was converted DEBUG() arguments \r | |
131 | specified by ErrorLevel, Marker, and Format.\r | |
132 | @retval FALSE The status code specified by Data could not be converted to \r | |
133 | DEBUG() arguments.\r | |
134 | \r | |
135 | **/\r | |
136 | BOOLEAN\r | |
137 | EFIAPI\r | |
138 | ReportStatusCodeExtractDebugInfo (\r | |
139 | IN CONST EFI_STATUS_CODE_DATA *Data, \r | |
140 | OUT UINT32 *ErrorLevel,\r | |
141 | OUT VA_LIST *Marker,\r | |
142 | OUT CHAR8 **Format\r | |
143 | );\r | |
144 | \r | |
145 | \r | |
146 | /**\r | |
147 | Reports a status code.\r | |
148 | \r | |
149 | Reports the status code specified by the parameters Type and Value. Status \r | |
150 | code also require an instance, caller ID, and extended data. This function \r | |
151 | passed in a zero instance, NULL extended data, and a caller ID of \r | |
152 | gEfiCallerIdGuid, which is the GUID for the module. \r | |
153 | \r | |
154 | ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode() \r | |
155 | is called while processing another any other Report Status Code Library function,\r | |
156 | then ReportStatusCode() must return immediately.\r | |
157 | \r | |
158 | @param Type Status code type. \r | |
159 | @param Value Status code value.\r | |
160 | \r | |
161 | @retval EFI_SUCCESS The status code was reported.\r | |
162 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a \r | |
163 | device error.\r | |
164 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
165 | \r | |
166 | **/\r | |
167 | EFI_STATUS\r | |
168 | EFIAPI\r | |
169 | ReportStatusCode (\r | |
170 | IN EFI_STATUS_CODE_TYPE Type,\r | |
171 | IN EFI_STATUS_CODE_VALUE Value\r | |
172 | );\r | |
173 | \r | |
174 | \r | |
175 | /**\r | |
176 | Reports a status code with a Device Path Protocol as the extended data.\r | |
177 | \r | |
178 | Allocates and fills in the extended data section of a status code with the \r | |
179 | Device Path Protocol specified by DevicePath. This function is responsible \r | |
180 | for allocating a buffer large enough for the standard header and the device \r | |
181 | path. The standard header is filled in with a GUID of \r | |
182 | gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero \r | |
183 | instance and a caller ID of gEfiCallerIdGuid.\r | |
184 | \r | |
185 | ReportStatusCodeWithDevicePath()must actively prevent recursion. If \r | |
186 | ReportStatusCodeWithDevicePath() is called while processing another any other \r | |
187 | Report Status Code Library function, then ReportStatusCodeWithDevicePath() \r | |
188 | must return EFI_DEVICE_ERROR immediately.\r | |
189 | \r | |
190 | If DevicePath is NULL, then ASSERT().\r | |
191 | \r | |
192 | @param Type Status code type. \r | |
193 | @param Value Status code value.\r | |
194 | @param DevicePath Pointer to the Device Path Protocol to be reported.\r | |
195 | \r | |
196 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
197 | data specified by DevicePath.\r | |
198 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
199 | extended data section.\r | |
200 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
201 | \r | |
202 | **/\r | |
203 | EFI_STATUS\r | |
204 | EFIAPI\r | |
205 | ReportStatusCodeWithDevicePath (\r | |
206 | IN EFI_STATUS_CODE_TYPE Type,\r | |
207 | IN EFI_STATUS_CODE_VALUE Value,\r | |
208 | IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
209 | );\r | |
210 | \r | |
211 | \r | |
212 | /**\r | |
213 | Reports a status code with an extended data buffer.\r | |
214 | \r | |
215 | Allocates and fills in the extended data section of a status code with the \r | |
216 | extended data specified by ExtendedData and ExtendedDataSize. ExtendedData \r | |
217 | is assumed to be one of the data structures specified in Related Definitions. \r | |
218 | These data structure do not have the standard header, so this function is \r | |
219 | responsible for allocating a buffer large enough for the standard header and \r | |
220 | the extended data passed into this function. The standard header is filled \r | |
221 | in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported \r | |
222 | with a zero instance and a caller ID of gEfiCallerIdGuid.\r | |
223 | \r | |
224 | ReportStatusCodeWithExtendedData()must actively prevent recursion. If \r | |
225 | ReportStatusCodeWithExtendedData() is called while processing another any other \r | |
226 | Report Status Code Library function, then ReportStatusCodeWithExtendedData() \r | |
227 | must return EFI_DEVICE_ERROR immediately.\r | |
228 | \r | |
229 | If ExtendedData is NULL, then ASSERT().\r | |
230 | If ExtendedDataSize is 0, then ASSERT().\r | |
231 | \r | |
232 | @param Type Status code type. \r | |
233 | @param Value Status code value.\r | |
234 | @param ExtendedData Pointer to the extended data buffer to be reported.\r | |
235 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to \r | |
236 | be reported.\r | |
237 | \r | |
238 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
239 | data specified by ExtendedData and ExtendedDataSize.\r | |
240 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
241 | extended data section.\r | |
242 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
243 | \r | |
244 | **/\r | |
245 | EFI_STATUS\r | |
246 | EFIAPI\r | |
247 | ReportStatusCodeWithExtendedData (\r | |
248 | IN EFI_STATUS_CODE_TYPE Type,\r | |
249 | IN EFI_STATUS_CODE_VALUE Value,\r | |
250 | IN CONST VOID *ExtendedData,\r | |
251 | IN UINTN ExtendedDataSize\r | |
252 | );\r | |
253 | \r | |
254 | \r | |
255 | /**\r | |
256 | Reports a status code with full parameters.\r | |
257 | \r | |
258 | The function reports a status code. If ExtendedData is NULL and ExtendedDataSize \r | |
259 | is 0, then an extended data buffer is not reported. If ExtendedData is not \r | |
260 | NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated. \r | |
261 | ExtendedData is assumed not have the standard status code header, so this function \r | |
262 | is responsible for allocating a buffer large enough for the standard header and \r | |
263 | the extended data passed into this function. The standard header is filled in \r | |
264 | with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a \r | |
265 | GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with \r | |
266 | an instance specified by Instance and a caller ID specified by CallerId. If \r | |
267 | CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r | |
268 | \r | |
269 | ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx() \r | |
270 | is called while processing another any other Report Status Code Library function, \r | |
271 | then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r | |
272 | \r | |
273 | If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r | |
274 | If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r | |
275 | \r | |
276 | @param Type Status code type. \r | |
277 | @param Value Status code value.\r | |
278 | @param Instance Status code instance number.\r | |
279 | @param CallerId Pointer to a GUID that identifies the caller of this \r | |
280 | function. If this parameter is NULL, then a caller \r | |
281 | ID of gEfiCallerIdGuid is used.\r | |
282 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer. \r | |
283 | If this parameter is NULL, then a the status code \r | |
284 | standard header is filled in with \r | |
285 | gEfiStatusCodeSpecificDataGuid.\r | |
286 | @param ExtendedData Pointer to the extended data buffer. This is an \r | |
287 | optional parameter that may be NULL.\r | |
288 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
289 | \r | |
290 | @retval EFI_SUCCESS The status code was reported.\r | |
291 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate \r | |
292 | the extended data section if it was specified.\r | |
293 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
294 | \r | |
295 | **/\r | |
296 | EFI_STATUS\r | |
297 | EFIAPI\r | |
298 | ReportStatusCodeEx (\r | |
299 | IN EFI_STATUS_CODE_TYPE Type,\r | |
300 | IN EFI_STATUS_CODE_VALUE Value,\r | |
301 | IN UINT32 Instance,\r | |
302 | IN CONST EFI_GUID *CallerId OPTIONAL,\r | |
303 | IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r | |
304 | IN CONST VOID *ExtendedData OPTIONAL,\r | |
305 | IN UINTN ExtendedDataSize\r | |
306 | );\r | |
307 | \r | |
308 | \r | |
309 | /**\r | |
310 | Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r | |
311 | \r | |
312 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED \r | |
313 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
314 | \r | |
315 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of \r | |
316 | PcdReportStatusCodeProperyMask is set.\r | |
317 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of \r | |
318 | PcdReportStatusCodeProperyMask is clear.\r | |
319 | \r | |
320 | **/\r | |
321 | BOOLEAN\r | |
322 | EFIAPI\r | |
323 | ReportProgressCodeEnabled (\r | |
324 | VOID\r | |
325 | );\r | |
326 | \r | |
327 | \r | |
328 | /**\r | |
329 | Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r | |
330 | \r | |
331 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED \r | |
332 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
333 | \r | |
334 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of \r | |
335 | PcdReportStatusCodeProperyMask is set.\r | |
336 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of \r | |
337 | PcdReportStatusCodeProperyMask is clear.\r | |
338 | \r | |
339 | **/\r | |
340 | BOOLEAN\r | |
341 | EFIAPI\r | |
342 | ReportErrorCodeEnabled (\r | |
343 | VOID\r | |
344 | );\r | |
345 | \r | |
346 | \r | |
347 | /**\r | |
348 | Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r | |
349 | \r | |
350 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED \r | |
351 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
352 | \r | |
353 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
354 | PcdReportStatusCodeProperyMask is set.\r | |
355 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
356 | PcdReportStatusCodeProperyMask is clear.\r | |
357 | \r | |
358 | **/\r | |
359 | BOOLEAN\r | |
360 | EFIAPI\r | |
361 | ReportDebugCodeEnabled (\r | |
362 | VOID\r | |
363 | );\r | |
364 | \r | |
365 | \r | |
366 | /**\r | |
367 | Reports a status code with minimal parameters if the status code type is enabled.\r | |
368 | \r | |
369 | If the status code type specified by Type is enabled in \r | |
370 | PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type \r | |
371 | and Value.\r | |
372 | \r | |
373 | @param Type Status code type. \r | |
374 | @param Value Status code value.\r | |
375 | \r | |
376 | @retval EFI_SUCCESS The status code was reported.\r | |
377 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.\r | |
378 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
379 | \r | |
380 | **/\r | |
381 | #define REPORT_STATUS_CODE(Type,Value) \\r | |
382 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
383 | ReportStatusCode(Type,Value) : \\r | |
384 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
385 | ReportStatusCode(Type,Value) : \\r | |
386 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
387 | ReportStatusCode(Type,Value) : \\r | |
388 | EFI_UNSUPPORTED\r | |
389 | \r | |
390 | \r | |
391 | /**\r | |
392 | Reports a status code with a Device Path Protocol as the extended data if the \r | |
393 | status code type is enabled.\r | |
394 | \r | |
395 | If the status code type specified by Type is enabled in \r | |
396 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath() \r | |
397 | passing in Type, Value, and DevicePath.\r | |
398 | \r | |
399 | @param Type Status code type. \r | |
400 | @param Value Status code value.\r | |
401 | @param DevicePath Pointer to the Device Path Protocol to be reported.\r | |
402 | \r | |
403 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
404 | data specified by DevicePath.\r | |
405 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
406 | extended data section.\r | |
407 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
408 | \r | |
409 | **/\r | |
410 | #define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \\r | |
411 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
412 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
413 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
414 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
415 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
416 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
417 | EFI_UNSUPPORTED\r | |
418 | \r | |
419 | \r | |
420 | /**\r | |
421 | Reports a status code with an extended data buffer if the status code type \r | |
422 | is enabled.\r | |
423 | \r | |
424 | If the status code type specified by Type is enabled in \r | |
425 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData() \r | |
426 | passing in Type, Value, ExtendedData, and ExtendedDataSize.\r | |
427 | \r | |
428 | @param Type Status code type. \r | |
429 | @param Value Status code value.\r | |
430 | @param ExtendedData Pointer to the extended data buffer to be reported.\r | |
431 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r | |
432 | be reported.\r | |
433 | \r | |
434 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
435 | data specified by ExtendedData and ExtendedDataSize.\r | |
436 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
437 | extended data section.\r | |
438 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
439 | \r | |
440 | **/\r | |
441 | #define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \\r | |
442 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
443 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
444 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
445 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
446 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
447 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
448 | EFI_UNSUPPORTED\r | |
449 | \r | |
450 | /**\r | |
451 | Reports a status code specifying all parameters if the status code type is enabled.\r | |
452 | \r | |
453 | If the status code type specified by Type is enabled in \r | |
454 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type, \r | |
455 | Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.\r | |
456 | \r | |
457 | @param Type Status code type. \r | |
458 | @param Value Status code value.\r | |
459 | @param Instance Status code instance number.\r | |
460 | @param CallerId Pointer to a GUID that identifies the caller of this \r | |
461 | function. If this parameter is NULL, then a caller \r | |
462 | ID of gEfiCallerIdGuid is used.\r | |
463 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer. \r | |
464 | If this parameter is NULL, then a the status code \r | |
465 | standard header is filled in with \r | |
466 | gEfiStatusCodeSpecificDataGuid.\r | |
467 | @param ExtendedData Pointer to the extended data buffer. This is an \r | |
468 | optional parameter that may be NULL.\r | |
469 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
470 | \r | |
471 | @retval EFI_SUCCESS The status code was reported.\r | |
472 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
473 | extended data section if it was specified.\r | |
474 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
475 | \r | |
476 | **/\r | |
477 | #define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \\r | |
478 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
479 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
480 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
481 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
482 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
483 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
484 | EFI_UNSUPPORTED\r | |
485 | \r | |
486 | #endif\r |