diff options
Diffstat (limited to 'drivers/acpi/utilities/utdebug.c')
-rw-r--r-- | drivers/acpi/utilities/utdebug.c | 400 |
1 files changed, 200 insertions, 200 deletions
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index 794c7df3f2ad..d80e92639932 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c | |||
@@ -46,15 +46,16 @@ | |||
46 | #include <acpi/acpi.h> | 46 | #include <acpi/acpi.h> |
47 | 47 | ||
48 | #define _COMPONENT ACPI_UTILITIES | 48 | #define _COMPONENT ACPI_UTILITIES |
49 | ACPI_MODULE_NAME ("utdebug") | 49 | ACPI_MODULE_NAME("utdebug") |
50 | |||
51 | 50 | ||
52 | #ifdef ACPI_DEBUG_OUTPUT | 51 | #ifdef ACPI_DEBUG_OUTPUT |
52 | static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; | ||
53 | static char *acpi_gbl_fn_entry_str = "----Entry"; | ||
54 | static char *acpi_gbl_fn_exit_str = "----Exit-"; | ||
53 | 55 | ||
54 | static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; | 56 | /* Local prototypes */ |
55 | static char *acpi_gbl_fn_entry_str = "----Entry"; | ||
56 | static char *acpi_gbl_fn_exit_str = "----Exit-"; | ||
57 | 57 | ||
58 | static const char *acpi_ut_trim_function_name(const char *function_name); | ||
58 | 59 | ||
59 | /******************************************************************************* | 60 | /******************************************************************************* |
60 | * | 61 | * |
@@ -68,17 +69,13 @@ static char *acpi_gbl_fn_exit_str = "----Exit-"; | |||
68 | * | 69 | * |
69 | ******************************************************************************/ | 70 | ******************************************************************************/ |
70 | 71 | ||
71 | void | 72 | void acpi_ut_init_stack_ptr_trace(void) |
72 | acpi_ut_init_stack_ptr_trace ( | ||
73 | void) | ||
74 | { | 73 | { |
75 | u32 current_sp; | 74 | u32 current_sp; |
76 | |||
77 | 75 | ||
78 | acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF (¤t_sp, NULL); | 76 | acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF(¤t_sp, NULL); |
79 | } | 77 | } |
80 | 78 | ||
81 | |||
82 | /******************************************************************************* | 79 | /******************************************************************************* |
83 | * | 80 | * |
84 | * FUNCTION: acpi_ut_track_stack_ptr | 81 | * FUNCTION: acpi_ut_track_stack_ptr |
@@ -91,14 +88,11 @@ acpi_ut_init_stack_ptr_trace ( | |||
91 | * | 88 | * |
92 | ******************************************************************************/ | 89 | ******************************************************************************/ |
93 | 90 | ||
94 | void | 91 | void acpi_ut_track_stack_ptr(void) |
95 | acpi_ut_track_stack_ptr ( | ||
96 | void) | ||
97 | { | 92 | { |
98 | acpi_size current_sp; | 93 | acpi_size current_sp; |
99 | |||
100 | 94 | ||
101 | current_sp = ACPI_PTR_DIFF (¤t_sp, NULL); | 95 | current_sp = ACPI_PTR_DIFF(¤t_sp, NULL); |
102 | 96 | ||
103 | if (current_sp < acpi_gbl_lowest_stack_pointer) { | 97 | if (current_sp < acpi_gbl_lowest_stack_pointer) { |
104 | acpi_gbl_lowest_stack_pointer = current_sp; | 98 | acpi_gbl_lowest_stack_pointer = current_sp; |
@@ -109,6 +103,39 @@ acpi_ut_track_stack_ptr ( | |||
109 | } | 103 | } |
110 | } | 104 | } |
111 | 105 | ||
106 | /******************************************************************************* | ||
107 | * | ||
108 | * FUNCTION: acpi_ut_trim_function_name | ||
109 | * | ||
110 | * PARAMETERS: function_name - Ascii string containing a procedure name | ||
111 | * | ||
112 | * RETURN: Updated pointer to the function name | ||
113 | * | ||
114 | * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present. | ||
115 | * This allows compiler macros such as __FUNCTION__ to be used | ||
116 | * with no change to the debug output. | ||
117 | * | ||
118 | ******************************************************************************/ | ||
119 | |||
120 | static const char *acpi_ut_trim_function_name(const char *function_name) | ||
121 | { | ||
122 | |||
123 | /* All Function names are longer than 4 chars, check is safe */ | ||
124 | |||
125 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { | ||
126 | /* This is the case where the original source has not been modified */ | ||
127 | |||
128 | return (function_name + 4); | ||
129 | } | ||
130 | |||
131 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { | ||
132 | /* This is the case where the source has been 'linuxized' */ | ||
133 | |||
134 | return (function_name + 5); | ||
135 | } | ||
136 | |||
137 | return (function_name); | ||
138 | } | ||
112 | 139 | ||
113 | /******************************************************************************* | 140 | /******************************************************************************* |
114 | * | 141 | * |
@@ -116,10 +143,9 @@ acpi_ut_track_stack_ptr ( | |||
116 | * | 143 | * |
117 | * PARAMETERS: requested_debug_level - Requested debug print level | 144 | * PARAMETERS: requested_debug_level - Requested debug print level |
118 | * line_number - Caller's line number (for error output) | 145 | * line_number - Caller's line number (for error output) |
119 | * dbg_info - Contains: | 146 | * function_name - Caller's procedure name |
120 | * proc_name - Caller's procedure name | 147 | * module_name - Caller's module name |
121 | * module_name - Caller's module name | 148 | * component_id - Caller's component ID |
122 | * component_id - Caller's component ID | ||
123 | * Format - Printf format field | 149 | * Format - Printf format field |
124 | * ... - Optional printf arguments | 150 | * ... - Optional printf arguments |
125 | * | 151 | * |
@@ -130,36 +156,33 @@ acpi_ut_track_stack_ptr ( | |||
130 | * | 156 | * |
131 | ******************************************************************************/ | 157 | ******************************************************************************/ |
132 | 158 | ||
133 | void ACPI_INTERNAL_VAR_XFACE | 159 | void ACPI_INTERNAL_VAR_XFACE |
134 | acpi_ut_debug_print ( | 160 | acpi_ut_debug_print(u32 requested_debug_level, |
135 | u32 requested_debug_level, | 161 | u32 line_number, |
136 | u32 line_number, | 162 | const char *function_name, |
137 | struct acpi_debug_print_info *dbg_info, | 163 | char *module_name, u32 component_id, char *format, ...) |
138 | char *format, | ||
139 | ...) | ||
140 | { | 164 | { |
141 | u32 thread_id; | 165 | u32 thread_id; |
142 | va_list args; | 166 | va_list args; |
143 | |||
144 | 167 | ||
145 | /* | 168 | /* |
146 | * Stay silent if the debug level or component ID is disabled | 169 | * Stay silent if the debug level or component ID is disabled |
147 | */ | 170 | */ |
148 | if (!(requested_debug_level & acpi_dbg_level) || | 171 | if (!(requested_debug_level & acpi_dbg_level) || |
149 | !(dbg_info->component_id & acpi_dbg_layer)) { | 172 | !(component_id & acpi_dbg_layer)) { |
150 | return; | 173 | return; |
151 | } | 174 | } |
152 | 175 | ||
153 | /* | 176 | /* |
154 | * Thread tracking and context switch notification | 177 | * Thread tracking and context switch notification |
155 | */ | 178 | */ |
156 | thread_id = acpi_os_get_thread_id (); | 179 | thread_id = acpi_os_get_thread_id(); |
157 | 180 | ||
158 | if (thread_id != acpi_gbl_prev_thread_id) { | 181 | if (thread_id != acpi_gbl_prev_thread_id) { |
159 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 182 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
160 | acpi_os_printf ( | 183 | acpi_os_printf |
161 | "\n**** Context Switch from TID %X to TID %X ****\n\n", | 184 | ("\n**** Context Switch from TID %X to TID %X ****\n\n", |
162 | acpi_gbl_prev_thread_id, thread_id); | 185 | acpi_gbl_prev_thread_id, thread_id); |
163 | } | 186 | } |
164 | 187 | ||
165 | acpi_gbl_prev_thread_id = thread_id; | 188 | acpi_gbl_prev_thread_id = thread_id; |
@@ -169,17 +192,18 @@ acpi_ut_debug_print ( | |||
169 | * Display the module name, current line number, thread ID (if requested), | 192 | * Display the module name, current line number, thread ID (if requested), |
170 | * current procedure nesting level, and the current procedure name | 193 | * current procedure nesting level, and the current procedure name |
171 | */ | 194 | */ |
172 | acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number); | 195 | acpi_os_printf("%8s-%04ld ", module_name, line_number); |
173 | 196 | ||
174 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 197 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
175 | acpi_os_printf ("[%04lX] ", thread_id); | 198 | acpi_os_printf("[%04lX] ", thread_id); |
176 | } | 199 | } |
177 | 200 | ||
178 | acpi_os_printf ("[%02ld] %-22.22s: ", | 201 | acpi_os_printf("[%02ld] %-22.22s: ", |
179 | acpi_gbl_nesting_level, dbg_info->proc_name); | 202 | acpi_gbl_nesting_level, |
203 | acpi_ut_trim_function_name(function_name)); | ||
180 | 204 | ||
181 | va_start (args, format); | 205 | va_start(args, format); |
182 | acpi_os_vprintf (format, args); | 206 | acpi_os_vprintf(format, args); |
183 | } | 207 | } |
184 | 208 | ||
185 | EXPORT_SYMBOL(acpi_ut_debug_print); | 209 | EXPORT_SYMBOL(acpi_ut_debug_print); |
@@ -190,10 +214,9 @@ EXPORT_SYMBOL(acpi_ut_debug_print); | |||
190 | * | 214 | * |
191 | * PARAMETERS: requested_debug_level - Requested debug print level | 215 | * PARAMETERS: requested_debug_level - Requested debug print level |
192 | * line_number - Caller's line number | 216 | * line_number - Caller's line number |
193 | * dbg_info - Contains: | 217 | * function_name - Caller's procedure name |
194 | * proc_name - Caller's procedure name | 218 | * module_name - Caller's module name |
195 | * module_name - Caller's module name | 219 | * component_id - Caller's component ID |
196 | * component_id - Caller's component ID | ||
197 | * Format - Printf format field | 220 | * Format - Printf format field |
198 | * ... - Optional printf arguments | 221 | * ... - Optional printf arguments |
199 | * | 222 | * |
@@ -204,37 +227,33 @@ EXPORT_SYMBOL(acpi_ut_debug_print); | |||
204 | * | 227 | * |
205 | ******************************************************************************/ | 228 | ******************************************************************************/ |
206 | 229 | ||
207 | void ACPI_INTERNAL_VAR_XFACE | 230 | void ACPI_INTERNAL_VAR_XFACE |
208 | acpi_ut_debug_print_raw ( | 231 | acpi_ut_debug_print_raw(u32 requested_debug_level, |
209 | u32 requested_debug_level, | 232 | u32 line_number, |
210 | u32 line_number, | 233 | const char *function_name, |
211 | struct acpi_debug_print_info *dbg_info, | 234 | char *module_name, u32 component_id, char *format, ...) |
212 | char *format, | ||
213 | ...) | ||
214 | { | 235 | { |
215 | va_list args; | 236 | va_list args; |
216 | |||
217 | 237 | ||
218 | if (!(requested_debug_level & acpi_dbg_level) || | 238 | if (!(requested_debug_level & acpi_dbg_level) || |
219 | !(dbg_info->component_id & acpi_dbg_layer)) { | 239 | !(component_id & acpi_dbg_layer)) { |
220 | return; | 240 | return; |
221 | } | 241 | } |
222 | 242 | ||
223 | va_start (args, format); | 243 | va_start(args, format); |
224 | acpi_os_vprintf (format, args); | 244 | acpi_os_vprintf(format, args); |
225 | } | 245 | } |
226 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); | ||
227 | 246 | ||
247 | EXPORT_SYMBOL(acpi_ut_debug_print_raw); | ||
228 | 248 | ||
229 | /******************************************************************************* | 249 | /******************************************************************************* |
230 | * | 250 | * |
231 | * FUNCTION: acpi_ut_trace | 251 | * FUNCTION: acpi_ut_trace |
232 | * | 252 | * |
233 | * PARAMETERS: line_number - Caller's line number | 253 | * PARAMETERS: line_number - Caller's line number |
234 | * dbg_info - Contains: | 254 | * function_name - Caller's procedure name |
235 | * proc_name - Caller's procedure name | 255 | * module_name - Caller's module name |
236 | * module_name - Caller's module name | 256 | * component_id - Caller's component ID |
237 | * component_id - Caller's component ID | ||
238 | * | 257 | * |
239 | * RETURN: None | 258 | * RETURN: None |
240 | * | 259 | * |
@@ -244,29 +263,28 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw); | |||
244 | ******************************************************************************/ | 263 | ******************************************************************************/ |
245 | 264 | ||
246 | void | 265 | void |
247 | acpi_ut_trace ( | 266 | acpi_ut_trace(u32 line_number, |
248 | u32 line_number, | 267 | const char *function_name, char *module_name, u32 component_id) |
249 | struct acpi_debug_print_info *dbg_info) | ||
250 | { | 268 | { |
251 | 269 | ||
252 | acpi_gbl_nesting_level++; | 270 | acpi_gbl_nesting_level++; |
253 | acpi_ut_track_stack_ptr (); | 271 | acpi_ut_track_stack_ptr(); |
254 | 272 | ||
255 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 273 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
256 | "%s\n", acpi_gbl_fn_entry_str); | 274 | line_number, function_name, module_name, |
275 | component_id, "%s\n", acpi_gbl_fn_entry_str); | ||
257 | } | 276 | } |
258 | EXPORT_SYMBOL(acpi_ut_trace); | ||
259 | 277 | ||
278 | EXPORT_SYMBOL(acpi_ut_trace); | ||
260 | 279 | ||
261 | /******************************************************************************* | 280 | /******************************************************************************* |
262 | * | 281 | * |
263 | * FUNCTION: acpi_ut_trace_ptr | 282 | * FUNCTION: acpi_ut_trace_ptr |
264 | * | 283 | * |
265 | * PARAMETERS: line_number - Caller's line number | 284 | * PARAMETERS: line_number - Caller's line number |
266 | * dbg_info - Contains: | 285 | * function_name - Caller's procedure name |
267 | * proc_name - Caller's procedure name | 286 | * module_name - Caller's module name |
268 | * module_name - Caller's module name | 287 | * component_id - Caller's component ID |
269 | * component_id - Caller's component ID | ||
270 | * Pointer - Pointer to display | 288 | * Pointer - Pointer to display |
271 | * | 289 | * |
272 | * RETURN: None | 290 | * RETURN: None |
@@ -277,28 +295,27 @@ EXPORT_SYMBOL(acpi_ut_trace); | |||
277 | ******************************************************************************/ | 295 | ******************************************************************************/ |
278 | 296 | ||
279 | void | 297 | void |
280 | acpi_ut_trace_ptr ( | 298 | acpi_ut_trace_ptr(u32 line_number, |
281 | u32 line_number, | 299 | const char *function_name, |
282 | struct acpi_debug_print_info *dbg_info, | 300 | char *module_name, u32 component_id, void *pointer) |
283 | void *pointer) | ||
284 | { | 301 | { |
285 | acpi_gbl_nesting_level++; | 302 | acpi_gbl_nesting_level++; |
286 | acpi_ut_track_stack_ptr (); | 303 | acpi_ut_track_stack_ptr(); |
287 | 304 | ||
288 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 305 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
289 | "%s %p\n", acpi_gbl_fn_entry_str, pointer); | 306 | line_number, function_name, module_name, |
307 | component_id, "%s %p\n", acpi_gbl_fn_entry_str, | ||
308 | pointer); | ||
290 | } | 309 | } |
291 | 310 | ||
292 | |||
293 | /******************************************************************************* | 311 | /******************************************************************************* |
294 | * | 312 | * |
295 | * FUNCTION: acpi_ut_trace_str | 313 | * FUNCTION: acpi_ut_trace_str |
296 | * | 314 | * |
297 | * PARAMETERS: line_number - Caller's line number | 315 | * PARAMETERS: line_number - Caller's line number |
298 | * dbg_info - Contains: | 316 | * function_name - Caller's procedure name |
299 | * proc_name - Caller's procedure name | 317 | * module_name - Caller's module name |
300 | * module_name - Caller's module name | 318 | * component_id - Caller's component ID |
301 | * component_id - Caller's component ID | ||
302 | * String - Additional string to display | 319 | * String - Additional string to display |
303 | * | 320 | * |
304 | * RETURN: None | 321 | * RETURN: None |
@@ -309,29 +326,28 @@ acpi_ut_trace_ptr ( | |||
309 | ******************************************************************************/ | 326 | ******************************************************************************/ |
310 | 327 | ||
311 | void | 328 | void |
312 | acpi_ut_trace_str ( | 329 | acpi_ut_trace_str(u32 line_number, |
313 | u32 line_number, | 330 | const char *function_name, |
314 | struct acpi_debug_print_info *dbg_info, | 331 | char *module_name, u32 component_id, char *string) |
315 | char *string) | ||
316 | { | 332 | { |
317 | 333 | ||
318 | acpi_gbl_nesting_level++; | 334 | acpi_gbl_nesting_level++; |
319 | acpi_ut_track_stack_ptr (); | 335 | acpi_ut_track_stack_ptr(); |
320 | 336 | ||
321 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 337 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
322 | "%s %s\n", acpi_gbl_fn_entry_str, string); | 338 | line_number, function_name, module_name, |
339 | component_id, "%s %s\n", acpi_gbl_fn_entry_str, | ||
340 | string); | ||
323 | } | 341 | } |
324 | 342 | ||
325 | |||
326 | /******************************************************************************* | 343 | /******************************************************************************* |
327 | * | 344 | * |
328 | * FUNCTION: acpi_ut_trace_u32 | 345 | * FUNCTION: acpi_ut_trace_u32 |
329 | * | 346 | * |
330 | * PARAMETERS: line_number - Caller's line number | 347 | * PARAMETERS: line_number - Caller's line number |
331 | * dbg_info - Contains: | 348 | * function_name - Caller's procedure name |
332 | * proc_name - Caller's procedure name | 349 | * module_name - Caller's module name |
333 | * module_name - Caller's module name | 350 | * component_id - Caller's component ID |
334 | * component_id - Caller's component ID | ||
335 | * Integer - Integer to display | 351 | * Integer - Integer to display |
336 | * | 352 | * |
337 | * RETURN: None | 353 | * RETURN: None |
@@ -342,29 +358,28 @@ acpi_ut_trace_str ( | |||
342 | ******************************************************************************/ | 358 | ******************************************************************************/ |
343 | 359 | ||
344 | void | 360 | void |
345 | acpi_ut_trace_u32 ( | 361 | acpi_ut_trace_u32(u32 line_number, |
346 | u32 line_number, | 362 | const char *function_name, |
347 | struct acpi_debug_print_info *dbg_info, | 363 | char *module_name, u32 component_id, u32 integer) |
348 | u32 integer) | ||
349 | { | 364 | { |
350 | 365 | ||
351 | acpi_gbl_nesting_level++; | 366 | acpi_gbl_nesting_level++; |
352 | acpi_ut_track_stack_ptr (); | 367 | acpi_ut_track_stack_ptr(); |
353 | 368 | ||
354 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 369 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
355 | "%s %08X\n", acpi_gbl_fn_entry_str, integer); | 370 | line_number, function_name, module_name, |
371 | component_id, "%s %08X\n", acpi_gbl_fn_entry_str, | ||
372 | integer); | ||
356 | } | 373 | } |
357 | 374 | ||
358 | |||
359 | /******************************************************************************* | 375 | /******************************************************************************* |
360 | * | 376 | * |
361 | * FUNCTION: acpi_ut_exit | 377 | * FUNCTION: acpi_ut_exit |
362 | * | 378 | * |
363 | * PARAMETERS: line_number - Caller's line number | 379 | * PARAMETERS: line_number - Caller's line number |
364 | * dbg_info - Contains: | 380 | * function_name - Caller's procedure name |
365 | * proc_name - Caller's procedure name | 381 | * module_name - Caller's module name |
366 | * module_name - Caller's module name | 382 | * component_id - Caller's component ID |
367 | * component_id - Caller's component ID | ||
368 | * | 383 | * |
369 | * RETURN: None | 384 | * RETURN: None |
370 | * | 385 | * |
@@ -374,28 +389,27 @@ acpi_ut_trace_u32 ( | |||
374 | ******************************************************************************/ | 389 | ******************************************************************************/ |
375 | 390 | ||
376 | void | 391 | void |
377 | acpi_ut_exit ( | 392 | acpi_ut_exit(u32 line_number, |
378 | u32 line_number, | 393 | const char *function_name, char *module_name, u32 component_id) |
379 | struct acpi_debug_print_info *dbg_info) | ||
380 | { | 394 | { |
381 | 395 | ||
382 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 396 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
383 | "%s\n", acpi_gbl_fn_exit_str); | 397 | line_number, function_name, module_name, |
398 | component_id, "%s\n", acpi_gbl_fn_exit_str); | ||
384 | 399 | ||
385 | acpi_gbl_nesting_level--; | 400 | acpi_gbl_nesting_level--; |
386 | } | 401 | } |
387 | EXPORT_SYMBOL(acpi_ut_exit); | ||
388 | 402 | ||
403 | EXPORT_SYMBOL(acpi_ut_exit); | ||
389 | 404 | ||
390 | /******************************************************************************* | 405 | /******************************************************************************* |
391 | * | 406 | * |
392 | * FUNCTION: acpi_ut_status_exit | 407 | * FUNCTION: acpi_ut_status_exit |
393 | * | 408 | * |
394 | * PARAMETERS: line_number - Caller's line number | 409 | * PARAMETERS: line_number - Caller's line number |
395 | * dbg_info - Contains: | 410 | * function_name - Caller's procedure name |
396 | * proc_name - Caller's procedure name | 411 | * module_name - Caller's module name |
397 | * module_name - Caller's module name | 412 | * component_id - Caller's component ID |
398 | * component_id - Caller's component ID | ||
399 | * Status - Exit status code | 413 | * Status - Exit status code |
400 | * | 414 | * |
401 | * RETURN: None | 415 | * RETURN: None |
@@ -406,37 +420,38 @@ EXPORT_SYMBOL(acpi_ut_exit); | |||
406 | ******************************************************************************/ | 420 | ******************************************************************************/ |
407 | 421 | ||
408 | void | 422 | void |
409 | acpi_ut_status_exit ( | 423 | acpi_ut_status_exit(u32 line_number, |
410 | u32 line_number, | 424 | const char *function_name, |
411 | struct acpi_debug_print_info *dbg_info, | 425 | char *module_name, u32 component_id, acpi_status status) |
412 | acpi_status status) | ||
413 | { | 426 | { |
414 | 427 | ||
415 | if (ACPI_SUCCESS (status)) { | 428 | if (ACPI_SUCCESS(status)) { |
416 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 429 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
417 | "%s %s\n", acpi_gbl_fn_exit_str, | 430 | line_number, function_name, module_name, |
418 | acpi_format_exception (status)); | 431 | component_id, "%s %s\n", |
419 | } | 432 | acpi_gbl_fn_exit_str, |
420 | else { | 433 | acpi_format_exception(status)); |
421 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 434 | } else { |
422 | "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str, | 435 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
423 | acpi_format_exception (status)); | 436 | line_number, function_name, module_name, |
437 | component_id, "%s ****Exception****: %s\n", | ||
438 | acpi_gbl_fn_exit_str, | ||
439 | acpi_format_exception(status)); | ||
424 | } | 440 | } |
425 | 441 | ||
426 | acpi_gbl_nesting_level--; | 442 | acpi_gbl_nesting_level--; |
427 | } | 443 | } |
428 | EXPORT_SYMBOL(acpi_ut_status_exit); | ||
429 | 444 | ||
445 | EXPORT_SYMBOL(acpi_ut_status_exit); | ||
430 | 446 | ||
431 | /******************************************************************************* | 447 | /******************************************************************************* |
432 | * | 448 | * |
433 | * FUNCTION: acpi_ut_value_exit | 449 | * FUNCTION: acpi_ut_value_exit |
434 | * | 450 | * |
435 | * PARAMETERS: line_number - Caller's line number | 451 | * PARAMETERS: line_number - Caller's line number |
436 | * dbg_info - Contains: | 452 | * function_name - Caller's procedure name |
437 | * proc_name - Caller's procedure name | 453 | * module_name - Caller's module name |
438 | * module_name - Caller's module name | 454 | * component_id - Caller's component ID |
439 | * component_id - Caller's component ID | ||
440 | * Value - Value to be printed with exit msg | 455 | * Value - Value to be printed with exit msg |
441 | * | 456 | * |
442 | * RETURN: None | 457 | * RETURN: None |
@@ -447,30 +462,29 @@ EXPORT_SYMBOL(acpi_ut_status_exit); | |||
447 | ******************************************************************************/ | 462 | ******************************************************************************/ |
448 | 463 | ||
449 | void | 464 | void |
450 | acpi_ut_value_exit ( | 465 | acpi_ut_value_exit(u32 line_number, |
451 | u32 line_number, | 466 | const char *function_name, |
452 | struct acpi_debug_print_info *dbg_info, | 467 | char *module_name, u32 component_id, acpi_integer value) |
453 | acpi_integer value) | ||
454 | { | 468 | { |
455 | 469 | ||
456 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 470 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
457 | "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, | 471 | line_number, function_name, module_name, |
458 | ACPI_FORMAT_UINT64 (value)); | 472 | component_id, "%s %8.8X%8.8X\n", |
473 | acpi_gbl_fn_exit_str, ACPI_FORMAT_UINT64(value)); | ||
459 | 474 | ||
460 | acpi_gbl_nesting_level--; | 475 | acpi_gbl_nesting_level--; |
461 | } | 476 | } |
462 | EXPORT_SYMBOL(acpi_ut_value_exit); | ||
463 | 477 | ||
478 | EXPORT_SYMBOL(acpi_ut_value_exit); | ||
464 | 479 | ||
465 | /******************************************************************************* | 480 | /******************************************************************************* |
466 | * | 481 | * |
467 | * FUNCTION: acpi_ut_ptr_exit | 482 | * FUNCTION: acpi_ut_ptr_exit |
468 | * | 483 | * |
469 | * PARAMETERS: line_number - Caller's line number | 484 | * PARAMETERS: line_number - Caller's line number |
470 | * dbg_info - Contains: | 485 | * function_name - Caller's procedure name |
471 | * proc_name - Caller's procedure name | 486 | * module_name - Caller's module name |
472 | * module_name - Caller's module name | 487 | * component_id - Caller's component ID |
473 | * component_id - Caller's component ID | ||
474 | * Ptr - Pointer to display | 488 | * Ptr - Pointer to display |
475 | * | 489 | * |
476 | * RETURN: None | 490 | * RETURN: None |
@@ -481,21 +495,20 @@ EXPORT_SYMBOL(acpi_ut_value_exit); | |||
481 | ******************************************************************************/ | 495 | ******************************************************************************/ |
482 | 496 | ||
483 | void | 497 | void |
484 | acpi_ut_ptr_exit ( | 498 | acpi_ut_ptr_exit(u32 line_number, |
485 | u32 line_number, | 499 | const char *function_name, |
486 | struct acpi_debug_print_info *dbg_info, | 500 | char *module_name, u32 component_id, u8 * ptr) |
487 | u8 *ptr) | ||
488 | { | 501 | { |
489 | 502 | ||
490 | acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, | 503 | acpi_ut_debug_print(ACPI_LV_FUNCTIONS, |
491 | "%s %p\n", acpi_gbl_fn_exit_str, ptr); | 504 | line_number, function_name, module_name, |
505 | component_id, "%s %p\n", acpi_gbl_fn_exit_str, ptr); | ||
492 | 506 | ||
493 | acpi_gbl_nesting_level--; | 507 | acpi_gbl_nesting_level--; |
494 | } | 508 | } |
495 | 509 | ||
496 | #endif | 510 | #endif |
497 | 511 | ||
498 | |||
499 | /******************************************************************************* | 512 | /******************************************************************************* |
500 | * | 513 | * |
501 | * FUNCTION: acpi_ut_dump_buffer | 514 | * FUNCTION: acpi_ut_dump_buffer |
@@ -511,23 +524,17 @@ acpi_ut_ptr_exit ( | |||
511 | * | 524 | * |
512 | ******************************************************************************/ | 525 | ******************************************************************************/ |
513 | 526 | ||
514 | void | 527 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id) |
515 | acpi_ut_dump_buffer ( | ||
516 | u8 *buffer, | ||
517 | u32 count, | ||
518 | u32 display, | ||
519 | u32 component_id) | ||
520 | { | 528 | { |
521 | acpi_native_uint i = 0; | 529 | acpi_native_uint i = 0; |
522 | acpi_native_uint j; | 530 | acpi_native_uint j; |
523 | u32 temp32; | 531 | u32 temp32; |
524 | u8 buf_char; | 532 | u8 buf_char; |
525 | |||
526 | 533 | ||
527 | /* Only dump the buffer if tracing is enabled */ | 534 | /* Only dump the buffer if tracing is enabled */ |
528 | 535 | ||
529 | if (!((ACPI_LV_TABLES & acpi_dbg_level) && | 536 | if (!((ACPI_LV_TABLES & acpi_dbg_level) && |
530 | (component_id & acpi_dbg_layer))) { | 537 | (component_id & acpi_dbg_layer))) { |
531 | return; | 538 | return; |
532 | } | 539 | } |
533 | 540 | ||
@@ -540,7 +547,7 @@ acpi_ut_dump_buffer ( | |||
540 | while (i < count) { | 547 | while (i < count) { |
541 | /* Print current offset */ | 548 | /* Print current offset */ |
542 | 549 | ||
543 | acpi_os_printf ("%6.4X: ", (u32) i); | 550 | acpi_os_printf("%6.4X: ", (u32) i); |
544 | 551 | ||
545 | /* Print 16 hex chars */ | 552 | /* Print 16 hex chars */ |
546 | 553 | ||
@@ -548,73 +555,66 @@ acpi_ut_dump_buffer ( | |||
548 | if (i + j >= count) { | 555 | if (i + j >= count) { |
549 | /* Dump fill spaces */ | 556 | /* Dump fill spaces */ |
550 | 557 | ||
551 | acpi_os_printf ("%*s", ((display * 2) + 1), " "); | 558 | acpi_os_printf("%*s", ((display * 2) + 1), " "); |
552 | j += display; | 559 | j += (acpi_native_uint) display; |
553 | continue; | 560 | continue; |
554 | } | 561 | } |
555 | 562 | ||
556 | switch (display) { | 563 | switch (display) { |
557 | default: /* Default is BYTE display */ | 564 | default: /* Default is BYTE display */ |
558 | 565 | ||
559 | acpi_os_printf ("%02X ", buffer[i + j]); | 566 | acpi_os_printf("%02X ", buffer[i + j]); |
560 | break; | 567 | break; |
561 | 568 | ||
562 | |||
563 | case DB_WORD_DISPLAY: | 569 | case DB_WORD_DISPLAY: |
564 | 570 | ||
565 | ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]); | 571 | ACPI_MOVE_16_TO_32(&temp32, &buffer[i + j]); |
566 | acpi_os_printf ("%04X ", temp32); | 572 | acpi_os_printf("%04X ", temp32); |
567 | break; | 573 | break; |
568 | 574 | ||
569 | |||
570 | case DB_DWORD_DISPLAY: | 575 | case DB_DWORD_DISPLAY: |
571 | 576 | ||
572 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); | 577 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); |
573 | acpi_os_printf ("%08X ", temp32); | 578 | acpi_os_printf("%08X ", temp32); |
574 | break; | 579 | break; |
575 | 580 | ||
576 | |||
577 | case DB_QWORD_DISPLAY: | 581 | case DB_QWORD_DISPLAY: |
578 | 582 | ||
579 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]); | 583 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]); |
580 | acpi_os_printf ("%08X", temp32); | 584 | acpi_os_printf("%08X", temp32); |
581 | 585 | ||
582 | ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]); | 586 | ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j + 4]); |
583 | acpi_os_printf ("%08X ", temp32); | 587 | acpi_os_printf("%08X ", temp32); |
584 | break; | 588 | break; |
585 | } | 589 | } |
586 | 590 | ||
587 | j += display; | 591 | j += (acpi_native_uint) display; |
588 | } | 592 | } |
589 | 593 | ||
590 | /* | 594 | /* |
591 | * Print the ASCII equivalent characters | 595 | * Print the ASCII equivalent characters but watch out for the bad |
592 | * But watch out for the bad unprintable ones... | 596 | * unprintable ones (printable chars are 0x20 through 0x7E) |
593 | */ | 597 | */ |
594 | acpi_os_printf (" "); | 598 | acpi_os_printf(" "); |
595 | for (j = 0; j < 16; j++) { | 599 | for (j = 0; j < 16; j++) { |
596 | if (i + j >= count) { | 600 | if (i + j >= count) { |
597 | acpi_os_printf ("\n"); | 601 | acpi_os_printf("\n"); |
598 | return; | 602 | return; |
599 | } | 603 | } |
600 | 604 | ||
601 | buf_char = buffer[i + j]; | 605 | buf_char = buffer[i + j]; |
602 | if ((buf_char > 0x1F && buf_char < 0x2E) || | 606 | if (ACPI_IS_PRINT(buf_char)) { |
603 | (buf_char > 0x2F && buf_char < 0x61) || | 607 | acpi_os_printf("%c", buf_char); |
604 | (buf_char > 0x60 && buf_char < 0x7F)) { | 608 | } else { |
605 | acpi_os_printf ("%c", buf_char); | 609 | acpi_os_printf("."); |
606 | } | ||
607 | else { | ||
608 | acpi_os_printf ("."); | ||
609 | } | 610 | } |
610 | } | 611 | } |
611 | 612 | ||
612 | /* Done with that line. */ | 613 | /* Done with that line. */ |
613 | 614 | ||
614 | acpi_os_printf ("\n"); | 615 | acpi_os_printf("\n"); |
615 | i += 16; | 616 | i += 16; |
616 | } | 617 | } |
617 | 618 | ||
618 | return; | 619 | return; |
619 | } | 620 | } |
620 | |||