aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsopcode.c
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2008-04-10 11:06:41 -0400
committerLen Brown <len.brown@intel.com>2008-04-22 14:29:28 -0400
commit941f48bb465b0b291f8435b1e3de95b0975b84bc (patch)
tree42327b3d29fbaa55827abfe620a94320f86b6eb4 /drivers/acpi/dispatcher/dsopcode.c
parent9aa6169f471771324b476a90d9392daa06d63a2d (diff)
ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion
This enables forward references and full operand resolution for the three string arguments. Similar to OperationRegion deferred argument execution.) http://www.acpica.org/bugzilla/show_bug.cgi?id=430 Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dsopcode.c')
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c103
1 files changed, 103 insertions, 0 deletions
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index f0847eed5f3a..a3f29798d1d1 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -49,6 +49,7 @@
49#include <acpi/acinterp.h> 49#include <acpi/acinterp.h>
50#include <acpi/acnamesp.h> 50#include <acpi/acnamesp.h>
51#include <acpi/acevents.h> 51#include <acpi/acevents.h>
52#include <acpi/actables.h>
52 53
53#define _COMPONENT ACPI_DISPATCHER 54#define _COMPONENT ACPI_DISPATCHER
54ACPI_MODULE_NAME("dsopcode") 55ACPI_MODULE_NAME("dsopcode")
@@ -782,6 +783,108 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
782 783
783/******************************************************************************* 784/*******************************************************************************
784 * 785 *
786 * FUNCTION: acpi_ds_eval_table_region_operands
787 *
788 * PARAMETERS: walk_state - Current walk
789 * Op - A valid region Op object
790 *
791 * RETURN: Status
792 *
793 * DESCRIPTION: Get region address and length
794 * Called from acpi_ds_exec_end_op during data_table_region parse tree walk
795 *
796 ******************************************************************************/
797
798acpi_status
799acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
800 union acpi_parse_object *op)
801{
802 acpi_status status;
803 union acpi_operand_object *obj_desc;
804 union acpi_operand_object **operand;
805 struct acpi_namespace_node *node;
806 union acpi_parse_object *next_op;
807 acpi_native_uint table_index;
808 struct acpi_table_header *table;
809
810 ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
811
812 /*
813 * This is where we evaluate the signature_string and oem_iDString
814 * and oem_table_iDString of the data_table_region declaration
815 */
816 node = op->common.node;
817
818 /* next_op points to signature_string op */
819
820 next_op = op->common.value.arg;
821
822 /*
823 * Evaluate/create the signature_string and oem_iDString
824 * and oem_table_iDString operands
825 */
826 status = acpi_ds_create_operands(walk_state, next_op);
827 if (ACPI_FAILURE(status)) {
828 return_ACPI_STATUS(status);
829 }
830
831 /*
832 * Resolve the signature_string and oem_iDString
833 * and oem_table_iDString operands
834 */
835 status = acpi_ex_resolve_operands(op->common.aml_opcode,
836 ACPI_WALK_OPERANDS, walk_state);
837 if (ACPI_FAILURE(status)) {
838 return_ACPI_STATUS(status);
839 }
840
841 ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
842 acpi_ps_get_opcode_name(op->common.aml_opcode),
843 1, "after AcpiExResolveOperands");
844
845 operand = &walk_state->operands[0];
846
847 /* Find the ACPI table */
848
849 status = acpi_tb_find_table(operand[0]->string.pointer,
850 operand[1]->string.pointer,
851 operand[2]->string.pointer, &table_index);
852 if (ACPI_FAILURE(status)) {
853 return_ACPI_STATUS(status);
854 }
855
856 acpi_ut_remove_reference(operand[0]);
857 acpi_ut_remove_reference(operand[1]);
858 acpi_ut_remove_reference(operand[2]);
859
860 status = acpi_get_table_by_index(table_index, &table);
861 if (ACPI_FAILURE(status)) {
862 return_ACPI_STATUS(status);
863 }
864
865 obj_desc = acpi_ns_get_attached_object(node);
866 if (!obj_desc) {
867 return_ACPI_STATUS(AE_NOT_EXIST);
868 }
869
870 obj_desc->region.address =
871 (acpi_physical_address) ACPI_TO_INTEGER(table);
872 obj_desc->region.length = table->length;
873
874 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
875 obj_desc,
876 ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
877 obj_desc->region.length));
878
879 /* Now the address and length are valid for this opregion */
880
881 obj_desc->region.flags |= AOPOBJ_DATA_VALID;
882
883 return_ACPI_STATUS(status);
884}
885
886/*******************************************************************************
887 *
785 * FUNCTION: acpi_ds_eval_data_object_operands 888 * FUNCTION: acpi_ds_eval_data_object_operands
786 * 889 *
787 * PARAMETERS: walk_state - Current walk 890 * PARAMETERS: walk_state - Current walk