]>
Commit | Line | Data |
---|---|---|
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 | |
37 | VOID\r | |
38 | EFIAPI\r | |
39 | DebugPrint (\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 | |
71 | VOID\r | |
72 | EFIAPI\r | |
73 | DebugAssert (\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 | |
96 | @return Buffer\r | |
97 | \r | |
98 | **/\r | |
99 | VOID *\r | |
100 | EFIAPI\r | |
101 | DebugClearMemory (\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 | |
119 | \r | |
120 | **/\r | |
121 | BOOLEAN\r | |
122 | EFIAPI\r | |
123 | DebugAssertEnabled (\r | |
124 | VOID\r | |
125 | )\r | |
126 | {\r | |
127 | return FALSE;\r | |
128 | }\r | |
129 | \r | |
130 | \r | |
131 | /**\r | |
132 | \r | |
133 | Returns TRUE if DEBUG()macros are enabled.\r | |
134 | \r | |
135 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r | |
136 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
137 | \r | |
138 | @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r | |
139 | @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r | |
140 | \r | |
141 | **/\r | |
142 | BOOLEAN\r | |
143 | EFIAPI\r | |
144 | DebugPrintEnabled (\r | |
145 | VOID\r | |
146 | )\r | |
147 | {\r | |
148 | return FALSE;\r | |
149 | }\r | |
150 | \r | |
151 | \r | |
152 | /**\r | |
153 | \r | |
154 | Returns TRUE if DEBUG_CODE()macros are enabled.\r | |
155 | \r | |
156 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
157 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
158 | \r | |
159 | @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r | |
160 | @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r | |
161 | \r | |
162 | **/\r | |
163 | BOOLEAN\r | |
164 | EFIAPI\r | |
165 | DebugCodeEnabled (\r | |
166 | VOID\r | |
167 | )\r | |
168 | {\r | |
169 | return FALSE;\r | |
170 | }\r | |
171 | \r | |
172 | \r | |
173 | /**\r | |
174 | \r | |
175 | Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r | |
176 | \r | |
177 | This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r | |
178 | PcdDebugProperyMask is set. Otherwise FALSE is returned.\r | |
179 | \r | |
180 | @retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r | |
181 | @retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r | |
182 | \r | |
183 | **/\r | |
184 | BOOLEAN\r | |
185 | EFIAPI\r | |
186 | DebugClearMemoryEnabled (\r | |
187 | VOID\r | |
188 | )\r | |
189 | {\r | |
190 | return FALSE;\r | |
191 | }\r |