2 Null Base Report Status Code Library instance with empty functions.
4 Copyright (c) 2009, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/ReportStatusCodeLib.h>
17 #include <Library/DebugLib.h>
20 Converts a status code to an 8-bit POST code value.
22 Converts the status code specified by CodeType and Value to an 8-bit POST code
23 and returns the 8-bit POST code in PostCode. If CodeType is an
24 EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
25 are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
26 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
28 If PostCode is NULL, then ASSERT().
30 @param CodeType The type of status code being converted.
31 @param Value The status code value being converted.
32 @param PostCode A pointer to the 8-bit POST code value to return.
34 @retval TRUE The status code specified by CodeType and Value was converted
35 to an 8-bit POST code and returned in PostCode.
36 @retval FALSE The status code specified by CodeType and Value could not be
37 converted to an 8-bit POST code value.
43 IN EFI_STATUS_CODE_TYPE CodeType
,
44 IN EFI_STATUS_CODE_VALUE Value
,
48 ASSERT (PostCode
!= NULL
);
55 Extracts ASSERT() information from a status code structure.
57 Converts the status code specified by CodeType, Value, and Data to the ASSERT()
58 arguments specified by Filename, Description, and LineNumber. If CodeType is
59 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
60 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
61 Filename, Description, and LineNumber from the optional data area of the
62 status code buffer specified by Data. The optional data area of Data contains
63 a Null-terminated ASCII string for the FileName, followed by a Null-terminated
64 ASCII string for the Description, followed by a 32-bit LineNumber. If the
65 ASSERT() information could be extracted from Data, then return TRUE.
66 Otherwise, FALSE is returned.
68 If Data is NULL, then ASSERT().
69 If Filename is NULL, then ASSERT().
70 If Description is NULL, then ASSERT().
71 If LineNumber is NULL, then ASSERT().
73 @param CodeType The type of status code being converted.
74 @param Value The status code value being converted.
75 @param Data Pointer to status code data buffer.
76 @param Filename Pointer to the source file name that generated the ASSERT().
77 @param Description Pointer to the description of the ASSERT().
78 @param LineNumber Pointer to source line number that generated the ASSERT().
80 @retval TRUE The status code specified by CodeType, Value, and Data was
81 converted ASSERT() arguments specified by Filename, Description,
83 @retval FALSE The status code specified by CodeType, Value, and Data could
84 not be converted to ASSERT() arguments.
89 ReportStatusCodeExtractAssertInfo (
90 IN EFI_STATUS_CODE_TYPE CodeType
,
91 IN EFI_STATUS_CODE_VALUE Value
,
92 IN CONST EFI_STATUS_CODE_DATA
*Data
,
94 OUT CHAR8
**Description
,
95 OUT UINT32
*LineNumber
103 Extracts DEBUG() information from a status code structure.
105 Converts the status code specified by Data to the DEBUG() arguments specified
106 by ErrorLevel, Marker, and Format. If type GUID in Data is
107 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
108 Format from the optional data area of the status code buffer specified by Data.
109 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
110 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
111 the Format. If the DEBUG() information could be extracted from Data, then
112 return TRUE. Otherwise, FALSE is returned.
114 If Data is NULL, then ASSERT().
115 If ErrorLevel is NULL, then ASSERT().
116 If Marker is NULL, then ASSERT().
117 If Format is NULL, then ASSERT().
119 @param Data Pointer to status code data buffer.
120 @param ErrorLevel Pointer to error level mask for a debug message.
121 @param Marker Pointer to the variable argument list associated with Format.
122 @param Format Pointer to a Null-terminated ASCII format string of a
125 @retval TRUE The status code specified by Data was converted DEBUG() arguments
126 specified by ErrorLevel, Marker, and Format.
127 @retval FALSE The status code specified by Data could not be converted to
133 ReportStatusCodeExtractDebugInfo (
134 IN CONST EFI_STATUS_CODE_DATA
*Data
,
135 OUT UINT32
*ErrorLevel
,
145 Reports a status code.
147 Reports the status code specified by the parameters Type and Value. Status
148 code also require an instance, caller ID, and extended data. This function
149 passed in a zero instance, NULL extended data, and a caller ID of
150 gEfiCallerIdGuid, which is the GUID for the module.
152 ReportStatusCode()must actively prevent recursion. If ReportStatusCode()
153 is called while processing another any other Report Status Code Library function,
154 then ReportStatusCode() must return immediately.
156 @param Type Status code type.
157 @param Value Status code value.
159 @retval EFI_SUCCESS The status code was reported.
160 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
162 @retval EFI_UNSUPPORTED Report status code is not supported
168 IN EFI_STATUS_CODE_TYPE Type
,
169 IN EFI_STATUS_CODE_VALUE Value
177 Reports a status code with a Device Path Protocol as the extended data.
179 Allocates and fills in the extended data section of a status code with the
180 Device Path Protocol specified by DevicePath. This function is responsible
181 for allocating a buffer large enough for the standard header and the device
182 path. The standard header is filled in with a GUID of
183 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
184 instance and a caller ID of gEfiCallerIdGuid.
186 ReportStatusCodeWithDevicePath()must actively prevent recursion. If
187 ReportStatusCodeWithDevicePath() is called while processing another any other
188 Report Status Code Library function, then ReportStatusCodeWithDevicePath()
189 must return EFI_DEVICE_ERROR immediately.
191 If DevicePath is NULL, then ASSERT().
193 @param Type Status code type.
194 @param Value Status code value.
195 @param DevicePath Pointer to the Device Path Protocol to be reported.
197 @retval EFI_SUCCESS The status code was reported with the extended
198 data specified by DevicePath.
199 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
200 extended data section.
201 @retval EFI_UNSUPPORTED Report status code is not supported
206 ReportStatusCodeWithDevicePath (
207 IN EFI_STATUS_CODE_TYPE Type
,
208 IN EFI_STATUS_CODE_VALUE Value
,
209 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
212 ASSERT (DevicePath
!= NULL
);
219 Reports a status code with an extended data buffer.
221 Allocates and fills in the extended data section of a status code with the
222 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
223 is assumed to be one of the data structures specified in Related Definitions.
224 These data structure do not have the standard header, so this function is
225 responsible for allocating a buffer large enough for the standard header and
226 the extended data passed into this function. The standard header is filled
227 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
228 with a zero instance and a caller ID of gEfiCallerIdGuid.
230 ReportStatusCodeWithExtendedData()must actively prevent recursion. If
231 ReportStatusCodeWithExtendedData() is called while processing another any other
232 Report Status Code Library function, then ReportStatusCodeWithExtendedData()
233 must return EFI_DEVICE_ERROR immediately.
235 If ExtendedData is NULL, then ASSERT().
236 If ExtendedDataSize is 0, then ASSERT().
238 @param Type Status code type.
239 @param Value Status code value.
240 @param ExtendedData Pointer to the extended data buffer to be reported.
241 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
244 @retval EFI_SUCCESS The status code was reported with the extended
245 data specified by ExtendedData and ExtendedDataSize.
246 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
247 extended data section.
248 @retval EFI_UNSUPPORTED Report status code is not supported
253 ReportStatusCodeWithExtendedData (
254 IN EFI_STATUS_CODE_TYPE Type
,
255 IN EFI_STATUS_CODE_VALUE Value
,
256 IN CONST VOID
*ExtendedData
,
257 IN UINTN ExtendedDataSize
260 ASSERT (ExtendedData
!= NULL
);
261 ASSERT (ExtendedDataSize
!= 0);
267 Reports a status code with full parameters.
269 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
270 is 0, then an extended data buffer is not reported. If ExtendedData is not
271 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
272 ExtendedData is assumed not have the standard status code header, so this function
273 is responsible for allocating a buffer large enough for the standard header and
274 the extended data passed into this function. The standard header is filled in
275 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
276 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
277 an instance specified by Instance and a caller ID specified by CallerId. If
278 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
280 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
281 is called while processing another any other Report Status Code Library function,
282 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
284 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
285 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
287 @param Type Status code type.
288 @param Value Status code value.
289 @param Instance Status code instance number.
290 @param CallerId Pointer to a GUID that identifies the caller of this
291 function. If this parameter is NULL, then a caller
292 ID of gEfiCallerIdGuid is used.
293 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
294 If this parameter is NULL, then a the status code
295 standard header is filled in with
296 gEfiStatusCodeSpecificDataGuid.
297 @param ExtendedData Pointer to the extended data buffer. This is an
298 optional parameter that may be NULL.
299 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
301 @retval EFI_SUCCESS The status code was reported.
302 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
303 the extended data section if it was specified.
304 @retval EFI_UNSUPPORTED Report status code is not supported
310 IN EFI_STATUS_CODE_TYPE Type
,
311 IN EFI_STATUS_CODE_VALUE Value
,
313 IN CONST EFI_GUID
*CallerId OPTIONAL
,
314 IN CONST EFI_GUID
*ExtendedDataGuid OPTIONAL
,
315 IN CONST VOID
*ExtendedData OPTIONAL
,
316 IN UINTN ExtendedDataSize
324 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
326 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
327 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
329 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
330 PcdReportStatusCodeProperyMask is set.
331 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
332 PcdReportStatusCodeProperyMask is clear.
337 ReportProgressCodeEnabled (
346 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
348 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
349 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
351 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
352 PcdReportStatusCodeProperyMask is set.
353 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
354 PcdReportStatusCodeProperyMask is clear.
359 ReportErrorCodeEnabled (
368 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
370 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
371 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
373 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
374 PcdReportStatusCodeProperyMask is set.
375 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
376 PcdReportStatusCodeProperyMask is clear.
381 ReportDebugCodeEnabled (