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