.. | .. |
---|
10 | 10 | #include "acnamesp.h" |
---|
11 | 11 | #include "acdebug.h" |
---|
12 | 12 | #include "acpredef.h" |
---|
| 13 | +#include "acinterp.h" |
---|
13 | 14 | |
---|
14 | 15 | #define _COMPONENT ACPI_CA_DEBUGGER |
---|
15 | 16 | ACPI_MODULE_NAME("dbnames") |
---|
.. | .. |
---|
354 | 355 | char acpi_name[5] = "____"; |
---|
355 | 356 | char *acpi_name_ptr = acpi_name; |
---|
356 | 357 | |
---|
357 | | - if (strlen(name_arg) > ACPI_NAME_SIZE) { |
---|
| 358 | + if (strlen(name_arg) > ACPI_NAMESEG_SIZE) { |
---|
358 | 359 | acpi_os_printf("Name must be no longer than 4 characters\n"); |
---|
359 | 360 | return (AE_OK); |
---|
360 | 361 | } |
---|
.. | .. |
---|
504 | 505 | |
---|
505 | 506 | /******************************************************************************* |
---|
506 | 507 | * |
---|
| 508 | + * FUNCTION: acpi_db_walk_for_fields |
---|
| 509 | + * |
---|
| 510 | + * PARAMETERS: Callback from walk_namespace |
---|
| 511 | + * |
---|
| 512 | + * RETURN: Status |
---|
| 513 | + * |
---|
| 514 | + * DESCRIPTION: Display short info about objects in the namespace |
---|
| 515 | + * |
---|
| 516 | + ******************************************************************************/ |
---|
| 517 | + |
---|
| 518 | +static acpi_status |
---|
| 519 | +acpi_db_walk_for_fields(acpi_handle obj_handle, |
---|
| 520 | + u32 nesting_level, void *context, void **return_value) |
---|
| 521 | +{ |
---|
| 522 | + union acpi_object *ret_value; |
---|
| 523 | + struct acpi_region_walk_info *info = |
---|
| 524 | + (struct acpi_region_walk_info *)context; |
---|
| 525 | + struct acpi_buffer buffer; |
---|
| 526 | + acpi_status status; |
---|
| 527 | + struct acpi_namespace_node *node = acpi_ns_validate_handle(obj_handle); |
---|
| 528 | + |
---|
| 529 | + if (!node) { |
---|
| 530 | + return (AE_OK); |
---|
| 531 | + } |
---|
| 532 | + if (node->object->field.region_obj->region.space_id != |
---|
| 533 | + info->address_space_id) { |
---|
| 534 | + return (AE_OK); |
---|
| 535 | + } |
---|
| 536 | + |
---|
| 537 | + info->count++; |
---|
| 538 | + |
---|
| 539 | + /* Get and display the full pathname to this object */ |
---|
| 540 | + |
---|
| 541 | + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; |
---|
| 542 | + status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE); |
---|
| 543 | + if (ACPI_FAILURE(status)) { |
---|
| 544 | + acpi_os_printf("Could Not get pathname for object %p\n", |
---|
| 545 | + obj_handle); |
---|
| 546 | + return (AE_OK); |
---|
| 547 | + } |
---|
| 548 | + |
---|
| 549 | + acpi_os_printf("%s ", (char *)buffer.pointer); |
---|
| 550 | + ACPI_FREE(buffer.pointer); |
---|
| 551 | + |
---|
| 552 | + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; |
---|
| 553 | + acpi_evaluate_object(obj_handle, NULL, NULL, &buffer); |
---|
| 554 | + |
---|
| 555 | + /* |
---|
| 556 | + * Since this is a field unit, surround the output in braces |
---|
| 557 | + */ |
---|
| 558 | + acpi_os_printf("{"); |
---|
| 559 | + |
---|
| 560 | + ret_value = (union acpi_object *)buffer.pointer; |
---|
| 561 | + switch (ret_value->type) { |
---|
| 562 | + case ACPI_TYPE_INTEGER: |
---|
| 563 | + |
---|
| 564 | + acpi_os_printf("%8.8X%8.8X", |
---|
| 565 | + ACPI_FORMAT_UINT64(ret_value->integer.value)); |
---|
| 566 | + break; |
---|
| 567 | + |
---|
| 568 | + case ACPI_TYPE_BUFFER: |
---|
| 569 | + |
---|
| 570 | + acpi_ut_dump_buffer(ret_value->buffer.pointer, |
---|
| 571 | + ret_value->buffer.length, |
---|
| 572 | + DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0); |
---|
| 573 | + break; |
---|
| 574 | + |
---|
| 575 | + default: |
---|
| 576 | + |
---|
| 577 | + break; |
---|
| 578 | + } |
---|
| 579 | + acpi_os_printf("}\n"); |
---|
| 580 | + |
---|
| 581 | + ACPI_FREE(buffer.pointer); |
---|
| 582 | + |
---|
| 583 | + return (AE_OK); |
---|
| 584 | +} |
---|
| 585 | + |
---|
| 586 | +/******************************************************************************* |
---|
| 587 | + * |
---|
507 | 588 | * FUNCTION: acpi_db_walk_for_specific_objects |
---|
508 | 589 | * |
---|
509 | 590 | * PARAMETERS: Callback from walk_namespace |
---|
.. | .. |
---|
571 | 652 | object_info = |
---|
572 | 653 | ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_object_info)); |
---|
573 | 654 | |
---|
| 655 | + if (!object_info) |
---|
| 656 | + return (AE_NO_MEMORY); |
---|
| 657 | + |
---|
574 | 658 | /* Walk the namespace from the root */ |
---|
575 | 659 | |
---|
576 | 660 | (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, |
---|
.. | .. |
---|
625 | 709 | info.count, acpi_ut_get_type_name(type)); |
---|
626 | 710 | |
---|
627 | 711 | acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT); |
---|
| 712 | + return (AE_OK); |
---|
| 713 | +} |
---|
| 714 | + |
---|
| 715 | +/******************************************************************************* |
---|
| 716 | + * |
---|
| 717 | + * FUNCTION: acpi_db_display_fields |
---|
| 718 | + * |
---|
| 719 | + * PARAMETERS: obj_type_arg - Type of object to display |
---|
| 720 | + * display_count_arg - Max depth to display |
---|
| 721 | + * |
---|
| 722 | + * RETURN: None |
---|
| 723 | + * |
---|
| 724 | + * DESCRIPTION: Display objects in the namespace of the requested type |
---|
| 725 | + * |
---|
| 726 | + ******************************************************************************/ |
---|
| 727 | + |
---|
| 728 | +acpi_status acpi_db_display_fields(u32 address_space_id) |
---|
| 729 | +{ |
---|
| 730 | + struct acpi_region_walk_info info; |
---|
| 731 | + |
---|
| 732 | + info.count = 0; |
---|
| 733 | + info.owner_id = ACPI_OWNER_ID_MAX; |
---|
| 734 | + info.debug_level = ACPI_UINT32_MAX; |
---|
| 735 | + info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT; |
---|
| 736 | + info.address_space_id = address_space_id; |
---|
| 737 | + |
---|
| 738 | + /* Walk the namespace from the root */ |
---|
| 739 | + |
---|
| 740 | + (void)acpi_walk_namespace(ACPI_TYPE_LOCAL_REGION_FIELD, |
---|
| 741 | + ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, |
---|
| 742 | + acpi_db_walk_for_fields, NULL, (void *)&info, |
---|
| 743 | + NULL); |
---|
| 744 | + |
---|
628 | 745 | return (AE_OK); |
---|
629 | 746 | } |
---|
630 | 747 | |
---|
.. | .. |
---|
904 | 1021 | * |
---|
905 | 1022 | * RETURN: None |
---|
906 | 1023 | * |
---|
907 | | - * DESCRIPTION: Display info about system busses. |
---|
| 1024 | + * DESCRIPTION: Display info about system buses. |
---|
908 | 1025 | * |
---|
909 | 1026 | ******************************************************************************/ |
---|
910 | 1027 | |
---|