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