]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseDebugLibNull/DebugLib.c
MdePkg: Clean up source files
[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
9095d37b 4 Copyright (c) 2006 - 2018, 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
44/**\r
9095d37b 45 Prints an assert message containing a filename, line number, and description.\r
e1f414b6 46 This may be followed by a breakpoint or a dead loop.\r
47\r
3e5c3238 48 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r
9095d37b
LG
49 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of\r
50 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if\r
51 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then\r
52 CpuDeadLoop() is called. If neither of these bits are set, then this function\r
e1f414b6 53 returns immediately after the message is printed to the debug output device.\r
3e5c3238 54 DebugAssert() must actively prevent recursion. If DebugAssert() is called while\r
e1f414b6 55 processing another DebugAssert(), then DebugAssert() must return immediately.\r
56\r
57 If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
e1f414b6 58 If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
59\r
2fc59a00 60 @param FileName The pointer to the name of the source file that generated the assert condition.\r
e1f414b6 61 @param LineNumber The line number in the source file that generated the assert condition\r
2fc59a00 62 @param Description The pointer to the description of the assert condition.\r
e1f414b6 63\r
64**/\r
65VOID\r
66EFIAPI\r
67DebugAssert (\r
68 IN CONST CHAR8 *FileName,\r
69 IN UINTN LineNumber,\r
70 IN CONST CHAR8 *Description\r
71 )\r
72{\r
73}\r
74\r
75\r
76/**\r
e1f414b6 77 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
78\r
9095d37b 79 This function fills Length bytes of Buffer with the value specified by\r
e1f414b6 80 PcdDebugClearMemoryValue, and returns Buffer.\r
81\r
82 If Buffer is NULL, then ASSERT().\r
9095d37b 83 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
e1f414b6 84\r
2fc59a00 85 @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r
9095d37b 86 @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.\r
e1f414b6 87\r
2fc59a00 88 @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.\r
e1f414b6 89\r
90**/\r
91VOID *\r
92EFIAPI\r
93DebugClearMemory (\r
94 OUT VOID *Buffer,\r
95 IN UINTN Length\r
96 )\r
97{\r
98 return Buffer;\r
99}\r
100\r
101\r
102/**\r
e1f414b6 103 Returns TRUE if ASSERT() macros are enabled.\r
104\r
9095d37b 105 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of\r
e1f414b6 106 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
107\r
108 @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
109 @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
110\r
111**/\r
112BOOLEAN\r
113EFIAPI\r
114DebugAssertEnabled (\r
115 VOID\r
116 )\r
117{\r
118 return FALSE;\r
119}\r
120\r
121\r
9095d37b 122/**\r
3e5c3238 123 Returns TRUE if DEBUG() macros are enabled.\r
e1f414b6 124\r
9095d37b 125 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of\r
e1f414b6 126 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
127\r
128 @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
129 @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
130\r
131**/\r
132BOOLEAN\r
133EFIAPI\r
134DebugPrintEnabled (\r
135 VOID\r
136 )\r
137{\r
138 return FALSE;\r
139}\r
140\r
141\r
9095d37b 142/**\r
3e5c3238 143 Returns TRUE if DEBUG_CODE() macros are enabled.\r
e1f414b6 144\r
9095d37b 145 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of\r
e1f414b6 146 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
147\r
148 @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
149 @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
150\r
151**/\r
152BOOLEAN\r
153EFIAPI\r
154DebugCodeEnabled (\r
155 VOID\r
156 )\r
157{\r
158 return FALSE;\r
159}\r
160\r
161\r
9095d37b 162/**\r
3e5c3238 163 Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
e1f414b6 164\r
9095d37b 165 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of\r
e1f414b6 166 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
167\r
eceb3a4c
LG
168 @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
169 @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
e1f414b6 170\r
171**/\r
172BOOLEAN\r
173EFIAPI\r
174DebugClearMemoryEnabled (\r
175 VOID\r
176 )\r
177{\r
178 return FALSE;\r
179}\r
7c6c450a
LG
180\r
181/**\r
182 Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.\r
183\r
184 This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.\r
185\r
186 @retval TRUE Current ErrorLevel is supported.\r
187 @retval FALSE Current ErrorLevel is not supported.\r
188\r
189**/\r
190BOOLEAN\r
191EFIAPI\r
192DebugPrintLevelEnabled (\r
193 IN CONST UINTN ErrorLevel\r
194 )\r
195{\r
196 return FALSE;\r
197}\r
198\r