]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLib.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseReportStatusCodeLibNull / BaseReportStatusCodeLib.c
1 /** @file
2 Null Base Report Status Code Library instance with empty functions.
3
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Base.h>
10 #include <Library/ReportStatusCodeLib.h>
11 #include <Library/DebugLib.h>
12
13 /**
14 Converts a status code to an 8-bit POST code value.
15
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.
21
22 If PostCode is NULL, then ASSERT().
23
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.
27
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.
32
33 **/
34 BOOLEAN
35 EFIAPI
36 CodeTypeToPostCode (
37 IN EFI_STATUS_CODE_TYPE CodeType,
38 IN EFI_STATUS_CODE_VALUE Value,
39 OUT UINT8 *PostCode
40 )
41 {
42 ASSERT (PostCode != NULL);
43
44 return FALSE;
45 }
46
47 /**
48 Extracts ASSERT() information from a status code structure.
49
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.
60
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().
65
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().
72
73 @retval TRUE The status code specified by CodeType, Value, and Data was
74 converted ASSERT() arguments specified by Filename, Description,
75 and LineNumber.
76 @retval FALSE The status code specified by CodeType, Value, and Data could
77 not be converted to ASSERT() arguments.
78
79 **/
80 BOOLEAN
81 EFIAPI
82 ReportStatusCodeExtractAssertInfo (
83 IN EFI_STATUS_CODE_TYPE CodeType,
84 IN EFI_STATUS_CODE_VALUE Value,
85 IN CONST EFI_STATUS_CODE_DATA *Data,
86 OUT CHAR8 **Filename,
87 OUT CHAR8 **Description,
88 OUT UINT32 *LineNumber
89 )
90 {
91 return FALSE;
92 }
93
94 /**
95 Extracts DEBUG() information from a status code structure.
96
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.
105
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().
110
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
115 debug message.
116
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
120 DEBUG() arguments.
121
122 **/
123 BOOLEAN
124 EFIAPI
125 ReportStatusCodeExtractDebugInfo (
126 IN CONST EFI_STATUS_CODE_DATA *Data,
127 OUT UINT32 *ErrorLevel,
128 OUT BASE_LIST *Marker,
129 OUT CHAR8 **Format
130 )
131 {
132 ASSERT (Data != NULL);
133 ASSERT (ErrorLevel != NULL);
134 ASSERT (Marker != NULL);
135 ASSERT (Format != NULL);
136
137 return FALSE;
138 }
139
140 /**
141 Reports a status code.
142
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.
147
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.
151
152 @param Type The status code type.
153 @param Value The status code value.
154
155 @retval EFI_SUCCESS The status code was reported.
156 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
157 device error.
158 @retval EFI_UNSUPPORTED The report status code is not supported.
159
160 **/
161 EFI_STATUS
162 EFIAPI
163 ReportStatusCode (
164 IN EFI_STATUS_CODE_TYPE Type,
165 IN EFI_STATUS_CODE_VALUE Value
166 )
167 {
168 return EFI_SUCCESS;
169 }
170
171 /**
172 Reports a status code with a Device Path Protocol as the extended data.
173
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.
180
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.
185
186 If DevicePath is NULL, then ASSERT().
187
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.
191
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
197
198 **/
199 EFI_STATUS
200 EFIAPI
201 ReportStatusCodeWithDevicePath (
202 IN EFI_STATUS_CODE_TYPE Type,
203 IN EFI_STATUS_CODE_VALUE Value,
204 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
205 )
206 {
207 ASSERT (DevicePath != NULL);
208
209 return EFI_SUCCESS;
210 }
211
212 /**
213 Reports a status code with an extended data buffer.
214
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.
223
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.
228
229 If ExtendedData is NULL, then ASSERT().
230 If ExtendedDataSize is 0, then ASSERT().
231
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
236 be reported.
237
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.
243
244 **/
245 EFI_STATUS
246 EFIAPI
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
252 )
253 {
254 ASSERT (ExtendedData != NULL);
255 ASSERT (ExtendedDataSize != 0);
256 return EFI_SUCCESS;
257 }
258
259 /**
260 Reports a status code with full parameters.
261
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.
272
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.
276
277 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
278 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
279
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.
293
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.
298
299 **/
300 EFI_STATUS
301 EFIAPI
302 ReportStatusCodeEx (
303 IN EFI_STATUS_CODE_TYPE Type,
304 IN EFI_STATUS_CODE_VALUE Value,
305 IN UINT32 Instance,
306 IN CONST EFI_GUID *CallerId OPTIONAL,
307 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
308 IN CONST VOID *ExtendedData OPTIONAL,
309 IN UINTN ExtendedDataSize
310 )
311 {
312 return EFI_SUCCESS;
313 }
314
315 /**
316 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
317
318 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
319 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
320
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.
325
326 **/
327 BOOLEAN
328 EFIAPI
329 ReportProgressCodeEnabled (
330 VOID
331 )
332 {
333 return FALSE;
334 }
335
336 /**
337 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
338
339 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
340 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
341
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.
346
347 **/
348 BOOLEAN
349 EFIAPI
350 ReportErrorCodeEnabled (
351 VOID
352 )
353 {
354 return FALSE;
355 }
356
357 /**
358 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
359
360 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
361 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
362
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.
367
368 **/
369 BOOLEAN
370 EFIAPI
371 ReportDebugCodeEnabled (
372 VOID
373 )
374 {
375 return FALSE;
376 }