2 Null Base Report Status Code Library instance with empty functions.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/ReportStatusCodeLib.h>
11 #include <Library/DebugLib.h>
14 Converts a status code to an 8-bit POST code value.
16 Converts the status code specified by CodeType and Value to an 8-bit POST code
17 and returns the 8-bit POST code in PostCode. If CodeType is an
18 EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
19 are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
20 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
22 If PostCode is NULL, then ASSERT().
24 @param CodeType The type of status code being converted.
25 @param Value The status code value being converted.
26 @param PostCode A pointer to the 8-bit POST code value to return.
28 @retval TRUE The status code specified by CodeType and Value was converted
29 to an 8-bit POST code and returned in PostCode.
30 @retval FALSE The status code specified by CodeType and Value could not be
31 converted to an 8-bit POST code value.
37 IN EFI_STATUS_CODE_TYPE CodeType
,
38 IN EFI_STATUS_CODE_VALUE Value
,
42 ASSERT (PostCode
!= NULL
);
48 Extracts ASSERT() information from a status code structure.
50 Converts the status code specified by CodeType, Value, and Data to the ASSERT()
51 arguments specified by Filename, Description, and LineNumber. If CodeType is
52 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
53 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
54 Filename, Description, and LineNumber from the optional data area of the
55 status code buffer specified by Data. The optional data area of Data contains
56 a Null-terminated ASCII string for the FileName, followed by a Null-terminated
57 ASCII string for the Description, followed by a 32-bit LineNumber. If the
58 ASSERT() information could be extracted from Data, then return TRUE.
59 Otherwise, FALSE is returned.
61 If Data is NULL, then ASSERT().
62 If Filename is NULL, then ASSERT().
63 If Description is NULL, then ASSERT().
64 If LineNumber is NULL, then ASSERT().
66 @param CodeType The type of status code being converted.
67 @param Value The status code value being converted.
68 @param Data The pointer to the status code data buffer.
69 @param Filename The pointer to the source file name that generated the ASSERT().
70 @param Description The pointer to the description of the ASSERT().
71 @param LineNumber The pointer to the source line number that generated the ASSERT().
73 @retval TRUE The status code specified by CodeType, Value, and Data was
74 converted ASSERT() arguments specified by Filename, Description,
76 @retval FALSE The status code specified by CodeType, Value, and Data could
77 not be converted to ASSERT() arguments.
82 ReportStatusCodeExtractAssertInfo (
83 IN EFI_STATUS_CODE_TYPE CodeType
,
84 IN EFI_STATUS_CODE_VALUE Value
,
85 IN CONST EFI_STATUS_CODE_DATA
*Data
,
87 OUT CHAR8
**Description
,
88 OUT UINT32
*LineNumber
95 Extracts DEBUG() information from a status code structure.
97 Converts the status code specified by Data to the DEBUG() arguments specified
98 by ErrorLevel, Marker, and Format. If type GUID in Data is
99 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
100 Format from the optional data area of the status code buffer specified by Data.
101 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
102 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
103 the Format. If the DEBUG() information could be extracted from Data, then
104 return TRUE. Otherwise, FALSE is returned.
106 If Data is NULL, then ASSERT().
107 If ErrorLevel is NULL, then ASSERT().
108 If Marker is NULL, then ASSERT().
109 If Format is NULL, then ASSERT().
111 @param Data The pointer to the status code data buffer.
112 @param ErrorLevel The pointer to the error level mask for a debug message.
113 @param Marker The pointer to the variable argument list associated with Format.
114 @param Format The pointer to a Null-terminated ASCII format string of a
117 @retval TRUE The status code specified by Data was converted DEBUG() arguments
118 specified by ErrorLevel, Marker, and Format.
119 @retval FALSE The status code specified by Data could not be converted to
125 ReportStatusCodeExtractDebugInfo (
126 IN CONST EFI_STATUS_CODE_DATA
*Data
,
127 OUT UINT32
*ErrorLevel
,
128 OUT BASE_LIST
*Marker
,
132 ASSERT (Data
!= NULL
);
133 ASSERT (ErrorLevel
!= NULL
);
134 ASSERT (Marker
!= NULL
);
135 ASSERT (Format
!= NULL
);
141 Reports a status code.
143 Reports the status code specified by the parameters Type and Value. Status
144 code also require an instance, caller ID, and extended data. This function
145 passed in a zero instance, NULL extended data, and a caller ID of
146 gEfiCallerIdGuid, which is the GUID for the module.
148 ReportStatusCode()must actively prevent recursion. If ReportStatusCode()
149 is called while processing another any other Report Status Code Library function,
150 then ReportStatusCode() must return immediately.
152 @param Type The status code type.
153 @param Value The status code value.
155 @retval EFI_SUCCESS The status code was reported.
156 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
158 @retval EFI_UNSUPPORTED The report status code is not supported.
164 IN EFI_STATUS_CODE_TYPE Type
,
165 IN EFI_STATUS_CODE_VALUE Value
172 Reports a status code with a Device Path Protocol as the extended data.
174 Allocates and fills in the extended data section of a status code with the
175 Device Path Protocol specified by DevicePath. This function is responsible
176 for allocating a buffer large enough for the standard header and the device
177 path. The standard header is filled in with a GUID of
178 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
179 instance and a caller ID of gEfiCallerIdGuid.
181 ReportStatusCodeWithDevicePath()must actively prevent recursion. If
182 ReportStatusCodeWithDevicePath() is called while processing another any other
183 Report Status Code Library function, then ReportStatusCodeWithDevicePath()
184 must return EFI_DEVICE_ERROR immediately.
186 If DevicePath is NULL, then ASSERT().
188 @param Type Status code type.
189 @param Value Status code value.
190 @param DevicePath The pointer to the Device Path Protocol to be reported.
192 @retval EFI_SUCCESS The status code was reported with the extended
193 data specified by DevicePath.
194 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
195 extended data section.
196 @retval EFI_UNSUPPORTED The report status code is not supported
201 ReportStatusCodeWithDevicePath (
202 IN EFI_STATUS_CODE_TYPE Type
,
203 IN EFI_STATUS_CODE_VALUE Value
,
204 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
207 ASSERT (DevicePath
!= NULL
);
213 Reports a status code with an extended data buffer.
215 Allocates and fills in the extended data section of a status code with the
216 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
217 is assumed to be one of the data structures specified in Related Definitions.
218 These data structure do not have the standard header, so this function is
219 responsible for allocating a buffer large enough for the standard header and
220 the extended data passed into this function. The standard header is filled
221 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
222 with a zero instance and a caller ID of gEfiCallerIdGuid.
224 ReportStatusCodeWithExtendedData()must actively prevent recursion. If
225 ReportStatusCodeWithExtendedData() is called while processing another any other
226 Report Status Code Library function, then ReportStatusCodeWithExtendedData()
227 must return EFI_DEVICE_ERROR immediately.
229 If ExtendedData is NULL, then ASSERT().
230 If ExtendedDataSize is 0, then ASSERT().
232 @param Type Status code type.
233 @param Value Status code value.
234 @param ExtendedData The pointer to the extended data buffer to be reported.
235 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
238 @retval EFI_SUCCESS The status code was reported with the extended
239 data specified by ExtendedData and ExtendedDataSize.
240 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
241 extended data section.
242 @retval EFI_UNSUPPORTED The report status code is not supported.
247 ReportStatusCodeWithExtendedData (
248 IN EFI_STATUS_CODE_TYPE Type
,
249 IN EFI_STATUS_CODE_VALUE Value
,
250 IN CONST VOID
*ExtendedData
,
251 IN UINTN ExtendedDataSize
254 ASSERT (ExtendedData
!= NULL
);
255 ASSERT (ExtendedDataSize
!= 0);
260 Reports a status code with full parameters.
262 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
263 is 0, then an extended data buffer is not reported. If ExtendedData is not
264 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
265 ExtendedData is assumed not have the standard status code header, so this function
266 is responsible for allocating a buffer large enough for the standard header and
267 the extended data passed into this function. The standard header is filled in
268 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
269 GUID of gEfiStatusCodeSpecificDataGuid is used. The status code is reported with
270 an instance specified by Instance and a caller ID specified by CallerId. If
271 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
273 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
274 is called while processing another any other Report Status Code Library function,
275 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
277 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
278 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
280 @param Type The status code type.
281 @param Value The status code value.
282 @param Instance Status code instance number.
283 @param CallerId The pointer to a GUID that identifies the caller of this
284 function. If this parameter is NULL, then a caller
285 ID of gEfiCallerIdGuid is used.
286 @param ExtendedDataGuid The pointer to the GUID for the extended data buffer.
287 If this parameter is NULL, then a the status code
288 standard header is filled in with
289 gEfiStatusCodeSpecificDataGuid.
290 @param ExtendedData The pointer to the extended data buffer. This is an
291 optional parameter that may be NULL.
292 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
294 @retval EFI_SUCCESS The status code was reported.
295 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
296 the extended data section if it was specified.
297 @retval EFI_UNSUPPORTED The report status code is not supported.
303 IN EFI_STATUS_CODE_TYPE Type
,
304 IN EFI_STATUS_CODE_VALUE Value
,
306 IN CONST EFI_GUID
*CallerId OPTIONAL
,
307 IN CONST EFI_GUID
*ExtendedDataGuid OPTIONAL
,
308 IN CONST VOID
*ExtendedData OPTIONAL
,
309 IN UINTN ExtendedDataSize
316 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
318 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
319 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
321 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
322 PcdReportStatusCodeProperyMask is set.
323 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
324 PcdReportStatusCodeProperyMask is clear.
329 ReportProgressCodeEnabled (
337 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
339 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
340 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
342 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
343 PcdReportStatusCodeProperyMask is set.
344 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
345 PcdReportStatusCodeProperyMask is clear.
350 ReportErrorCodeEnabled (
358 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
360 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
361 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
363 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
364 PcdReportStatusCodeProperyMask is set.
365 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
366 PcdReportStatusCodeProperyMask is clear.
371 ReportDebugCodeEnabled (