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