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