]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseDebugLibNull/DebugLib.c
Correct the wrong '?' character to '-', and add check DestinationBuffer == SourceBuff...
[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
eceb3a4c 4 Copyright (c) 2006 - 2008, Intel Corporation\r
e1f414b6 5 All rights reserved. This program and the accompanying materials\r
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
8 http://opensource.org/licenses/bsd-license.php\r
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
c892d846 15\r
c7d265a9 16#include <Base.h>\r
c7d265a9 17#include <Library/DebugLib.h>\r
e1f414b6 18\r
19/**\r
e1f414b6 20 Prints a debug message to the debug output device if the specified error level is enabled.\r
21\r
22 If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
23 the message specified by Format and the associated variable argument list to \r
24 the debug output device.\r
25\r
e1f414b6 26 @param ErrorLevel The error level of the debug message.\r
27 @param Format Format string for the debug message to print.\r
eceb3a4c 28 @param ... The variable argument list.\r
e1f414b6 29\r
30**/\r
31VOID\r
32EFIAPI\r
33DebugPrint (\r
34 IN UINTN ErrorLevel,\r
35 IN CONST CHAR8 *Format,\r
36 ...\r
37 )\r
38{\r
39}\r
40\r
41\r
42/**\r
e1f414b6 43 Prints an assert message containing a filename, line number, and description. \r
44 This may be followed by a breakpoint or a dead loop.\r
45\r
46 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
47 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
48 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
49 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
50 CpuDeadLoop() is called. If neither of these bits are set, then this function \r
51 returns immediately after the message is printed to the debug output device.\r
52 DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while\r
53 processing another DebugAssert(), then DebugAssert() must return immediately.\r
54\r
55 If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
56\r
57 If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
58\r
59 @param FileName Pointer to the name of the source file that generated the assert condition.\r
60 @param LineNumber The line number in the source file that generated the assert condition\r
61 @param Description Pointer to the description of the assert condition.\r
62\r
63**/\r
64VOID\r
65EFIAPI\r
66DebugAssert (\r
67 IN CONST CHAR8 *FileName,\r
68 IN UINTN LineNumber,\r
69 IN CONST CHAR8 *Description\r
70 )\r
71{\r
72}\r
73\r
74\r
75/**\r
e1f414b6 76 Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
77\r
78 This function fills Length bytes of Buffer with the value specified by \r
79 PcdDebugClearMemoryValue, and returns Buffer.\r
80\r
81 If Buffer is NULL, then ASSERT().\r
82\r
cc4e0485 83 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
e1f414b6 84\r
85 @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
86 @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
87\r
38bbd3d9 88 @return 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
105 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
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
38bbd3d9 110 \r
111 @return Always return FALSE.\r
e1f414b6 112\r
113**/\r
114BOOLEAN\r
115EFIAPI\r
116DebugAssertEnabled (\r
117 VOID\r
118 )\r
119{\r
120 return FALSE;\r
121}\r
122\r
123\r
124/**\r
ad400b07 125 Returns TRUE if the DEBUG() macro is enabled.\r
e1f414b6 126\r
127 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
128 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
129\r
130 @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
131 @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
38bbd3d9 132 \r
133 @return Always return FALSE.\r
e1f414b6 134\r
135**/\r
136BOOLEAN\r
137EFIAPI\r
138DebugPrintEnabled (\r
139 VOID\r
140 )\r
141{\r
142 return FALSE;\r
143}\r
144\r
145\r
146/**\r
ad400b07 147 Returns TRUE if the DEBUG_CODE() macros are enabled.\r
e1f414b6 148\r
149 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
150 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
151\r
152 @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
153 @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
38bbd3d9 154 \r
155 @return Always return FALSE.\r
e1f414b6 156\r
157**/\r
158BOOLEAN\r
159EFIAPI\r
160DebugCodeEnabled (\r
161 VOID\r
162 )\r
163{\r
164 return FALSE;\r
165}\r
166\r
167\r
168/**\r
ad400b07 169 Returns TRUE if the DEBUG_CLEAR_MEMORY() macro is enabled.\r
e1f414b6 170\r
eceb3a4c 171 This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of \r
e1f414b6 172 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
173\r
eceb3a4c
LG
174 @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
175 @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
38bbd3d9 176 \r
177 @return Always return FALSE.\r
e1f414b6 178\r
179**/\r
180BOOLEAN\r
181EFIAPI\r
182DebugClearMemoryEnabled (\r
183 VOID\r
184 )\r
185{\r
186 return FALSE;\r
187}\r