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