]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
eceb3a4c | 2 | Null Base Debug Library instance with empty functions.\r |
e1f414b6 | 3 | \r |
b04bdd15 | 4 | Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e1f414b6 | 6 | \r |
7 | **/\r | |
8 | \r | |
c7d265a9 | 9 | #include <Base.h>\r |
c7d265a9 | 10 | #include <Library/DebugLib.h>\r |
e1f414b6 | 11 | \r |
12 | /**\r | |
e1f414b6 | 13 | Prints a debug message to the debug output device if the specified error level is enabled.\r |
14 | \r | |
9095d37b LG |
15 | If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r |
16 | GetDebugPrintErrorLevel (), then print the message specified by Format and the\r | |
2891fc8b | 17 | associated variable argument list to the debug output device.\r |
e1f414b6 | 18 | \r |
3e5c3238 | 19 | If Format is NULL, then ASSERT().\r |
20 | \r | |
e1f414b6 | 21 | @param ErrorLevel The error level of the debug message.\r |
22 | @param Format Format string for the debug message to print.\r | |
9095d37b | 23 | @param ... Variable argument list whose contents are accessed\r |
285010e7 | 24 | based on the format string specified by Format.\r |
e1f414b6 | 25 | \r |
26 | **/\r | |
27 | VOID\r | |
28 | EFIAPI\r | |
29 | DebugPrint (\r | |
30 | IN UINTN ErrorLevel,\r | |
31 | IN CONST CHAR8 *Format,\r | |
32 | ...\r | |
33 | )\r | |
34 | {\r | |
35 | }\r | |
36 | \r | |
b04bdd15 BB |
37 | /**\r |
38 | Prints a debug message to the debug output device if the specified\r | |
39 | error level is enabled.\r | |
40 | \r | |
41 | If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r | |
42 | GetDebugPrintErrorLevel (), then print the message specified by Format and\r | |
43 | the associated variable argument list to the debug output device.\r | |
44 | \r | |
45 | If Format is NULL, then ASSERT().\r | |
46 | \r | |
47 | @param ErrorLevel The error level of the debug message.\r | |
48 | @param Format Format string for the debug message to print.\r | |
49 | @param VaListMarker VA_LIST marker for the variable argument list.\r | |
50 | \r | |
51 | **/\r | |
52 | VOID\r | |
53 | EFIAPI\r | |
54 | DebugVPrint (\r | |
2f88bd3a MK |
55 | IN UINTN ErrorLevel,\r |
56 | IN CONST CHAR8 *Format,\r | |
57 | IN VA_LIST VaListMarker\r | |
b04bdd15 BB |
58 | )\r |
59 | {\r | |
60 | }\r | |
61 | \r | |
b04bdd15 BB |
62 | /**\r |
63 | Prints a debug message to the debug output device if the specified\r | |
64 | error level is enabled.\r | |
65 | This function use BASE_LIST which would provide a more compatible\r | |
66 | service than VA_LIST.\r | |
67 | \r | |
68 | If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r | |
69 | GetDebugPrintErrorLevel (), then print the message specified by Format and\r | |
70 | the associated variable argument list to the debug output device.\r | |
71 | \r | |
72 | If Format is NULL, then ASSERT().\r | |
73 | \r | |
74 | @param ErrorLevel The error level of the debug message.\r | |
75 | @param Format Format string for the debug message to print.\r | |
76 | @param BaseListMarker BASE_LIST marker for the variable argument list.\r | |
77 | \r | |
78 | **/\r | |
79 | VOID\r | |
80 | EFIAPI\r | |
81 | DebugBPrint (\r | |
2f88bd3a MK |
82 | IN UINTN ErrorLevel,\r |
83 | IN CONST CHAR8 *Format,\r | |
84 | IN BASE_LIST BaseListMarker\r | |
b04bdd15 BB |
85 | )\r |
86 | {\r | |
87 | }\r | |
88 | \r | |
e1f414b6 | 89 | /**\r |
9095d37b | 90 | Prints an assert message containing a filename, line number, and description.\r |
e1f414b6 | 91 | This may be followed by a breakpoint or a dead loop.\r |
92 | \r | |
3e5c3238 | 93 | Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r |
9095d37b LG |
94 | to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of\r |
95 | PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if\r | |
96 | DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then\r | |
97 | CpuDeadLoop() is called. If neither of these bits are set, then this function\r | |
e1f414b6 | 98 | returns immediately after the message is printed to the debug output device.\r |
3e5c3238 | 99 | DebugAssert() must actively prevent recursion. If DebugAssert() is called while\r |
e1f414b6 | 100 | processing another DebugAssert(), then DebugAssert() must return immediately.\r |
101 | \r | |
102 | If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r | |
e1f414b6 | 103 | If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r |
104 | \r | |
2fc59a00 | 105 | @param FileName The pointer to the name of the source file that generated the assert condition.\r |
e1f414b6 | 106 | @param LineNumber The line number in the source file that generated the assert condition\r |
2fc59a00 | 107 | @param Description The pointer to the description of the assert condition.\r |
e1f414b6 | 108 | \r |
109 | **/\r | |
110 | VOID\r | |
111 | EFIAPI\r | |
112 | DebugAssert (\r | |
113 | IN CONST CHAR8 *FileName,\r | |
114 | IN UINTN LineNumber,\r | |
115 | IN CONST CHAR8 *Description\r | |
116 | )\r | |
117 | {\r | |
118 | }\r | |
119 | \r | |
e1f414b6 | 120 | /**\r |
e1f414b6 | 121 | Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r |
122 | \r | |
9095d37b | 123 | This function fills Length bytes of Buffer with the value specified by\r |
e1f414b6 | 124 | PcdDebugClearMemoryValue, and returns Buffer.\r |
125 | \r | |
126 | If Buffer is NULL, then ASSERT().\r | |
9095d37b | 127 | If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r |
e1f414b6 | 128 | \r |
2fc59a00 | 129 | @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r |
9095d37b | 130 | @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.\r |
e1f414b6 | 131 | \r |
2fc59a00 | 132 | @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.\r |
e1f414b6 | 133 | \r |
134 | **/\r | |
135 | VOID *\r | |
136 | EFIAPI\r | |
137 | DebugClearMemory (\r | |
138 | OUT VOID *Buffer,\r | |
139 | IN UINTN Length\r | |
140 | )\r | |
141 | {\r | |
142 | return Buffer;\r | |
143 | }\r | |
144 | \r | |
e1f414b6 | 145 | /**\r |
e1f414b6 | 146 | Returns TRUE if ASSERT() macros are enabled.\r |
147 | \r | |
9095d37b | 148 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of\r |
e1f414b6 | 149 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r |
150 | \r | |
151 | @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r | |
152 | @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r | |
153 | \r | |
154 | **/\r | |
155 | BOOLEAN\r | |
156 | EFIAPI\r | |
157 | DebugAssertEnabled (\r | |
158 | VOID\r | |
159 | )\r | |
160 | {\r | |
161 | return FALSE;\r | |
162 | }\r | |
163 | \r | |
9095d37b | 164 | /**\r |
3e5c3238 | 165 | Returns TRUE if DEBUG() macros are enabled.\r |
e1f414b6 | 166 | \r |
9095d37b | 167 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of\r |
e1f414b6 | 168 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r |
169 | \r | |
170 | @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r | |
171 | @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r | |
172 | \r | |
173 | **/\r | |
174 | BOOLEAN\r | |
175 | EFIAPI\r | |
176 | DebugPrintEnabled (\r | |
177 | VOID\r | |
178 | )\r | |
179 | {\r | |
180 | return FALSE;\r | |
181 | }\r | |
182 | \r | |
9095d37b | 183 | /**\r |
3e5c3238 | 184 | Returns TRUE if DEBUG_CODE() macros are enabled.\r |
e1f414b6 | 185 | \r |
9095d37b | 186 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of\r |
e1f414b6 | 187 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r |
188 | \r | |
189 | @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r | |
190 | @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r | |
191 | \r | |
192 | **/\r | |
193 | BOOLEAN\r | |
194 | EFIAPI\r | |
195 | DebugCodeEnabled (\r | |
196 | VOID\r | |
197 | )\r | |
198 | {\r | |
199 | return FALSE;\r | |
200 | }\r | |
201 | \r | |
9095d37b | 202 | /**\r |
3e5c3238 | 203 | Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r |
e1f414b6 | 204 | \r |
9095d37b | 205 | This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of\r |
e1f414b6 | 206 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r |
207 | \r | |
eceb3a4c LG |
208 | @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r |
209 | @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r | |
e1f414b6 | 210 | \r |
211 | **/\r | |
212 | BOOLEAN\r | |
213 | EFIAPI\r | |
214 | DebugClearMemoryEnabled (\r | |
215 | VOID\r | |
216 | )\r | |
217 | {\r | |
218 | return FALSE;\r | |
219 | }\r | |
7c6c450a LG |
220 | \r |
221 | /**\r | |
222 | Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.\r | |
223 | \r | |
224 | This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.\r | |
225 | \r | |
226 | @retval TRUE Current ErrorLevel is supported.\r | |
227 | @retval FALSE Current ErrorLevel is not supported.\r | |
228 | \r | |
229 | **/\r | |
230 | BOOLEAN\r | |
231 | EFIAPI\r | |
232 | DebugPrintLevelEnabled (\r | |
2f88bd3a | 233 | IN CONST UINTN ErrorLevel\r |
7c6c450a LG |
234 | )\r |
235 | {\r | |
236 | return FALSE;\r | |
237 | }\r |