]> git.proxmox.com Git - mirror_edk2.git/blame - OldMdePkg/Library/BaseDebugLibNull/DebugLib.c
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Library / BaseDebugLibNull / DebugLib.c
CommitLineData
878ddf1f 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
878ddf1f 15/**\r
16\r
17 Prints a debug message to the debug output device if the specified error level is enabled.\r
18\r
19 If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
20 the message specified by Format and the associated variable argument list to \r
21 the debug output device.\r
22\r
23 If Format is NULL, then ASSERT().\r
24\r
25 @param ErrorLevel The error level of the debug message.\r
26 @param Format Format string for the debug message to print.\r
27\r
28**/\r
29VOID\r
30EFIAPI\r
31DebugPrint (\r
eb7a248b 32 IN UINTN ErrorLevel,\r
33 IN CONST CHAR8 *Format,\r
878ddf1f 34 ...\r
35 )\r
36{\r
878ddf1f 37}\r
38\r
39\r
40/**\r
41\r
42 Prints an assert message containing a filename, line number, and description. \r
43 This may be followed by a breakpoint or a dead loop.\r
44\r
8960cdeb 45 Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
878ddf1f 46 to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
47 PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
48 DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
49 CpuDeadLoop() is called. If neither of these bits are set, then this function \r
50 returns immediately after the message is printed to the debug output device.\r
51 DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while\r
52 processing another DebugAssert(), then DebugAssert() must return immediately.\r
53\r
8960cdeb 54 If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
878ddf1f 55\r
8960cdeb 56 If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
878ddf1f 57\r
58 @param FileName Pointer to the name of the source file that generated the assert condition.\r
59 @param LineNumber The line number in the source file that generated the assert condition\r
60 @param Description Pointer to the description of the assert condition.\r
61\r
62**/\r
63VOID\r
64EFIAPI\r
65DebugAssert (\r
eb7a248b 66 IN CONST CHAR8 *FileName,\r
cd14fe3d 67 IN UINTN LineNumber,\r
eb7a248b 68 IN CONST CHAR8 *Description\r
878ddf1f 69 )\r
70{\r
878ddf1f 71}\r
72\r
73\r
74/**\r
75\r
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
511710d6 83 If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
878ddf1f 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
88 @return Buffer\r
89\r
90**/\r
91VOID *\r
92EFIAPI\r
93DebugClearMemory (\r
94 OUT VOID *Buffer,\r
95 IN UINTN Length\r
96 )\r
97{\r
513b53b1 98 return Buffer;\r
878ddf1f 99}\r
100\r
101\r
102/**\r
103 \r
104 Returns TRUE if ASSERT() macros are enabled.\r
105\r
106 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
107 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
108\r
109 @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
110 @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
111\r
112**/\r
113BOOLEAN\r
114EFIAPI\r
115DebugAssertEnabled (\r
116 VOID\r
117 )\r
118{\r
513b53b1 119 return FALSE;\r
878ddf1f 120}\r
121\r
122\r
123/**\r
124 \r
125 Returns TRUE if DEBUG()macros are enabled.\r
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
132\r
133**/\r
134BOOLEAN\r
135EFIAPI\r
136DebugPrintEnabled (\r
137 VOID\r
138 )\r
139{\r
513b53b1 140 return FALSE;\r
878ddf1f 141}\r
142\r
143\r
144/**\r
145 \r
146 Returns TRUE if DEBUG_CODE()macros are enabled.\r
147\r
148 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
149 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
150\r
151 @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
152 @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
153\r
154**/\r
155BOOLEAN\r
156EFIAPI\r
157DebugCodeEnabled (\r
158 VOID\r
159 )\r
160{\r
513b53b1 161 return FALSE;\r
878ddf1f 162}\r
163\r
164\r
165/**\r
166 \r
167 Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r
168\r
169 This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r
170 PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
171\r
172 @retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
173 @retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
174\r
175**/\r
176BOOLEAN\r
177EFIAPI\r
178DebugClearMemoryEnabled (\r
179 VOID\r
180 )\r
181{\r
513b53b1 182 return FALSE;\r
878ddf1f 183}\r