]>
Commit | Line | Data |
---|---|---|
11ff2c71 LG |
1 | /** @file\r |
2 | Debug Library based on report status code library.\r | |
3 | \r | |
4 | Note that if the debug message length is larger than the maximum allowable\r | |
5 | record length, then the debug message will be ignored directly.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #include <PiPei.h>\r | |
19 | \r | |
20 | #include <Guid/StatusCodeDataTypeId.h>\r | |
21 | #include <Guid/StatusCodeDataTypeDebug.h>\r | |
22 | \r | |
23 | #include <Library/DebugLib.h>\r | |
24 | #include <Library/BaseLib.h>\r | |
25 | #include <Library/BaseMemoryLib.h>\r | |
26 | #include <Library/ReportStatusCodeLib.h>\r | |
27 | #include <Library/PcdLib.h>\r | |
28 | #include <Library/DebugPrintErrorLevelLib.h>\r | |
29 | \r | |
30 | /**\r | |
31 | Prints a debug message to the debug output device if the specified error level is enabled.\r | |
32 | \r | |
33 | If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function \r | |
34 | GetDebugPrintErrorLevel (), then print the message specified by Format and the \r | |
35 | associated variable argument list to the debug output device.\r | |
36 | \r | |
37 | If Format is NULL, then ASSERT().\r | |
38 | \r | |
39 | If the length of the message string specificed by Format is larger than the maximum allowable\r | |
40 | record length, then directly return and not print it.\r | |
41 | \r | |
42 | @param ErrorLevel The error level of the debug message.\r | |
43 | @param Format Format string for the debug message to print.\r | |
44 | @param ... Variable argument list whose contents are accessed \r | |
45 | based on the format string specified by Format.\r | |
46 | \r | |
47 | **/\r | |
48 | VOID\r | |
49 | EFIAPI\r | |
50 | DebugPrint (\r | |
51 | IN UINTN ErrorLevel,\r | |
52 | IN CONST CHAR8 *Format,\r | |
53 | ...\r | |
54 | )\r | |
55 | {\r | |
56 | UINT64 Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)) + 1];\r | |
57 | EFI_DEBUG_INFO *DebugInfo;\r | |
58 | UINTN TotalSize;\r | |
59 | VA_LIST VaListMarker;\r | |
60 | BASE_LIST BaseListMarker;\r | |
61 | CHAR8 *FormatString;\r | |
62 | BOOLEAN Long;\r | |
63 | \r | |
64 | //\r | |
65 | // If Format is NULL, then ASSERT().\r | |
66 | //\r | |
67 | ASSERT (Format != NULL);\r | |
68 | \r | |
69 | //\r | |
70 | // Check driver Debug Level value and global debug level\r | |
71 | //\r | |
72 | if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {\r | |
73 | return;\r | |
74 | }\r | |
75 | \r | |
76 | //\r | |
77 | // Compute the total size of the record.\r | |
78 | // Note that the passing-in format string and variable parameters will be constructed to \r | |
79 | // the following layout:\r | |
80 | //\r | |
81 | // Buffer->|------------------------|\r | |
82 | // | Padding | 4 bytes\r | |
83 | // DebugInfo->|------------------------|\r | |
84 | // | EFI_DEBUG_INFO | sizeof(EFI_DEBUG_INFO)\r | |
85 | // BaseListMarker->|------------------------|\r | |
86 | // | ... |\r | |
87 | // | variable arguments | 12 * sizeof (UINT64)\r | |
88 | // | ... |\r | |
89 | // |------------------------|\r | |
90 | // | Format String |\r | |
91 | // |------------------------|<- (UINT8 *)Buffer + sizeof(Buffer)\r | |
92 | //\r | |
93 | TotalSize = 4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrSize (Format);\r | |
94 | \r | |
95 | //\r | |
96 | // If the TotalSize is larger than the maximum record size, then return\r | |
97 | //\r | |
98 | if (TotalSize > sizeof (Buffer)) {\r | |
99 | return;\r | |
100 | }\r | |
101 | \r | |
102 | //\r | |
103 | // Fill in EFI_DEBUG_INFO\r | |
104 | //\r | |
105 | // Here we skip the first 4 bytes of Buffer, because we must ensure BaseListMarker is\r | |
106 | // 64-bit aligned, otherwise retrieving 64-bit parameter from BaseListMarker will cause\r | |
107 | // exception on IPF. Buffer starts at 64-bit aligned address, so skipping 4 types (sizeof(EFI_DEBUG_INFO))\r | |
108 | // just makes address of BaseListMarker, which follows DebugInfo, 64-bit aligned.\r | |
109 | //\r | |
110 | DebugInfo = (EFI_DEBUG_INFO *)(Buffer) + 1;\r | |
111 | DebugInfo->ErrorLevel = (UINT32)ErrorLevel;\r | |
112 | BaseListMarker = (BASE_LIST)(DebugInfo + 1);\r | |
113 | FormatString = (CHAR8 *)((UINT64 *)(DebugInfo + 1) + 12);\r | |
114 | \r | |
115 | //\r | |
116 | // Copy the Format string into the record\r | |
117 | //\r | |
8f770819 | 118 | AsciiStrCpyS (FormatString, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)), Format);\r |
11ff2c71 LG |
119 | \r |
120 | //\r | |
121 | // The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments\r | |
122 | // of format in DEBUG string, which is followed by the DEBUG format string.\r | |
123 | // Here we will process the variable arguments and pack them in this area.\r | |
124 | //\r | |
125 | VA_START (VaListMarker, Format);\r | |
126 | for (; *Format != '\0'; Format++) {\r | |
127 | //\r | |
128 | // Only format with prefix % is processed.\r | |
129 | //\r | |
130 | if (*Format != '%') {\r | |
131 | continue;\r | |
132 | }\r | |
133 | Long = FALSE;\r | |
134 | //\r | |
135 | // Parse Flags and Width\r | |
136 | //\r | |
137 | for (Format++; TRUE; Format++) {\r | |
138 | if (*Format == '.' || *Format == '-' || *Format == '+' || *Format == ' ') {\r | |
139 | //\r | |
140 | // These characters in format field are omitted.\r | |
141 | //\r | |
142 | continue;\r | |
143 | }\r | |
144 | if (*Format >= '0' && *Format <= '9') {\r | |
145 | //\r | |
146 | // These characters in format field are omitted.\r | |
147 | //\r | |
148 | continue;\r | |
149 | }\r | |
150 | if (*Format == 'L' || *Format == 'l') {\r | |
151 | //\r | |
152 | // 'L" or "l" in format field means the number being printed is a UINT64\r | |
153 | //\r | |
154 | Long = TRUE;\r | |
155 | continue;\r | |
156 | }\r | |
157 | if (*Format == '*') {\r | |
158 | //\r | |
159 | // '*' in format field means the precision of the field is specified by\r | |
160 | // a UINTN argument in the argument list.\r | |
161 | //\r | |
162 | BASE_ARG (BaseListMarker, UINTN) = VA_ARG (VaListMarker, UINTN);\r | |
163 | continue;\r | |
164 | }\r | |
165 | if (*Format == '\0') {\r | |
166 | //\r | |
167 | // Make no output if Format string terminates unexpectedly when\r | |
168 | // looking up for flag, width, precision and type. \r | |
169 | //\r | |
170 | Format--;\r | |
171 | }\r | |
172 | //\r | |
173 | // When valid argument type detected or format string terminates unexpectedly,\r | |
174 | // the inner loop is done.\r | |
175 | //\r | |
176 | break;\r | |
177 | }\r | |
178 | \r | |
179 | //\r | |
180 | // Pack variable arguments into the storage area following EFI_DEBUG_INFO.\r | |
181 | //\r | |
182 | if ((*Format == 'p') && (sizeof (VOID *) > 4)) {\r | |
183 | Long = TRUE;\r | |
184 | }\r | |
796fecd8 | 185 | if (*Format == 'p' || *Format == 'X' || *Format == 'x' || *Format == 'd' || *Format == 'u') {\r |
11ff2c71 LG |
186 | if (Long) {\r |
187 | BASE_ARG (BaseListMarker, INT64) = VA_ARG (VaListMarker, INT64);\r | |
188 | } else {\r | |
189 | BASE_ARG (BaseListMarker, int) = VA_ARG (VaListMarker, int);\r | |
190 | }\r | |
191 | } else if (*Format == 's' || *Format == 'S' || *Format == 'a' || *Format == 'g' || *Format == 't') {\r | |
192 | BASE_ARG (BaseListMarker, VOID *) = VA_ARG (VaListMarker, VOID *);\r | |
193 | } else if (*Format == 'c') {\r | |
194 | BASE_ARG (BaseListMarker, UINTN) = VA_ARG (VaListMarker, UINTN);\r | |
195 | } else if (*Format == 'r') {\r | |
196 | BASE_ARG (BaseListMarker, RETURN_STATUS) = VA_ARG (VaListMarker, RETURN_STATUS);\r | |
197 | }\r | |
198 | \r | |
199 | //\r | |
200 | // If the converted BASE_LIST is larger than the 12 * sizeof (UINT64) allocated bytes, then ASSERT()\r | |
201 | // This indicates that the DEBUG() macro is passing in more argument than can be handled by \r | |
202 | // the EFI_DEBUG_INFO record\r | |
203 | //\r | |
204 | ASSERT ((CHAR8 *)BaseListMarker <= FormatString);\r | |
205 | \r | |
206 | //\r | |
207 | // If the converted BASE_LIST is larger than the 12 * sizeof (UINT64) allocated bytes, then return\r | |
208 | //\r | |
209 | if ((CHAR8 *)BaseListMarker > FormatString) {\r | |
210 | VA_END (VaListMarker);\r | |
211 | return;\r | |
212 | }\r | |
213 | }\r | |
214 | VA_END (VaListMarker);\r | |
215 | \r | |
216 | //\r | |
217 | // Send the DebugInfo record\r | |
218 | //\r | |
219 | REPORT_STATUS_CODE_EX (\r | |
220 | EFI_DEBUG_CODE,\r | |
221 | (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),\r | |
222 | 0,\r | |
223 | NULL,\r | |
224 | &gEfiStatusCodeDataTypeDebugGuid,\r | |
225 | DebugInfo,\r | |
226 | TotalSize\r | |
227 | );\r | |
228 | }\r | |
229 | \r | |
230 | /**\r | |
231 | Prints an assert message containing a filename, line number, and description. \r | |
232 | This may be followed by a breakpoint or a dead loop.\r | |
233 | \r | |
234 | Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r | |
235 | to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r | |
236 | PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r | |
237 | DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r | |
238 | CpuDeadLoop() is called. If neither of these bits are set, then this function \r | |
239 | returns immediately after the message is printed to the debug output device.\r | |
240 | DebugAssert() must actively prevent recursion. If DebugAssert() is called while\r | |
241 | processing another DebugAssert(), then DebugAssert() must return immediately.\r | |
242 | \r | |
243 | If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r | |
244 | If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r | |
245 | \r | |
246 | @param FileName Pointer to the name of the source file that generated the assert condition.\r | |
247 | @param LineNumber The line number in the source file that generated the assert condition\r | |
248 | @param Description Pointer to the description of the assert condition.\r | |
249 | \r | |
250 | **/\r | |
251 | VOID\r | |
252 | EFIAPI\r | |
253 | DebugAssert (\r | |
254 | IN CONST CHAR8 *FileName,\r | |
255 | IN UINTN LineNumber,\r | |
256 | IN CONST CHAR8 *Description\r | |
257 | )\r | |
258 | {\r | |
259 | UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];\r | |
260 | EFI_DEBUG_ASSERT_DATA *AssertData;\r | |
261 | UINTN HeaderSize;\r | |
262 | UINTN TotalSize;\r | |
263 | CHAR8 *Temp;\r | |
39eccb9c | 264 | UINTN ModuleNameSize;\r |
11ff2c71 LG |
265 | UINTN FileNameSize;\r |
266 | UINTN DescriptionSize;\r | |
267 | \r | |
268 | //\r | |
269 | // Get string size\r | |
270 | //\r | |
271 | HeaderSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r | |
39eccb9c BA |
272 | //\r |
273 | // Compute string size of module name enclosed by []\r | |
274 | //\r | |
275 | ModuleNameSize = 2 + AsciiStrSize (gEfiCallerBaseName);\r | |
11ff2c71 LG |
276 | FileNameSize = AsciiStrSize (FileName);\r |
277 | DescriptionSize = AsciiStrSize (Description);\r | |
278 | \r | |
279 | //\r | |
280 | // Make sure it will all fit in the passed in buffer.\r | |
281 | //\r | |
39eccb9c | 282 | if (HeaderSize + ModuleNameSize + FileNameSize + DescriptionSize > sizeof (Buffer)) {\r |
11ff2c71 | 283 | //\r |
39eccb9c | 284 | // remove module name if it's too long to be filled into buffer\r |
11ff2c71 | 285 | //\r |
39eccb9c BA |
286 | ModuleNameSize = 0;\r |
287 | if (HeaderSize + FileNameSize + DescriptionSize > sizeof (Buffer)) {\r | |
11ff2c71 | 288 | //\r |
39eccb9c | 289 | // FileName + Description is too long to be filled into buffer.\r |
11ff2c71 | 290 | //\r |
39eccb9c BA |
291 | if (HeaderSize + FileNameSize < sizeof (Buffer)) {\r |
292 | //\r | |
293 | // Description has enough buffer to be truncated.\r | |
294 | //\r | |
295 | DescriptionSize = sizeof (Buffer) - HeaderSize - FileNameSize;\r | |
296 | } else {\r | |
297 | //\r | |
298 | // FileName is too long to be filled into buffer.\r | |
299 | // FileName will be truncated. Reserved one byte for Description NULL terminator.\r | |
300 | //\r | |
301 | DescriptionSize = 1;\r | |
302 | FileNameSize = sizeof (Buffer) - HeaderSize - DescriptionSize;\r | |
303 | }\r | |
11ff2c71 LG |
304 | }\r |
305 | }\r | |
11ff2c71 LG |
306 | //\r |
307 | // Fill in EFI_DEBUG_ASSERT_DATA\r | |
308 | //\r | |
309 | AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r | |
310 | AssertData->LineNumber = (UINT32)LineNumber;\r | |
311 | TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r | |
312 | \r | |
39eccb9c BA |
313 | Temp = (CHAR8 *)(AssertData + 1);\r |
314 | \r | |
315 | //\r | |
316 | // Copy Ascii [ModuleName].\r | |
317 | //\r | |
318 | if (ModuleNameSize != 0) {\r | |
319 | CopyMem(Temp, "[", 1);\r | |
320 | CopyMem(Temp + 1, gEfiCallerBaseName, ModuleNameSize - 3);\r | |
321 | CopyMem(Temp + ModuleNameSize - 2, "] ", 2);\r | |
322 | }\r | |
323 | \r | |
11ff2c71 LG |
324 | //\r |
325 | // Copy Ascii FileName including NULL terminator.\r | |
326 | //\r | |
39eccb9c | 327 | Temp = CopyMem (Temp + ModuleNameSize, FileName, FileNameSize);\r |
11ff2c71 | 328 | Temp[FileNameSize - 1] = 0;\r |
39eccb9c | 329 | TotalSize += (ModuleNameSize + FileNameSize);\r |
11ff2c71 LG |
330 | \r |
331 | //\r | |
332 | // Copy Ascii Description include NULL terminator.\r | |
333 | //\r | |
334 | Temp = CopyMem (Temp + FileNameSize, Description, DescriptionSize);\r | |
335 | Temp[DescriptionSize - 1] = 0;\r | |
336 | TotalSize += DescriptionSize;\r | |
337 | \r | |
338 | REPORT_STATUS_CODE_EX (\r | |
339 | (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r | |
340 | (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),\r | |
341 | 0,\r | |
342 | NULL,\r | |
343 | NULL,\r | |
344 | AssertData,\r | |
345 | TotalSize\r | |
346 | );\r | |
347 | \r | |
348 | //\r | |
349 | // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r | |
350 | //\r | |
351 | if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r | |
352 | CpuBreakpoint ();\r | |
353 | } else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r | |
354 | CpuDeadLoop ();\r | |
355 | }\r | |
356 | }\r | |
357 | \r | |
358 | \r | |
359 | /**\r | |
360 | Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r | |
361 | \r | |
362 | This function fills Length bytes of Buffer with the value specified by \r | |
363 | PcdDebugClearMemoryValue, and returns Buffer.\r | |
364 | \r | |
365 | If Buffer is NULL, then ASSERT().\r | |
366 | If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r | |
367 | \r | |
368 | @param Buffer Pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r | |
369 | @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r | |
370 | \r | |
371 | @return Buffer Pointer to the target buffer filled with PcdDebugClearMemoryValue.\r | |
372 | \r | |
373 | **/\r | |
374 | VOID *\r | |
375 | EFIAPI\r | |
376 | DebugClearMemory (\r | |
377 | OUT VOID *Buffer,\r | |
378 | IN UINTN Length\r | |
379 | )\r | |
380 | {\r | |
381 | ASSERT (Buffer != NULL);\r | |
382 | \r | |
383 | return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));\r | |
384 | }\r | |
385 | \r | |
386 | \r | |
387 | /**\r | |
388 | Returns TRUE if ASSERT() macros are enabled.\r | |
389 | \r | |
390 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r | |
391 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
392 | \r | |
393 | @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r | |
394 | @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r | |
395 | \r | |
396 | **/\r | |
397 | BOOLEAN\r | |
398 | EFIAPI\r | |
399 | DebugAssertEnabled (\r | |
400 | VOID\r | |
401 | )\r | |
402 | {\r | |
403 | return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r | |
404 | }\r | |
405 | \r | |
406 | \r | |
407 | /** \r | |
408 | Returns TRUE if DEBUG() macros are enabled.\r | |
409 | \r | |
410 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r | |
411 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
412 | \r | |
413 | @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r | |
414 | @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r | |
415 | \r | |
416 | **/\r | |
417 | BOOLEAN\r | |
418 | EFIAPI\r | |
419 | DebugPrintEnabled (\r | |
420 | VOID\r | |
421 | )\r | |
422 | {\r | |
423 | return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r | |
424 | }\r | |
425 | \r | |
426 | \r | |
427 | /** \r | |
428 | Returns TRUE if DEBUG_CODE() macros are enabled.\r | |
429 | \r | |
430 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
431 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
432 | \r | |
433 | @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r | |
434 | @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r | |
435 | \r | |
436 | **/\r | |
437 | BOOLEAN\r | |
438 | EFIAPI\r | |
439 | DebugCodeEnabled (\r | |
440 | VOID\r | |
441 | )\r | |
442 | {\r | |
443 | return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r | |
444 | }\r | |
445 | \r | |
446 | \r | |
447 | /** \r | |
448 | Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r | |
449 | \r | |
450 | This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of \r | |
451 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
452 | \r | |
453 | @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r | |
454 | @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r | |
455 | \r | |
456 | **/\r | |
457 | BOOLEAN\r | |
458 | EFIAPI\r | |
459 | DebugClearMemoryEnabled (\r | |
460 | VOID\r | |
461 | )\r | |
462 | {\r | |
463 | return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r | |
464 | }\r | |
465 | \r | |
466 | /**\r | |
467 | Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.\r | |
468 | \r | |
469 | This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.\r | |
470 | \r | |
471 | @retval TRUE Current ErrorLevel is supported.\r | |
472 | @retval FALSE Current ErrorLevel is not supported.\r | |
473 | \r | |
474 | **/\r | |
475 | BOOLEAN\r | |
476 | EFIAPI\r | |
477 | DebugPrintLevelEnabled (\r | |
478 | IN CONST UINTN ErrorLevel\r | |
479 | )\r | |
480 | {\r | |
481 | return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);\r | |
482 | }\r |