diff options
author | Bob Moore <robert.moore@intel.com> | 2008-06-10 02:25:05 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:04 -0400 |
commit | 71d993e115706a4108bdc7e3cb3cf25309f17aa6 (patch) | |
tree | 30c87325e161719f309c39bbd7204c4b4bb4bdd8 /drivers/acpi/executer | |
parent | 5a1a57efeb152d6b8a3b2a20f6b192d074e919ec (diff) |
ACPICA: Cleanup debug operand dump mechanism
Eliminated unnecessary operands; eliminated use of negative index
in loop. Operands now displayed in correct order, not backwards.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/exdump.c | 68 | ||||
-rw-r--r-- | drivers/acpi/executer/exresop.c | 4 | ||||
-rw-r--r-- | drivers/acpi/executer/exstore.c | 6 |
3 files changed, 30 insertions, 48 deletions
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c index f337c3f73e0c..2be2e2bf95bf 100644 --- a/drivers/acpi/executer/exdump.c +++ b/drivers/acpi/executer/exdump.c | |||
@@ -580,25 +580,22 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
580 | 580 | ||
581 | case ACPI_TYPE_BUFFER: | 581 | case ACPI_TYPE_BUFFER: |
582 | 582 | ||
583 | acpi_os_printf("Buffer len %X @ %p\n", | 583 | acpi_os_printf("Buffer length %.2X @ %p\n", |
584 | obj_desc->buffer.length, | 584 | obj_desc->buffer.length, |
585 | obj_desc->buffer.pointer); | 585 | obj_desc->buffer.pointer); |
586 | 586 | ||
587 | length = obj_desc->buffer.length; | ||
588 | if (length > 64) { | ||
589 | length = 64; | ||
590 | } | ||
591 | |||
592 | /* Debug only -- dump the buffer contents */ | 587 | /* Debug only -- dump the buffer contents */ |
593 | 588 | ||
594 | if (obj_desc->buffer.pointer) { | 589 | if (obj_desc->buffer.pointer) { |
595 | acpi_os_printf("Buffer Contents: "); | 590 | length = obj_desc->buffer.length; |
596 | 591 | if (length > 128) { | |
597 | for (index = 0; index < length; index++) { | 592 | length = 128; |
598 | acpi_os_printf(" %02x", | ||
599 | obj_desc->buffer.pointer[index]); | ||
600 | } | 593 | } |
601 | acpi_os_printf("\n"); | 594 | |
595 | acpi_os_printf | ||
596 | ("Buffer Contents: (displaying length 0x%.2X)\n", | ||
597 | length); | ||
598 | ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, length); | ||
602 | } | 599 | } |
603 | break; | 600 | break; |
604 | 601 | ||
@@ -756,55 +753,42 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
756 | * | 753 | * |
757 | * FUNCTION: acpi_ex_dump_operands | 754 | * FUNCTION: acpi_ex_dump_operands |
758 | * | 755 | * |
759 | * PARAMETERS: Operands - Operand list | 756 | * PARAMETERS: Operands - A list of Operand objects |
760 | * interpreter_mode - Load or Exec | 757 | * opcode_name - AML opcode name |
761 | * Ident - Identification | 758 | * num_operands - Operand count for this opcode |
762 | * num_levels - # of stack entries to dump above line | ||
763 | * Note - Output notation | ||
764 | * module_name - Caller's module name | ||
765 | * line_number - Caller's invocation line number | ||
766 | * | 759 | * |
767 | * DESCRIPTION: Dump the object stack | 760 | * DESCRIPTION: Dump the operands associated with the opcode |
768 | * | 761 | * |
769 | ******************************************************************************/ | 762 | ******************************************************************************/ |
770 | 763 | ||
771 | void | 764 | void |
772 | acpi_ex_dump_operands(union acpi_operand_object **operands, | 765 | acpi_ex_dump_operands(union acpi_operand_object **operands, |
773 | acpi_interpreter_mode interpreter_mode, | 766 | const char *opcode_name, u32 num_operands) |
774 | const char *ident, | ||
775 | u32 num_levels, | ||
776 | const char *note, | ||
777 | const char *module_name, u32 line_number) | ||
778 | { | 767 | { |
779 | s32 i; | ||
780 | |||
781 | ACPI_FUNCTION_NAME(ex_dump_operands); | 768 | ACPI_FUNCTION_NAME(ex_dump_operands); |
782 | 769 | ||
783 | if (!ident) { | 770 | if (!opcode_name) { |
784 | ident = "?"; | 771 | opcode_name = "UNKNOWN"; |
785 | } | ||
786 | |||
787 | if (!note) { | ||
788 | note = "?"; | ||
789 | } | 772 | } |
790 | 773 | ||
791 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 774 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
792 | "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", | 775 | "**** Start operand dump for opcode [%s], %d operands\n", |
793 | ident, num_levels)); | 776 | opcode_name, num_operands)); |
794 | 777 | ||
795 | if (num_levels == 0) { | 778 | if (num_operands == 0) { |
796 | num_levels = 1; | 779 | num_operands = 1; |
797 | } | 780 | } |
798 | 781 | ||
799 | /* Dump the operand stack starting at the top */ | 782 | /* Dump the individual operands */ |
800 | 783 | ||
801 | for (i = 0; num_levels > 0; i--, num_levels--) { | 784 | while (num_operands) { |
802 | acpi_ex_dump_operand(operands[i], 0); | 785 | acpi_ex_dump_operand(*operands, 0); |
786 | operands++; | ||
787 | num_operands--; | ||
803 | } | 788 | } |
804 | 789 | ||
805 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 790 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
806 | "************* Operand Stack dump from %s(%d), %s\n", | 791 | "**** End operand dump for [%s]\n", opcode_name)); |
807 | module_name, line_number, note)); | ||
808 | return; | 792 | return; |
809 | } | 793 | } |
810 | 794 | ||
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c index 73e29e566a70..54085f16ec28 100644 --- a/drivers/acpi/executer/exresop.c +++ b/drivers/acpi/executer/exresop.c | |||
@@ -698,5 +698,9 @@ acpi_ex_resolve_operands(u16 opcode, | |||
698 | } | 698 | } |
699 | } | 699 | } |
700 | 700 | ||
701 | ACPI_DUMP_OPERANDS(walk_state->operands, | ||
702 | acpi_ps_get_opcode_name(opcode), | ||
703 | walk_state->num_operands); | ||
704 | |||
701 | return_ACPI_STATUS(status); | 705 | return_ACPI_STATUS(status); |
702 | } | 706 | } |
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c index 76c875bc3154..38b55e352495 100644 --- a/drivers/acpi/executer/exstore.c +++ b/drivers/acpi/executer/exstore.c | |||
@@ -343,12 +343,6 @@ acpi_ex_store(union acpi_operand_object *source_desc, | |||
343 | acpi_ut_get_object_type_name(dest_desc), | 343 | acpi_ut_get_object_type_name(dest_desc), |
344 | dest_desc)); | 344 | dest_desc)); |
345 | 345 | ||
346 | ACPI_DUMP_STACK_ENTRY(source_desc); | ||
347 | ACPI_DUMP_STACK_ENTRY(dest_desc); | ||
348 | ACPI_DUMP_OPERANDS(&dest_desc, ACPI_IMODE_EXECUTE, "ExStore", | ||
349 | 2, | ||
350 | "Target is not a Reference or Constant object"); | ||
351 | |||
352 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 346 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
353 | } | 347 | } |
354 | 348 | ||