aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-06-10 02:25:05 -0400
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 17:27:04 -0400
commit71d993e115706a4108bdc7e3cb3cf25309f17aa6 (patch)
tree30c87325e161719f309c39bbd7204c4b4bb4bdd8 /drivers
parent5a1a57efeb152d6b8a3b2a20f6b192d074e919ec (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')
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c20
-rw-r--r--drivers/acpi/dispatcher/dswexec.c8
-rw-r--r--drivers/acpi/executer/exdump.c68
-rw-r--r--drivers/acpi/executer/exresop.c4
-rw-r--r--drivers/acpi/executer/exstore.c6
-rw-r--r--drivers/acpi/namespace/nsdump.c4
6 files changed, 34 insertions, 76 deletions
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index ac0bfb1b16fe..6a81c4400edf 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -691,12 +691,6 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
691 691
692 status = acpi_ex_resolve_operands(op->common.aml_opcode, 692 status = acpi_ex_resolve_operands(op->common.aml_opcode,
693 ACPI_WALK_OPERANDS, walk_state); 693 ACPI_WALK_OPERANDS, walk_state);
694
695 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
696 acpi_ps_get_opcode_name(op->common.aml_opcode),
697 walk_state->num_operands,
698 "after AcpiExResolveOperands");
699
700 if (ACPI_FAILURE(status)) { 694 if (ACPI_FAILURE(status)) {
701 ACPI_ERROR((AE_INFO, "(%s) bad operand(s) (%X)", 695 ACPI_ERROR((AE_INFO, "(%s) bad operand(s) (%X)",
702 acpi_ps_get_opcode_name(op->common.aml_opcode), 696 acpi_ps_get_opcode_name(op->common.aml_opcode),
@@ -785,10 +779,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
785 return_ACPI_STATUS(status); 779 return_ACPI_STATUS(status);
786 } 780 }
787 781
788 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
789 acpi_ps_get_opcode_name(op->common.aml_opcode),
790 1, "after AcpiExResolveOperands");
791
792 obj_desc = acpi_ns_get_attached_object(node); 782 obj_desc = acpi_ns_get_attached_object(node);
793 if (!obj_desc) { 783 if (!obj_desc) {
794 return_ACPI_STATUS(AE_NOT_EXIST); 784 return_ACPI_STATUS(AE_NOT_EXIST);
@@ -882,10 +872,6 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
882 return_ACPI_STATUS(status); 872 return_ACPI_STATUS(status);
883 } 873 }
884 874
885 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
886 acpi_ps_get_opcode_name(op->common.aml_opcode),
887 1, "after AcpiExResolveOperands");
888
889 operand = &walk_state->operands[0]; 875 operand = &walk_state->operands[0];
890 876
891 /* Find the ACPI table */ 877 /* Find the ACPI table */
@@ -1091,10 +1077,8 @@ acpi_ds_eval_bank_field_operands(struct acpi_walk_state *walk_state,
1091 return_ACPI_STATUS(status); 1077 return_ACPI_STATUS(status);
1092 } 1078 }
1093 1079
1094 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, 1080 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS,
1095 acpi_ps_get_opcode_name(op->common.aml_opcode), 1081 acpi_ps_get_opcode_name(op->common.aml_opcode), 1);
1096 1, "after AcpiExResolveOperands");
1097
1098 /* 1082 /*
1099 * Get the bank_value operand and save it 1083 * Get the bank_value operand and save it
1100 * (at Top of stack) 1084 * (at Top of stack)
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index b246b9657ead..b5072fa9c920 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -408,14 +408,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
408 [walk_state-> 408 [walk_state->
409 num_operands - 1]), 409 num_operands - 1]),
410 walk_state); 410 walk_state);
411 if (ACPI_SUCCESS(status)) {
412 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS,
413 ACPI_IMODE_EXECUTE,
414 acpi_ps_get_opcode_name
415 (walk_state->opcode),
416 walk_state->num_operands,
417 "after ExResolveOperands");
418 }
419 } 411 }
420 412
421 if (ACPI_SUCCESS(status)) { 413 if (ACPI_SUCCESS(status)) {
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
771void 764void
772acpi_ex_dump_operands(union acpi_operand_object **operands, 765acpi_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
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 904f9510c0e2..0ab22004728a 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -515,12 +515,12 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
515 515
516 if (obj_type > ACPI_TYPE_LOCAL_MAX) { 516 if (obj_type > ACPI_TYPE_LOCAL_MAX) {
517 acpi_os_printf 517 acpi_os_printf
518 ("(Ptr to ACPI Object type %X [UNKNOWN])\n", 518 ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
519 obj_type); 519 obj_type);
520 bytes_to_dump = 32; 520 bytes_to_dump = 32;
521 } else { 521 } else {
522 acpi_os_printf 522 acpi_os_printf
523 ("(Ptr to ACPI Object type %X [%s])\n", 523 ("(Pointer to ACPI Object type %.2X [%s])\n",
524 obj_type, acpi_ut_get_type_name(obj_type)); 524 obj_type, acpi_ut_get_type_name(obj_type));
525 bytes_to_dump = 525 bytes_to_dump =
526 sizeof(union acpi_operand_object); 526 sizeof(union acpi_operand_object);