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