aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exdump.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/executer/exdump.c
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exdump.c')
-rw-r--r--drivers/acpi/executer/exdump.c105
1 files changed, 73 insertions, 32 deletions
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index e2f7c32f28de..408500648114 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -51,23 +51,48 @@
51#define _COMPONENT ACPI_EXECUTER 51#define _COMPONENT ACPI_EXECUTER
52 ACPI_MODULE_NAME ("exdump") 52 ACPI_MODULE_NAME ("exdump")
53 53
54/* Local prototypes */
55
56#ifdef ACPI_FUTURE_USAGE
57static void
58acpi_ex_out_string (
59 char *title,
60 char *value);
61
62static void
63acpi_ex_out_pointer (
64 char *title,
65 void *value);
66
67static void
68acpi_ex_out_integer (
69 char *title,
70 u32 value);
71
72static void
73acpi_ex_out_address (
74 char *title,
75 acpi_physical_address value);
76#endif /* ACPI_FUTURE_USAGE */
77
54 78
55/* 79/*
56 * The following routines are used for debug output only 80 * The following routines are used for debug output only
57 */ 81 */
58#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 82#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
59 83
60/***************************************************************************** 84/*******************************************************************************
61 * 85 *
62 * FUNCTION: acpi_ex_dump_operand 86 * FUNCTION: acpi_ex_dump_operand
63 * 87 *
64 * PARAMETERS: *obj_desc - Pointer to entry to be dumped 88 * PARAMETERS: *obj_desc - Pointer to entry to be dumped
89 * Depth - Current nesting depth
65 * 90 *
66 * RETURN: None 91 * RETURN: None
67 * 92 *
68 * DESCRIPTION: Dump an operand object 93 * DESCRIPTION: Dump an operand object
69 * 94 *
70 ****************************************************************************/ 95 ******************************************************************************/
71 96
72void 97void
73acpi_ex_dump_operand ( 98acpi_ex_dump_operand (
@@ -86,9 +111,8 @@ acpi_ex_dump_operand (
86 } 111 }
87 112
88 if (!obj_desc) { 113 if (!obj_desc) {
89 /* 114 /* This could be a null element of a package */
90 * This could be a null element of a package 115
91 */
92 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); 116 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
93 return; 117 return;
94 } 118 }
@@ -117,6 +141,8 @@ acpi_ex_dump_operand (
117 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); 141 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
118 } 142 }
119 143
144 /* Decode object type */
145
120 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { 146 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
121 case ACPI_TYPE_LOCAL_REFERENCE: 147 case ACPI_TYPE_LOCAL_REFERENCE:
122 148
@@ -274,7 +300,9 @@ acpi_ex_dump_operand (
274 case ACPI_TYPE_STRING: 300 case ACPI_TYPE_STRING:
275 301
276 acpi_os_printf ("String length %X @ %p ", 302 acpi_os_printf ("String length %X @ %p ",
277 obj_desc->string.length, obj_desc->string.pointer); 303 obj_desc->string.length,
304 obj_desc->string.pointer);
305
278 acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX); 306 acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
279 acpi_os_printf ("\n"); 307 acpi_os_printf ("\n");
280 break; 308 break;
@@ -290,10 +318,13 @@ acpi_ex_dump_operand (
290 318
291 acpi_os_printf ( 319 acpi_os_printf (
292 "region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", 320 "region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
293 obj_desc->field.bit_length, obj_desc->field.access_byte_width, 321 obj_desc->field.bit_length,
322 obj_desc->field.access_byte_width,
294 obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, 323 obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
295 obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, 324 obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
296 obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset); 325 obj_desc->field.base_byte_offset,
326 obj_desc->field.start_field_bit_offset);
327
297 acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1); 328 acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1);
298 break; 329 break;
299 330
@@ -308,13 +339,15 @@ acpi_ex_dump_operand (
308 339
309 acpi_os_printf ( 340 acpi_os_printf (
310 "buffer_field: %X bits at byte %X bit %X of \n", 341 "buffer_field: %X bits at byte %X bit %X of \n",
311 obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset, 342 obj_desc->buffer_field.bit_length,
343 obj_desc->buffer_field.base_byte_offset,
312 obj_desc->buffer_field.start_field_bit_offset); 344 obj_desc->buffer_field.start_field_bit_offset);
313 345
314 if (!obj_desc->buffer_field.buffer_obj) { 346 if (!obj_desc->buffer_field.buffer_obj) {
315 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); 347 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
316 } 348 }
317 else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) { 349 else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) !=
350 ACPI_TYPE_BUFFER) {
318 acpi_os_printf ("*not a Buffer* \n"); 351 acpi_os_printf ("*not a Buffer* \n");
319 } 352 }
320 else { 353 else {
@@ -331,10 +364,10 @@ acpi_ex_dump_operand (
331 364
332 case ACPI_TYPE_METHOD: 365 case ACPI_TYPE_METHOD:
333 366
334 acpi_os_printf ( 367 acpi_os_printf ("Method(%X) @ %p:%X\n",
335 "Method(%X) @ %p:%X\n",
336 obj_desc->method.param_count, 368 obj_desc->method.param_count,
337 obj_desc->method.aml_start, obj_desc->method.aml_length); 369 obj_desc->method.aml_start,
370 obj_desc->method.aml_length);
338 break; 371 break;
339 372
340 373
@@ -379,7 +412,7 @@ acpi_ex_dump_operand (
379} 412}
380 413
381 414
382/***************************************************************************** 415/*******************************************************************************
383 * 416 *
384 * FUNCTION: acpi_ex_dump_operands 417 * FUNCTION: acpi_ex_dump_operands
385 * 418 *
@@ -393,7 +426,7 @@ acpi_ex_dump_operand (
393 * 426 *
394 * DESCRIPTION: Dump the object stack 427 * DESCRIPTION: Dump the object stack
395 * 428 *
396 ****************************************************************************/ 429 ******************************************************************************/
397 430
398void 431void
399acpi_ex_dump_operands ( 432acpi_ex_dump_operands (
@@ -441,10 +474,9 @@ acpi_ex_dump_operands (
441 474
442 475
443#ifdef ACPI_FUTURE_USAGE 476#ifdef ACPI_FUTURE_USAGE
444 477/*******************************************************************************
445/*****************************************************************************
446 * 478 *
447 * FUNCTION: acpi_ex_out* 479 * FUNCTION: acpi_ex_out* functions
448 * 480 *
449 * PARAMETERS: Title - Descriptive text 481 * PARAMETERS: Title - Descriptive text
450 * Value - Value to be displayed 482 * Value - Value to be displayed
@@ -453,9 +485,9 @@ acpi_ex_dump_operands (
453 * reduce the number of format strings required and keeps them 485 * reduce the number of format strings required and keeps them
454 * all in one place for easy modification. 486 * all in one place for easy modification.
455 * 487 *
456 ****************************************************************************/ 488 ******************************************************************************/
457 489
458void 490static void
459acpi_ex_out_string ( 491acpi_ex_out_string (
460 char *title, 492 char *title,
461 char *value) 493 char *value)
@@ -463,7 +495,7 @@ acpi_ex_out_string (
463 acpi_os_printf ("%20s : %s\n", title, value); 495 acpi_os_printf ("%20s : %s\n", title, value);
464} 496}
465 497
466void 498static void
467acpi_ex_out_pointer ( 499acpi_ex_out_pointer (
468 char *title, 500 char *title,
469 void *value) 501 void *value)
@@ -471,7 +503,7 @@ acpi_ex_out_pointer (
471 acpi_os_printf ("%20s : %p\n", title, value); 503 acpi_os_printf ("%20s : %p\n", title, value);
472} 504}
473 505
474void 506static void
475acpi_ex_out_integer ( 507acpi_ex_out_integer (
476 char *title, 508 char *title,
477 u32 value) 509 u32 value)
@@ -479,7 +511,7 @@ acpi_ex_out_integer (
479 acpi_os_printf ("%20s : %X\n", title, value); 511 acpi_os_printf ("%20s : %X\n", title, value);
480} 512}
481 513
482void 514static void
483acpi_ex_out_address ( 515acpi_ex_out_address (
484 char *title, 516 char *title,
485 acpi_physical_address value) 517 acpi_physical_address value)
@@ -493,16 +525,16 @@ acpi_ex_out_address (
493} 525}
494 526
495 527
496/***************************************************************************** 528/*******************************************************************************
497 * 529 *
498 * FUNCTION: acpi_ex_dump_node 530 * FUNCTION: acpi_ex_dump_node
499 * 531 *
500 * PARAMETERS: *Node - Descriptor to dump 532 * PARAMETERS: *Node - Descriptor to dump
501 * Flags - Force display 533 * Flags - Force display if TRUE
502 * 534 *
503 * DESCRIPTION: Dumps the members of the given.Node 535 * DESCRIPTION: Dumps the members of the given.Node
504 * 536 *
505 ****************************************************************************/ 537 ******************************************************************************/
506 538
507void 539void
508acpi_ex_dump_node ( 540acpi_ex_dump_node (
@@ -531,16 +563,16 @@ acpi_ex_dump_node (
531} 563}
532 564
533 565
534/***************************************************************************** 566/*******************************************************************************
535 * 567 *
536 * FUNCTION: acpi_ex_dump_object_descriptor 568 * FUNCTION: acpi_ex_dump_object_descriptor
537 * 569 *
538 * PARAMETERS: *Object - Descriptor to dump 570 * PARAMETERS: *Object - Descriptor to dump
539 * Flags - Force display 571 * Flags - Force display if TRUE
540 * 572 *
541 * DESCRIPTION: Dumps the members of the object descriptor given. 573 * DESCRIPTION: Dumps the members of the object descriptor given.
542 * 574 *
543 ****************************************************************************/ 575 ******************************************************************************/
544 576
545void 577void
546acpi_ex_dump_object_descriptor ( 578acpi_ex_dump_object_descriptor (
@@ -553,6 +585,10 @@ acpi_ex_dump_object_descriptor (
553 ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor"); 585 ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor");
554 586
555 587
588 if (!obj_desc) {
589 return_VOID;
590 }
591
556 if (!flags) { 592 if (!flags) {
557 if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) { 593 if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
558 return_VOID; 594 return_VOID;
@@ -747,11 +783,17 @@ acpi_ex_dump_object_descriptor (
747 case ACPI_TYPE_LOCAL_REFERENCE: 783 case ACPI_TYPE_LOCAL_REFERENCE:
748 784
749 acpi_ex_out_integer ("target_type", obj_desc->reference.target_type); 785 acpi_ex_out_integer ("target_type", obj_desc->reference.target_type);
750 acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); 786 acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (
787 obj_desc->reference.opcode))->name);
751 acpi_ex_out_integer ("Offset", obj_desc->reference.offset); 788 acpi_ex_out_integer ("Offset", obj_desc->reference.offset);
752 acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object); 789 acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object);
753 acpi_ex_out_pointer ("Node", obj_desc->reference.node); 790 acpi_ex_out_pointer ("Node", obj_desc->reference.node);
754 acpi_ex_out_pointer ("Where", obj_desc->reference.where); 791 acpi_ex_out_pointer ("Where", obj_desc->reference.where);
792
793 if (obj_desc->reference.object) {
794 acpi_os_printf ("\nReferenced Object:\n");
795 acpi_ex_dump_object_descriptor (obj_desc->reference.object, flags);
796 }
755 break; 797 break;
756 798
757 799
@@ -788,6 +830,5 @@ acpi_ex_dump_object_descriptor (
788} 830}
789 831
790#endif /* ACPI_FUTURE_USAGE */ 832#endif /* ACPI_FUTURE_USAGE */
791
792#endif 833#endif
793 834