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