diff options
author | Bob Moore <robert.moore@intel.com> | 2008-09-26 23:08:41 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-22 23:14:45 -0400 |
commit | 1044f1f65b7df2aae979e397904c4985eeb99ba2 (patch) | |
tree | 8feb6f2db4f36b75d8c7126d51a7b35e57e13194 /drivers/acpi/dispatcher/dsobject.c | |
parent | 2425a0967f29b196fad5d4f726c9502679284656 (diff) |
ACPICA: Cleanup for internal Reference Object
Fix some sloppiness in the Reference object. No longer use AML
opcodes to differentiate the types, introduce new reference
Class. Cleanup the debug output code.
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>
Diffstat (limited to 'drivers/acpi/dispatcher/dsobject.c')
-rw-r--r-- | drivers/acpi/dispatcher/dsobject.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c index 09af39fff1a3..4f08e599d07e 100644 --- a/drivers/acpi/dispatcher/dsobject.c +++ b/drivers/acpi/dispatcher/dsobject.c | |||
@@ -731,36 +731,35 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
731 | switch (op_info->type) { | 731 | switch (op_info->type) { |
732 | case AML_TYPE_LOCAL_VARIABLE: | 732 | case AML_TYPE_LOCAL_VARIABLE: |
733 | 733 | ||
734 | /* Split the opcode into a base opcode + offset */ | 734 | /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */ |
735 | 735 | ||
736 | obj_desc->reference.opcode = AML_LOCAL_OP; | 736 | obj_desc->reference.value = opcode - AML_LOCAL_OP; |
737 | obj_desc->reference.offset = opcode - AML_LOCAL_OP; | 737 | obj_desc->reference.class = ACPI_REFCLASS_LOCAL; |
738 | 738 | ||
739 | #ifndef ACPI_NO_METHOD_EXECUTION | 739 | #ifndef ACPI_NO_METHOD_EXECUTION |
740 | status = acpi_ds_method_data_get_node(AML_LOCAL_OP, | 740 | status = |
741 | obj_desc-> | 741 | acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL, |
742 | reference.offset, | 742 | obj_desc->reference. |
743 | walk_state, | 743 | value, walk_state, |
744 | ACPI_CAST_INDIRECT_PTR | 744 | ACPI_CAST_INDIRECT_PTR |
745 | (struct | 745 | (struct |
746 | acpi_namespace_node, | 746 | acpi_namespace_node, |
747 | &obj_desc-> | 747 | &obj_desc->reference. |
748 | reference. | 748 | object)); |
749 | object)); | ||
750 | #endif | 749 | #endif |
751 | break; | 750 | break; |
752 | 751 | ||
753 | case AML_TYPE_METHOD_ARGUMENT: | 752 | case AML_TYPE_METHOD_ARGUMENT: |
754 | 753 | ||
755 | /* Split the opcode into a base opcode + offset */ | 754 | /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */ |
756 | 755 | ||
757 | obj_desc->reference.opcode = AML_ARG_OP; | 756 | obj_desc->reference.value = opcode - AML_ARG_OP; |
758 | obj_desc->reference.offset = opcode - AML_ARG_OP; | 757 | obj_desc->reference.class = ACPI_REFCLASS_ARG; |
759 | 758 | ||
760 | #ifndef ACPI_NO_METHOD_EXECUTION | 759 | #ifndef ACPI_NO_METHOD_EXECUTION |
761 | status = acpi_ds_method_data_get_node(AML_ARG_OP, | 760 | status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG, |
762 | obj_desc-> | 761 | obj_desc-> |
763 | reference.offset, | 762 | reference.value, |
764 | walk_state, | 763 | walk_state, |
765 | ACPI_CAST_INDIRECT_PTR | 764 | ACPI_CAST_INDIRECT_PTR |
766 | (struct | 765 | (struct |
@@ -771,18 +770,31 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
771 | #endif | 770 | #endif |
772 | break; | 771 | break; |
773 | 772 | ||
774 | default: /* Other literals, etc.. */ | 773 | default: /* Object name or Debug object */ |
775 | 774 | ||
776 | if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { | 775 | switch (op->common.aml_opcode) { |
776 | case AML_INT_NAMEPATH_OP: | ||
777 | 777 | ||
778 | /* Node was saved in Op */ | 778 | /* Node was saved in Op */ |
779 | 779 | ||
780 | obj_desc->reference.node = op->common.node; | 780 | obj_desc->reference.node = op->common.node; |
781 | obj_desc->reference.object = | 781 | obj_desc->reference.object = |
782 | op->common.node->object; | 782 | op->common.node->object; |
783 | } | 783 | obj_desc->reference.class = ACPI_REFCLASS_NAME; |
784 | break; | ||
785 | |||
786 | case AML_DEBUG_OP: | ||
784 | 787 | ||
785 | obj_desc->reference.opcode = opcode; | 788 | obj_desc->reference.class = ACPI_REFCLASS_DEBUG; |
789 | break; | ||
790 | |||
791 | default: | ||
792 | |||
793 | ACPI_ERROR((AE_INFO, | ||
794 | "Unimplemented reference type for AML opcode: %4.4X", | ||
795 | opcode)); | ||
796 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | ||
797 | } | ||
786 | break; | 798 | break; |
787 | } | 799 | } |
788 | break; | 800 | break; |