diff options
Diffstat (limited to 'drivers/acpi/namespace/nsdump.c')
-rw-r--r-- | drivers/acpi/namespace/nsdump.c | 80 |
1 files changed, 45 insertions, 35 deletions
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c index 6c2aef0e0dd4..5d25add6b031 100644 --- a/drivers/acpi/namespace/nsdump.c +++ b/drivers/acpi/namespace/nsdump.c | |||
@@ -85,6 +85,9 @@ acpi_ns_print_pathname ( | |||
85 | u32 num_segments, | 85 | u32 num_segments, |
86 | char *pathname) | 86 | char *pathname) |
87 | { | 87 | { |
88 | acpi_native_uint i; | ||
89 | |||
90 | |||
88 | ACPI_FUNCTION_NAME ("ns_print_pathname"); | 91 | ACPI_FUNCTION_NAME ("ns_print_pathname"); |
89 | 92 | ||
90 | 93 | ||
@@ -97,9 +100,13 @@ acpi_ns_print_pathname ( | |||
97 | ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); | 100 | ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); |
98 | 101 | ||
99 | while (num_segments) { | 102 | while (num_segments) { |
100 | acpi_os_printf ("%4.4s", pathname); | 103 | for (i = 0; i < 4; i++) { |
101 | pathname += ACPI_NAME_SIZE; | 104 | ACPI_IS_PRINT (pathname[i]) ? |
105 | acpi_os_printf ("%c", pathname[i]) : | ||
106 | acpi_os_printf ("?"); | ||
107 | } | ||
102 | 108 | ||
109 | pathname += ACPI_NAME_SIZE; | ||
103 | num_segments--; | 110 | num_segments--; |
104 | if (num_segments) { | 111 | if (num_segments) { |
105 | acpi_os_printf ("."); | 112 | acpi_os_printf ("."); |
@@ -203,38 +210,42 @@ acpi_ns_dump_one_object ( | |||
203 | 210 | ||
204 | /* Check if the owner matches */ | 211 | /* Check if the owner matches */ |
205 | 212 | ||
206 | if ((info->owner_id != ACPI_UINT32_MAX) && | 213 | if ((info->owner_id != ACPI_OWNER_ID_MAX) && |
207 | (info->owner_id != this_node->owner_id)) { | 214 | (info->owner_id != this_node->owner_id)) { |
208 | return (AE_OK); | 215 | return (AE_OK); |
209 | } | 216 | } |
210 | 217 | ||
211 | /* Indent the object according to the level */ | 218 | if (!(info->display_type & ACPI_DISPLAY_SHORT)) { |
219 | /* Indent the object according to the level */ | ||
212 | 220 | ||
213 | acpi_os_printf ("%2d%*s", (u32) level - 1, (int) level * 2, " "); | 221 | acpi_os_printf ("%2d%*s", (u32) level - 1, (int) level * 2, " "); |
214 | 222 | ||
215 | /* Check the node type and name */ | 223 | /* Check the node type and name */ |
216 | 224 | ||
217 | if (type > ACPI_TYPE_LOCAL_MAX) { | 225 | if (type > ACPI_TYPE_LOCAL_MAX) { |
218 | ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type)); | 226 | ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type)); |
219 | } | 227 | } |
220 | 228 | ||
221 | if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { | 229 | if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { |
222 | ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", | 230 | ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", |
223 | this_node->name.integer)); | 231 | this_node->name.integer)); |
232 | } | ||
233 | |||
234 | acpi_os_printf ("%4.4s", acpi_ut_get_node_name (this_node)); | ||
224 | } | 235 | } |
225 | 236 | ||
226 | /* | 237 | /* |
227 | * Now we can print out the pertinent information | 238 | * Now we can print out the pertinent information |
228 | */ | 239 | */ |
229 | acpi_os_printf ("%4.4s %-12s %p ", | 240 | acpi_os_printf (" %-12s %p ", |
230 | acpi_ut_get_node_name (this_node), acpi_ut_get_type_name (type), this_node); | 241 | acpi_ut_get_type_name (type), this_node); |
231 | 242 | ||
232 | dbg_level = acpi_dbg_level; | 243 | dbg_level = acpi_dbg_level; |
233 | acpi_dbg_level = 0; | 244 | acpi_dbg_level = 0; |
234 | obj_desc = acpi_ns_get_attached_object (this_node); | 245 | obj_desc = acpi_ns_get_attached_object (this_node); |
235 | acpi_dbg_level = dbg_level; | 246 | acpi_dbg_level = dbg_level; |
236 | 247 | ||
237 | switch (info->display_type) { | 248 | switch (info->display_type & ACPI_DISPLAY_MASK) { |
238 | case ACPI_DISPLAY_SUMMARY: | 249 | case ACPI_DISPLAY_SUMMARY: |
239 | 250 | ||
240 | if (!obj_desc) { | 251 | if (!obj_desc) { |
@@ -475,7 +486,7 @@ acpi_ns_dump_one_object ( | |||
475 | 486 | ||
476 | while (obj_desc) { | 487 | while (obj_desc) { |
477 | obj_type = ACPI_TYPE_INVALID; | 488 | obj_type = ACPI_TYPE_INVALID; |
478 | acpi_os_printf (" Attached Object %p: ", obj_desc); | 489 | acpi_os_printf ("Attached Object %p: ", obj_desc); |
479 | 490 | ||
480 | /* Decode the type of attached object and dump the contents */ | 491 | /* Decode the type of attached object and dump the contents */ |
481 | 492 | ||
@@ -484,9 +495,9 @@ acpi_ns_dump_one_object ( | |||
484 | 495 | ||
485 | acpi_os_printf ("(Ptr to Node)\n"); | 496 | acpi_os_printf ("(Ptr to Node)\n"); |
486 | bytes_to_dump = sizeof (struct acpi_namespace_node); | 497 | bytes_to_dump = sizeof (struct acpi_namespace_node); |
498 | ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); | ||
487 | break; | 499 | break; |
488 | 500 | ||
489 | |||
490 | case ACPI_DESC_TYPE_OPERAND: | 501 | case ACPI_DESC_TYPE_OPERAND: |
491 | 502 | ||
492 | obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); | 503 | obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); |
@@ -497,24 +508,19 @@ acpi_ns_dump_one_object ( | |||
497 | bytes_to_dump = 32; | 508 | bytes_to_dump = 32; |
498 | } | 509 | } |
499 | else { | 510 | else { |
500 | acpi_os_printf ("(Ptr to ACPI Object type %s, %X)\n", | 511 | acpi_os_printf ("(Ptr to ACPI Object type %X [%s])\n", |
501 | acpi_ut_get_type_name (obj_type), obj_type); | 512 | obj_type, acpi_ut_get_type_name (obj_type)); |
502 | bytes_to_dump = sizeof (union acpi_operand_object); | 513 | bytes_to_dump = sizeof (union acpi_operand_object); |
503 | } | 514 | } |
504 | break; | ||
505 | 515 | ||
516 | ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); | ||
517 | break; | ||
506 | 518 | ||
507 | default: | 519 | default: |
508 | 520 | ||
509 | acpi_os_printf ( | ||
510 | "(String or Buffer ptr - not an object descriptor) [%s]\n", | ||
511 | acpi_ut_get_descriptor_name (obj_desc)); | ||
512 | bytes_to_dump = 16; | ||
513 | break; | 521 | break; |
514 | } | 522 | } |
515 | 523 | ||
516 | ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); | ||
517 | |||
518 | /* If value is NOT an internal object, we are done */ | 524 | /* If value is NOT an internal object, we are done */ |
519 | 525 | ||
520 | if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { | 526 | if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { |
@@ -525,13 +531,17 @@ acpi_ns_dump_one_object ( | |||
525 | * Valid object, get the pointer to next level, if any | 531 | * Valid object, get the pointer to next level, if any |
526 | */ | 532 | */ |
527 | switch (obj_type) { | 533 | switch (obj_type) { |
534 | case ACPI_TYPE_BUFFER: | ||
528 | case ACPI_TYPE_STRING: | 535 | case ACPI_TYPE_STRING: |
536 | /* | ||
537 | * NOTE: takes advantage of common fields between string/buffer | ||
538 | */ | ||
539 | bytes_to_dump = obj_desc->string.length; | ||
529 | obj_desc = (void *) obj_desc->string.pointer; | 540 | obj_desc = (void *) obj_desc->string.pointer; |
530 | break; | 541 | acpi_os_printf ( "(Buffer/String pointer %p length %X)\n", |
531 | 542 | obj_desc, bytes_to_dump); | |
532 | case ACPI_TYPE_BUFFER: | 543 | ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); |
533 | obj_desc = (void *) obj_desc->buffer.pointer; | 544 | goto cleanup; |
534 | break; | ||
535 | 545 | ||
536 | case ACPI_TYPE_BUFFER_FIELD: | 546 | case ACPI_TYPE_BUFFER_FIELD: |
537 | obj_desc = (union acpi_operand_object *) obj_desc->buffer_field.buffer_obj; | 547 | obj_desc = (union acpi_operand_object *) obj_desc->buffer_field.buffer_obj; |
@@ -595,7 +605,7 @@ acpi_ns_dump_objects ( | |||
595 | acpi_object_type type, | 605 | acpi_object_type type, |
596 | u8 display_type, | 606 | u8 display_type, |
597 | u32 max_depth, | 607 | u32 max_depth, |
598 | u32 owner_id, | 608 | acpi_owner_id owner_id, |
599 | acpi_handle start_handle) | 609 | acpi_handle start_handle) |
600 | { | 610 | { |
601 | struct acpi_walk_info info; | 611 | struct acpi_walk_info info; |
@@ -640,14 +650,14 @@ acpi_ns_dump_entry ( | |||
640 | 650 | ||
641 | 651 | ||
642 | info.debug_level = debug_level; | 652 | info.debug_level = debug_level; |
643 | info.owner_id = ACPI_UINT32_MAX; | 653 | info.owner_id = ACPI_OWNER_ID_MAX; |
644 | info.display_type = ACPI_DISPLAY_SUMMARY; | 654 | info.display_type = ACPI_DISPLAY_SUMMARY; |
645 | 655 | ||
646 | (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); | 656 | (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); |
647 | } | 657 | } |
648 | 658 | ||
649 | 659 | ||
650 | #ifdef _ACPI_ASL_COMPILER | 660 | #ifdef ACPI_ASL_COMPILER |
651 | /******************************************************************************* | 661 | /******************************************************************************* |
652 | * | 662 | * |
653 | * FUNCTION: acpi_ns_dump_tables | 663 | * FUNCTION: acpi_ns_dump_tables |
@@ -691,7 +701,7 @@ acpi_ns_dump_tables ( | |||
691 | } | 701 | } |
692 | 702 | ||
693 | acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, | 703 | acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, |
694 | ACPI_UINT32_MAX, search_handle); | 704 | ACPI_OWNER_ID_MAX, search_handle); |
695 | return_VOID; | 705 | return_VOID; |
696 | } | 706 | } |
697 | #endif /* _ACPI_ASL_COMPILER */ | 707 | #endif /* _ACPI_ASL_COMPILER */ |