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