]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseDebugLibNull/DebugLib.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseDebugLibNull / DebugLib.c
... / ...
CommitLineData
1/** @file\r
2 Null Base Debug Library instance with empty functions.\r
3\r
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#include <Base.h>\r
10#include <Library/DebugLib.h>\r
11\r
12/**\r
13 Prints a debug message to the debug output device if the specified error level is enabled.\r
14\r
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
17 associated variable argument list to the debug output device.\r
18\r
19 If Format is NULL, then ASSERT().\r
20\r
21 @param ErrorLevel The error level of the debug message.\r
22 @param Format Format string for the debug message to print.\r
23 @param ... Variable argument list whose contents are accessed\r
24 based on the format string specified by Format.\r
25\r
26**/\r
27VOID\r
28EFIAPI\r
29DebugPrint (\r
30 IN UINTN ErrorLevel,\r
31 IN CONST CHAR8 *Format,\r
32 ...\r
33 )\r
34{\r
35}\r
36\r
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
52VOID\r
53EFIAPI\r
54DebugVPrint (\r
55 IN UINTN ErrorLevel,\r
56 IN CONST CHAR8 *Format,\r
57 IN VA_LIST VaListMarker\r
58 )\r
59{\r
60}\r
61\r
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
79VOID\r
80EFIAPI\r
81DebugBPrint (\r
82 IN UINTN ErrorLevel,\r
83 IN CONST CHAR8 *Format,\r
84 IN BASE_LIST BaseListMarker\r
85 )\r
86{\r
87}\r
88\r
89/**\r
90 Prints an assert message containing a filename, line number, and description.\r
91 This may be followed by a breakpoint or a dead loop.\r
92\r
93 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r
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
98 returns immediately after the message is printed to the debug output device.\r
99 DebugAssert() must actively prevent recursion. If DebugAssert() is called while\r
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
103 If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
104\r
105 @param FileName The pointer to the name of the source file that generated the assert condition.\r
106 @param LineNumber The line number in the source file that generated the assert condition\r
107 @param Description The pointer to the description of the assert condition.\r
108\r
109**/\r
110VOID\r
111EFIAPI\r
112DebugAssert (\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
120/**\r
121 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
122\r
123 This function fills Length bytes of Buffer with the value specified by\r
124 PcdDebugClearMemoryValue, and returns Buffer.\r
125\r
126 If Buffer is NULL, then ASSERT().\r
127 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
128\r
129 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r
130 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.\r
131\r
132 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.\r
133\r
134**/\r
135VOID *\r
136EFIAPI\r
137DebugClearMemory (\r
138 OUT VOID *Buffer,\r
139 IN UINTN Length\r
140 )\r
141{\r
142 return Buffer;\r
143}\r
144\r
145/**\r
146 Returns TRUE if ASSERT() macros are enabled.\r
147\r
148 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of\r
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
155BOOLEAN\r
156EFIAPI\r
157DebugAssertEnabled (\r
158 VOID\r
159 )\r
160{\r
161 return FALSE;\r
162}\r
163\r
164/**\r
165 Returns TRUE if DEBUG() macros are enabled.\r
166\r
167 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of\r
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
174BOOLEAN\r
175EFIAPI\r
176DebugPrintEnabled (\r
177 VOID\r
178 )\r
179{\r
180 return FALSE;\r
181}\r
182\r
183/**\r
184 Returns TRUE if DEBUG_CODE() macros are enabled.\r
185\r
186 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of\r
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
193BOOLEAN\r
194EFIAPI\r
195DebugCodeEnabled (\r
196 VOID\r
197 )\r
198{\r
199 return FALSE;\r
200}\r
201\r
202/**\r
203 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
204\r
205 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of\r
206 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
207\r
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
210\r
211**/\r
212BOOLEAN\r
213EFIAPI\r
214DebugClearMemoryEnabled (\r
215 VOID\r
216 )\r
217{\r
218 return FALSE;\r
219}\r
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
230BOOLEAN\r
231EFIAPI\r
232DebugPrintLevelEnabled (\r
233 IN CONST UINTN ErrorLevel\r
234 )\r
235{\r
236 return FALSE;\r
237}\r