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