aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/psloop.c
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2009-11-11 20:57:53 -0500
committerLen Brown <len.brown@intel.com>2009-11-24 21:31:11 -0500
commit9a884ab64a4d092b4c3bf24fd9a30f7fbd4591e7 (patch)
tree6b9fae885e7c6fc46e732db201a52a5c49260947 /drivers/acpi/acpica/psloop.c
parentdc95a270c684e771b25dce0b60559cc80c033f22 (diff)
ACPICA: Add additional module-level code support
This change will execute module-level code that is not at the root of the namespace (under a Device object, etc.). ACPICA BZ 762. http://www.acpica.org/bugzilla/show_bug.cgi?id=762 Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/psloop.c')
-rw-r--r--drivers/acpi/acpica/psloop.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index cd7995b3aed4..0988e4a8901d 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -87,7 +87,8 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
87 union acpi_parse_object *op, acpi_status status); 87 union acpi_parse_object *op, acpi_status status);
88 88
89static void 89static void
90acpi_ps_link_module_code(u8 *aml_start, u32 aml_length, acpi_owner_id owner_id); 90acpi_ps_link_module_code(union acpi_parse_object *parent_op,
91 u8 *aml_start, u32 aml_length, acpi_owner_id owner_id);
91 92
92/******************************************************************************* 93/*******************************************************************************
93 * 94 *
@@ -479,11 +480,14 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
479 */ 480 */
480 if (walk_state->pass_number == 481 if (walk_state->pass_number ==
481 ACPI_IMODE_LOAD_PASS1) { 482 ACPI_IMODE_LOAD_PASS1) {
482 acpi_ps_link_module_code(aml_op_start, 483 acpi_ps_link_module_code(op->common.
483 walk_state-> 484 parent,
485 aml_op_start,
486 (u32)
487 (walk_state->
484 parser_state. 488 parser_state.
485 pkg_end - 489 pkg_end -
486 aml_op_start, 490 aml_op_start),
487 walk_state-> 491 walk_state->
488 owner_id); 492 owner_id);
489 } 493 }
@@ -598,7 +602,8 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
598 * 602 *
599 * FUNCTION: acpi_ps_link_module_code 603 * FUNCTION: acpi_ps_link_module_code
600 * 604 *
601 * PARAMETERS: aml_start - Pointer to the AML 605 * PARAMETERS: parent_op - Parent parser op
606 * aml_start - Pointer to the AML
602 * aml_length - Length of executable AML 607 * aml_length - Length of executable AML
603 * owner_id - owner_id of module level code 608 * owner_id - owner_id of module level code
604 * 609 *
@@ -611,11 +616,13 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
611 ******************************************************************************/ 616 ******************************************************************************/
612 617
613static void 618static void
614acpi_ps_link_module_code(u8 *aml_start, u32 aml_length, acpi_owner_id owner_id) 619acpi_ps_link_module_code(union acpi_parse_object *parent_op,
620 u8 *aml_start, u32 aml_length, acpi_owner_id owner_id)
615{ 621{
616 union acpi_operand_object *prev; 622 union acpi_operand_object *prev;
617 union acpi_operand_object *next; 623 union acpi_operand_object *next;
618 union acpi_operand_object *method_obj; 624 union acpi_operand_object *method_obj;
625 struct acpi_namespace_node *parent_node;
619 626
620 /* Get the tail of the list */ 627 /* Get the tail of the list */
621 628
@@ -639,11 +646,24 @@ acpi_ps_link_module_code(u8 *aml_start, u32 aml_length, acpi_owner_id owner_id)
639 return; 646 return;
640 } 647 }
641 648
649 if (parent_op->common.node) {
650 parent_node = parent_op->common.node;
651 } else {
652 parent_node = acpi_gbl_root_node;
653 }
654
642 method_obj->method.aml_start = aml_start; 655 method_obj->method.aml_start = aml_start;
643 method_obj->method.aml_length = aml_length; 656 method_obj->method.aml_length = aml_length;
644 method_obj->method.owner_id = owner_id; 657 method_obj->method.owner_id = owner_id;
645 method_obj->method.flags |= AOPOBJ_MODULE_LEVEL; 658 method_obj->method.flags |= AOPOBJ_MODULE_LEVEL;
646 659
660 /*
661 * Save the parent node in next_object. This is cheating, but we
662 * don't want to expand the method object.
663 */
664 method_obj->method.next_object =
665 ACPI_CAST_PTR(union acpi_operand_object, parent_node);
666
647 if (!prev) { 667 if (!prev) {
648 acpi_gbl_module_code_list = method_obj; 668 acpi_gbl_module_code_list = method_obj;
649 } else { 669 } else {