| .. | .. |
|---|
| 37 | 37 | enum acpi_ex_debugger_commands { |
|---|
| 38 | 38 | CMD_NOT_FOUND = 0, |
|---|
| 39 | 39 | CMD_NULL, |
|---|
| 40 | + CMD_ALL, |
|---|
| 40 | 41 | CMD_ALLOCATIONS, |
|---|
| 41 | 42 | CMD_ARGS, |
|---|
| 42 | 43 | CMD_ARGUMENTS, |
|---|
| .. | .. |
|---|
| 50 | 51 | CMD_EVALUATE, |
|---|
| 51 | 52 | CMD_EXECUTE, |
|---|
| 52 | 53 | CMD_EXIT, |
|---|
| 54 | + CMD_FIELDS, |
|---|
| 53 | 55 | CMD_FIND, |
|---|
| 54 | 56 | CMD_GO, |
|---|
| 55 | 57 | CMD_HANDLERS, |
|---|
| .. | .. |
|---|
| 114 | 116 | static const struct acpi_db_command_info acpi_gbl_db_commands[] = { |
|---|
| 115 | 117 | {"<NOT FOUND>", 0}, |
|---|
| 116 | 118 | {"<NULL>", 0}, |
|---|
| 119 | + {"ALL", 1}, |
|---|
| 117 | 120 | {"ALLOCATIONS", 0}, |
|---|
| 118 | 121 | {"ARGS", 0}, |
|---|
| 119 | 122 | {"ARGUMENTS", 0}, |
|---|
| .. | .. |
|---|
| 127 | 130 | {"EVALUATE", 1}, |
|---|
| 128 | 131 | {"EXECUTE", 1}, |
|---|
| 129 | 132 | {"EXIT", 0}, |
|---|
| 133 | + {"FIELDS", 1}, |
|---|
| 130 | 134 | {"FIND", 1}, |
|---|
| 131 | 135 | {"GO", 0}, |
|---|
| 132 | 136 | {"HANDLERS", 0}, |
|---|
| .. | .. |
|---|
| 200 | 204 | "Find ACPI name(s) with wildcards\n"}, |
|---|
| 201 | 205 | {1, " Integrity", "Validate namespace integrity\n"}, |
|---|
| 202 | 206 | {1, " Methods", "Display list of loaded control methods\n"}, |
|---|
| 207 | + {1, " Fields <AddressSpaceId>", |
|---|
| 208 | + "Display list of loaded field units by space ID\n"}, |
|---|
| 203 | 209 | {1, " Namespace [Object] [Depth]", |
|---|
| 204 | 210 | "Display loaded namespace tree/subtree\n"}, |
|---|
| 205 | 211 | {1, " Notify <Object> <Value>", "Send a notification on Object\n"}, |
|---|
| .. | .. |
|---|
| 218 | 224 | {1, " Type <Object>", "Display object type\n"}, |
|---|
| 219 | 225 | |
|---|
| 220 | 226 | {0, "\nControl Method Execution:", "\n"}, |
|---|
| 227 | + {1, " All <NameSeg>", "Evaluate all objects named NameSeg\n"}, |
|---|
| 221 | 228 | {1, " Evaluate <Namepath> [Arguments]", |
|---|
| 222 | 229 | "Evaluate object or control method\n"}, |
|---|
| 223 | 230 | {1, " Execute <Namepath> [Arguments]", "Synonym for Evaluate\n"}, |
|---|
| .. | .. |
|---|
| 432 | 439 | acpi_os_printf("\n"); |
|---|
| 433 | 440 | |
|---|
| 434 | 441 | } else { |
|---|
| 435 | | - /* Display help for all commands that match the subtring */ |
|---|
| 442 | + /* Display help for all commands that match the substring */ |
|---|
| 436 | 443 | |
|---|
| 437 | 444 | acpi_db_display_command_info(command, TRUE); |
|---|
| 438 | 445 | } |
|---|
| .. | .. |
|---|
| 464 | 471 | return (NULL); |
|---|
| 465 | 472 | } |
|---|
| 466 | 473 | |
|---|
| 467 | | - /* Remove any spaces at the beginning */ |
|---|
| 474 | + /* Remove any spaces at the beginning, ignore blank lines */ |
|---|
| 468 | 475 | |
|---|
| 469 | | - if (*string == ' ') { |
|---|
| 470 | | - while (*string && (*string == ' ')) { |
|---|
| 471 | | - string++; |
|---|
| 472 | | - } |
|---|
| 476 | + while (*string && isspace(*string)) { |
|---|
| 477 | + string++; |
|---|
| 478 | + } |
|---|
| 473 | 479 | |
|---|
| 474 | | - if (!(*string)) { |
|---|
| 475 | | - return (NULL); |
|---|
| 476 | | - } |
|---|
| 480 | + if (!(*string)) { |
|---|
| 481 | + return (NULL); |
|---|
| 477 | 482 | } |
|---|
| 478 | 483 | |
|---|
| 479 | 484 | switch (*string) { |
|---|
| .. | .. |
|---|
| 503 | 508 | /* Find end of buffer */ |
|---|
| 504 | 509 | |
|---|
| 505 | 510 | while (*string && (*string != ')')) { |
|---|
| 511 | + string++; |
|---|
| 512 | + } |
|---|
| 513 | + break; |
|---|
| 514 | + |
|---|
| 515 | + case '{': |
|---|
| 516 | + |
|---|
| 517 | + /* This is the start of a field unit, scan until closing brace */ |
|---|
| 518 | + |
|---|
| 519 | + string++; |
|---|
| 520 | + start = string; |
|---|
| 521 | + type = ACPI_TYPE_FIELD_UNIT; |
|---|
| 522 | + |
|---|
| 523 | + /* Find end of buffer */ |
|---|
| 524 | + |
|---|
| 525 | + while (*string && (*string != '}')) { |
|---|
| 506 | 526 | string++; |
|---|
| 507 | 527 | } |
|---|
| 508 | 528 | break; |
|---|
| .. | .. |
|---|
| 551 | 571 | |
|---|
| 552 | 572 | /* Find end of token */ |
|---|
| 553 | 573 | |
|---|
| 554 | | - while (*string && (*string != ' ')) { |
|---|
| 574 | + while (*string && !isspace(*string)) { |
|---|
| 555 | 575 | string++; |
|---|
| 556 | 576 | } |
|---|
| 557 | 577 | break; |
|---|
| .. | .. |
|---|
| 593 | 613 | input_buffer)) { |
|---|
| 594 | 614 | acpi_os_printf |
|---|
| 595 | 615 | ("Buffer overflow while parsing input line (max %u characters)\n", |
|---|
| 596 | | - sizeof(acpi_gbl_db_parsed_buf)); |
|---|
| 616 | + (u32)sizeof(acpi_gbl_db_parsed_buf)); |
|---|
| 597 | 617 | return (0); |
|---|
| 598 | 618 | } |
|---|
| 599 | 619 | |
|---|
| .. | .. |
|---|
| 674 | 694 | union acpi_parse_object *op) |
|---|
| 675 | 695 | { |
|---|
| 676 | 696 | u32 temp; |
|---|
| 697 | + u64 temp64; |
|---|
| 677 | 698 | u32 command_index; |
|---|
| 678 | 699 | u32 param_count; |
|---|
| 679 | 700 | char *command_line; |
|---|
| .. | .. |
|---|
| 689 | 710 | |
|---|
| 690 | 711 | param_count = acpi_db_get_line(input_buffer); |
|---|
| 691 | 712 | command_index = acpi_db_match_command(acpi_gbl_db_args[0]); |
|---|
| 692 | | - temp = 0; |
|---|
| 693 | 713 | |
|---|
| 694 | 714 | /* |
|---|
| 695 | 715 | * We don't want to add the !! command to the history buffer. It |
|---|
| .. | .. |
|---|
| 721 | 741 | if (op) { |
|---|
| 722 | 742 | return (AE_OK); |
|---|
| 723 | 743 | } |
|---|
| 744 | + break; |
|---|
| 745 | + |
|---|
| 746 | + case CMD_ALL: |
|---|
| 747 | + |
|---|
| 748 | + acpi_os_printf("Executing all objects with NameSeg: %s\n", |
|---|
| 749 | + acpi_gbl_db_args[1]); |
|---|
| 750 | + acpi_db_execute(acpi_gbl_db_args[1], &acpi_gbl_db_args[2], |
|---|
| 751 | + &acpi_gbl_db_arg_types[2], |
|---|
| 752 | + EX_NO_SINGLE_STEP | EX_ALL); |
|---|
| 724 | 753 | break; |
|---|
| 725 | 754 | |
|---|
| 726 | 755 | case CMD_ALLOCATIONS: |
|---|
| .. | .. |
|---|
| 790 | 819 | status = acpi_db_find_name_in_namespace(acpi_gbl_db_args[1]); |
|---|
| 791 | 820 | break; |
|---|
| 792 | 821 | |
|---|
| 822 | + case CMD_FIELDS: |
|---|
| 823 | + |
|---|
| 824 | + status = acpi_ut_strtoul64(acpi_gbl_db_args[1], &temp64); |
|---|
| 825 | + |
|---|
| 826 | + if (ACPI_FAILURE(status) |
|---|
| 827 | + || temp64 >= ACPI_NUM_PREDEFINED_REGIONS) { |
|---|
| 828 | + acpi_os_printf |
|---|
| 829 | + ("Invalid address space ID: must be between 0 and %u inclusive\n", |
|---|
| 830 | + ACPI_NUM_PREDEFINED_REGIONS - 1); |
|---|
| 831 | + return (AE_OK); |
|---|
| 832 | + } |
|---|
| 833 | + |
|---|
| 834 | + status = acpi_db_display_fields((u32)temp64); |
|---|
| 835 | + break; |
|---|
| 836 | + |
|---|
| 793 | 837 | case CMD_GO: |
|---|
| 794 | 838 | |
|---|
| 795 | 839 | acpi_gbl_cm_single_step = FALSE; |
|---|
| .. | .. |
|---|
| 853 | 897 | |
|---|
| 854 | 898 | if (param_count == 0) { |
|---|
| 855 | 899 | acpi_os_printf |
|---|
| 856 | | - ("Current debug level for file output is: %8.8lX\n", |
|---|
| 900 | + ("Current debug level for file output is: %8.8X\n", |
|---|
| 857 | 901 | acpi_gbl_db_debug_level); |
|---|
| 858 | 902 | acpi_os_printf |
|---|
| 859 | | - ("Current debug level for console output is: %8.8lX\n", |
|---|
| 903 | + ("Current debug level for console output is: %8.8X\n", |
|---|
| 860 | 904 | acpi_gbl_db_console_debug_level); |
|---|
| 861 | 905 | } else if (param_count == 2) { |
|---|
| 862 | 906 | temp = acpi_gbl_db_console_debug_level; |
|---|
| 863 | 907 | acpi_gbl_db_console_debug_level = |
|---|
| 864 | 908 | strtoul(acpi_gbl_db_args[1], NULL, 16); |
|---|
| 865 | 909 | acpi_os_printf |
|---|
| 866 | | - ("Debug Level for console output was %8.8lX, now %8.8lX\n", |
|---|
| 910 | + ("Debug Level for console output was %8.8X, now %8.8X\n", |
|---|
| 867 | 911 | temp, acpi_gbl_db_console_debug_level); |
|---|
| 868 | 912 | } else { |
|---|
| 869 | 913 | temp = acpi_gbl_db_debug_level; |
|---|
| 870 | 914 | acpi_gbl_db_debug_level = |
|---|
| 871 | 915 | strtoul(acpi_gbl_db_args[1], NULL, 16); |
|---|
| 872 | 916 | acpi_os_printf |
|---|
| 873 | | - ("Debug Level for file output was %8.8lX, now %8.8lX\n", |
|---|
| 917 | + ("Debug Level for file output was %8.8X, now %8.8X\n", |
|---|
| 874 | 918 | temp, acpi_gbl_db_debug_level); |
|---|
| 875 | 919 | } |
|---|
| 876 | 920 | break; |
|---|