aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2009-12-11 02:28:27 -0500
committerLen Brown <len.brown@intel.com>2009-12-15 17:29:37 -0500
commite31c32cfe52e98344dad28853c3331879f72c4b0 (patch)
tree6eb3fe63ef91c8125757f52ddfe0e9a82d22cff0 /drivers
parent465da9eb75665203a826f961de74a817b870850a (diff)
ACPICA: Module-level code: enable _REG execution in same scope
This change enables the execution of _REG methods that appear in the same scope as the module-level code, in resonse to an operation region declaration within the module-level code. 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')
-rw-r--r--drivers/acpi/acpica/acobject.h6
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/evrgnini.c15
-rw-r--r--drivers/acpi/acpica/nsaccess.c2
-rw-r--r--drivers/acpi/acpica/nseval.c12
-rw-r--r--drivers/acpi/acpica/psxface.c3
6 files changed, 36 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index b39d682a2140..64062b1be3ee 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -180,7 +180,11 @@ struct acpi_object_method {
180 u8 sync_level; 180 u8 sync_level;
181 union acpi_operand_object *mutex; 181 union acpi_operand_object *mutex;
182 u8 *aml_start; 182 u8 *aml_start;
183 ACPI_INTERNAL_METHOD implementation; 183 union {
184 ACPI_INTERNAL_METHOD implementation;
185 union acpi_operand_object *handler;
186 } extra;
187
184 u32 aml_length; 188 u32 aml_length;
185 u8 thread_count; 189 u8 thread_count;
186 acpi_owner_id owner_id; 190 acpi_owner_id owner_id;
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 567a4899a018..e786f9fd767f 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -414,7 +414,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
414 /* Invoke an internal method if necessary */ 414 /* Invoke an internal method if necessary */
415 415
416 if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { 416 if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
417 status = obj_desc->method.implementation(next_walk_state); 417 status = obj_desc->method.extra.implementation(next_walk_state);
418 if (status == AE_OK) { 418 if (status == AE_OK) {
419 status = AE_CTRL_TERMINATE; 419 status = AE_CTRL_TERMINATE;
420 } 420 }
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index cf29c4953028..ff168052a332 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -575,6 +575,21 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
575 handler_obj = obj_desc->thermal_zone.handler; 575 handler_obj = obj_desc->thermal_zone.handler;
576 break; 576 break;
577 577
578 case ACPI_TYPE_METHOD:
579 /*
580 * If we are executing module level code, the original
581 * Node's object was replaced by this Method object and we
582 * saved the handler in the method object.
583 *
584 * See acpi_ns_exec_module_code
585 */
586 if (obj_desc->method.
587 flags & AOPOBJ_MODULE_LEVEL) {
588 handler_obj =
589 obj_desc->method.extra.handler;
590 }
591 break;
592
578 default: 593 default:
579 /* Ignore other objects */ 594 /* Ignore other objects */
580 break; 595 break;
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index 9c3cdbe2d82a..d622ba770000 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -165,7 +165,7 @@ acpi_status acpi_ns_root_initialize(void)
165 165
166 obj_desc->method.method_flags = 166 obj_desc->method.method_flags =
167 AML_METHOD_INTERNAL_ONLY; 167 AML_METHOD_INTERNAL_ONLY;
168 obj_desc->method.implementation = 168 obj_desc->method.extra.implementation =
169 acpi_ut_osi_implementation; 169 acpi_ut_osi_implementation;
170#endif 170#endif
171 break; 171 break;
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index 65e0d1a260ea..af9fe9103734 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -381,6 +381,18 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
381 method_obj->method.next_object); 381 method_obj->method.next_object);
382 type = acpi_ns_get_type(parent_node); 382 type = acpi_ns_get_type(parent_node);
383 383
384 /*
385 * Get the region handler and save it in the method object. We may need
386 * this if an operation region declaration causes a _REG method to be run.
387 *
388 * We can't do this in acpi_ps_link_module_code because
389 * acpi_gbl_root_node->Object is NULL at PASS1.
390 */
391 if ((type == ACPI_TYPE_DEVICE) && parent_node->object) {
392 method_obj->method.extra.handler =
393 parent_node->object->device.handler;
394 }
395
384 /* Must clear next_object (acpi_ns_attach_object needs the field) */ 396 /* Must clear next_object (acpi_ns_attach_object needs the field) */
385 397
386 method_obj->method.next_object = NULL; 398 method_obj->method.next_object = NULL;
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 12934ad6da8e..d0c1b91eb8ca 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -287,7 +287,8 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
287 /* Invoke an internal method if necessary */ 287 /* Invoke an internal method if necessary */
288 288
289 if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { 289 if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
290 status = info->obj_desc->method.implementation(walk_state); 290 status =
291 info->obj_desc->method.extra.implementation(walk_state);
291 info->return_object = walk_state->return_desc; 292 info->return_object = walk_state->return_desc;
292 293
293 /* Cleanup states */ 294 /* Cleanup states */