|
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")
|
@@ -502,6 +503,81 @@ acpi_db_walk_for_object_counts(acpi_handle obj_handle,
|
502 | 503 | return (AE_OK);
|
503 | 504 | }
|
504 | 505 |
|
| 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 | + ret_value = (union acpi_object *)buffer.pointer; |
| 556 | + switch (ret_value->type) { |
| 557 | + case ACPI_TYPE_INTEGER: |
| 558 | + |
| 559 | + acpi_os_printf("%8.8X%8.8X", |
| 560 | + ACPI_FORMAT_UINT64(ret_value->integer.value)); |
| 561 | + break; |
| 562 | + |
| 563 | + case ACPI_TYPE_BUFFER: |
| 564 | + |
| 565 | + acpi_ut_dump_buffer(ret_value->buffer.pointer, |
| 566 | + ret_value->buffer.length, |
| 567 | + DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0); |
| 568 | + break; |
| 569 | + |
| 570 | + default: |
| 571 | + |
| 572 | + break; |
| 573 | + } |
| 574 | + acpi_os_printf("\n"); |
| 575 | + |
| 576 | + ACPI_FREE(buffer.pointer); |
| 577 | + |
| 578 | + return (AE_OK); |
| 579 | +} |
| 580 | + |
505 | 581 | /*******************************************************************************
|
506 | 582 | *
|
507 | 583 | * FUNCTION: acpi_db_walk_for_specific_objects
|
@@ -628,6 +704,39 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg)
|
628 | 704 | return (AE_OK);
|
629 | 705 | }
|
630 | 706 |
|
| 707 | +/******************************************************************************* |
| 708 | + * |
| 709 | + * FUNCTION: acpi_db_display_fields |
| 710 | + * |
| 711 | + * PARAMETERS: obj_type_arg - Type of object to display |
| 712 | + * display_count_arg - Max depth to display |
| 713 | + * |
| 714 | + * RETURN: None |
| 715 | + * |
| 716 | + * DESCRIPTION: Display objects in the namespace of the requested type |
| 717 | + * |
| 718 | + ******************************************************************************/ |
| 719 | + |
| 720 | +acpi_status acpi_db_display_fields(u32 address_space_id) |
| 721 | +{ |
| 722 | + struct acpi_region_walk_info info; |
| 723 | + |
| 724 | + info.count = 0; |
| 725 | + info.owner_id = ACPI_OWNER_ID_MAX; |
| 726 | + info.debug_level = ACPI_UINT32_MAX; |
| 727 | + info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT; |
| 728 | + info.address_space_id = address_space_id; |
| 729 | + |
| 730 | + /* Walk the namespace from the root */ |
| 731 | + |
| 732 | + (void)acpi_walk_namespace(ACPI_TYPE_LOCAL_REGION_FIELD, |
| 733 | + ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, |
| 734 | + acpi_db_walk_for_fields, NULL, (void *)&info, |
| 735 | + NULL); |
| 736 | + |
| 737 | + return (AE_OK); |
| 738 | +} |
| 739 | + |
631 | 740 | /*******************************************************************************
|
632 | 741 | *
|
633 | 742 | * FUNCTION: acpi_db_integrity_walk
|
|
0 commit comments