aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswexec.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@tglx.tec.linutronix.de>2005-07-13 04:45:00 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-07-13 04:45:00 -0400
commit1b3035b7fcc72b6b36f2a3634dad832eb2453ce8 (patch)
tree728174d72943cc9b981a5843553551df62eddc41 /drivers/acpi/dispatcher/dswexec.c
parenta98a5d04f400ad112e59cadd739dbabf89417e60 (diff)
parentc32511e2718618f0b53479eb36e07439aa363a74 (diff)
Merge with rsync://fileserver/linux
Diffstat (limited to 'drivers/acpi/dispatcher/dswexec.c')
-rw-r--r--drivers/acpi/dispatcher/dswexec.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 2071a0d2bbbb..10f71318e23b 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -73,11 +73,13 @@ static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = {
73 acpi_ex_opcode_3A_1T_1R, 73 acpi_ex_opcode_3A_1T_1R,
74 acpi_ex_opcode_6A_0T_1R}; 74 acpi_ex_opcode_6A_0T_1R};
75 75
76
76/***************************************************************************** 77/*****************************************************************************
77 * 78 *
78 * FUNCTION: acpi_ds_get_predicate_value 79 * FUNCTION: acpi_ds_get_predicate_value
79 * 80 *
80 * PARAMETERS: walk_state - Current state of the parse tree walk 81 * PARAMETERS: walk_state - Current state of the parse tree walk
82 * result_obj - if non-zero, pop result from result stack
81 * 83 *
82 * RETURN: Status 84 * RETURN: Status
83 * 85 *
@@ -124,7 +126,8 @@ acpi_ds_get_predicate_value (
124 } 126 }
125 127
126 if (!obj_desc) { 128 if (!obj_desc) {
127 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate obj_desc=%p State=%p\n", 129 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
130 "No predicate obj_desc=%p State=%p\n",
128 obj_desc, walk_state)); 131 obj_desc, walk_state));
129 132
130 return_ACPI_STATUS (AE_AML_NO_OPERAND); 133 return_ACPI_STATUS (AE_AML_NO_OPERAND);
@@ -197,7 +200,7 @@ cleanup:
197 * FUNCTION: acpi_ds_exec_begin_op 200 * FUNCTION: acpi_ds_exec_begin_op
198 * 201 *
199 * PARAMETERS: walk_state - Current state of the parse tree walk 202 * PARAMETERS: walk_state - Current state of the parse tree walk
200 * out_op - Return op if a new one is created 203 * out_op - Where to return op if a new one is created
201 * 204 *
202 * RETURN: Status 205 * RETURN: Status
203 * 206 *
@@ -233,7 +236,8 @@ acpi_ds_exec_begin_op (
233 walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); 236 walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
234 237
235 if (acpi_ns_opens_scope (walk_state->op_info->object_type)) { 238 if (acpi_ns_opens_scope (walk_state->op_info->object_type)) {
236 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n", 239 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
240 "(%s) Popping scope for Op %p\n",
237 acpi_ut_get_type_name (walk_state->op_info->object_type), op)); 241 acpi_ut_get_type_name (walk_state->op_info->object_type), op));
238 242
239 status = acpi_ds_scope_stack_pop (walk_state); 243 status = acpi_ds_scope_stack_pop (walk_state);
@@ -297,11 +301,10 @@ acpi_ds_exec_begin_op (
297 301
298 if (walk_state->walk_type == ACPI_WALK_METHOD) { 302 if (walk_state->walk_type == ACPI_WALK_METHOD) {
299 /* 303 /*
300 * Found a named object declaration during method 304 * Found a named object declaration during method execution;
301 * execution; we must enter this object into the 305 * we must enter this object into the namespace. The created
302 * namespace. The created object is temporary and 306 * object is temporary and will be deleted upon completion of
303 * will be deleted upon completion of the execution 307 * the execution of this method.
304 * of this method.
305 */ 308 */
306 status = acpi_ds_load2_begin_op (walk_state, NULL); 309 status = acpi_ds_load2_begin_op (walk_state, NULL);
307 } 310 }
@@ -338,8 +341,6 @@ acpi_ds_exec_begin_op (
338 * FUNCTION: acpi_ds_exec_end_op 341 * FUNCTION: acpi_ds_exec_end_op
339 * 342 *
340 * PARAMETERS: walk_state - Current state of the parse tree walk 343 * PARAMETERS: walk_state - Current state of the parse tree walk
341 * Op - Op that has been just been completed in the
342 * walk; Arguments have now been evaluated.
343 * 344 *
344 * RETURN: Status 345 * RETURN: Status
345 * 346 *
@@ -389,7 +390,7 @@ acpi_ds_exec_end_op (
389 /* Decode the Opcode Class */ 390 /* Decode the Opcode Class */
390 391
391 switch (op_class) { 392 switch (op_class) {
392 case AML_CLASS_ARGUMENT: /* constants, literals, etc. -- do nothing */ 393 case AML_CLASS_ARGUMENT: /* constants, literals, etc. - do nothing */
393 break; 394 break;
394 395
395 396
@@ -417,12 +418,12 @@ acpi_ds_exec_end_op (
417 /* Resolve all operands */ 418 /* Resolve all operands */
418 419
419 status = acpi_ex_resolve_operands (walk_state->opcode, 420 status = acpi_ex_resolve_operands (walk_state->opcode,
420 &(walk_state->operands [walk_state->num_operands -1]), 421 &(walk_state->operands [walk_state->num_operands -1]),
421 walk_state); 422 walk_state);
422 if (ACPI_SUCCESS (status)) { 423 if (ACPI_SUCCESS (status)) {
423 ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, 424 ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
424 acpi_ps_get_opcode_name (walk_state->opcode), 425 acpi_ps_get_opcode_name (walk_state->opcode),
425 walk_state->num_operands, "after ex_resolve_operands"); 426 walk_state->num_operands, "after ex_resolve_operands");
426 } 427 }
427 } 428 }
428 429
@@ -506,7 +507,8 @@ acpi_ds_exec_end_op (
506 if ((op->asl.parent) && 507 if ((op->asl.parent) &&
507 ((op->asl.parent->asl.aml_opcode == AML_PACKAGE_OP) || 508 ((op->asl.parent->asl.aml_opcode == AML_PACKAGE_OP) ||
508 (op->asl.parent->asl.aml_opcode == AML_VAR_PACKAGE_OP))) { 509 (op->asl.parent->asl.aml_opcode == AML_VAR_PACKAGE_OP))) {
509 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method Reference in a Package, Op=%p\n", op)); 510 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
511 "Method Reference in a Package, Op=%p\n", op));
510 op->common.node = (struct acpi_namespace_node *) op->asl.value.arg->asl.node->object; 512 op->common.node = (struct acpi_namespace_node *) op->asl.value.arg->asl.node->object;
511 acpi_ut_add_reference (op->asl.value.arg->asl.node->object); 513 acpi_ut_add_reference (op->asl.value.arg->asl.node->object);
512 return_ACPI_STATUS (AE_OK); 514 return_ACPI_STATUS (AE_OK);
@@ -583,13 +585,15 @@ acpi_ds_exec_end_op (
583 case AML_NAME_OP: 585 case AML_NAME_OP:
584 586
585 /* 587 /*
586 * Put the Node on the object stack (Contains the ACPI Name of 588 * Put the Node on the object stack (Contains the ACPI Name
587 * this object) 589 * of this object)
588 */ 590 */
589 walk_state->operands[0] = (void *) op->common.parent->common.node; 591 walk_state->operands[0] = (void *) op->common.parent->common.node;
590 walk_state->num_operands = 1; 592 walk_state->num_operands = 1;
591 593
592 status = acpi_ds_create_node (walk_state, op->common.parent->common.node, op->common.parent); 594 status = acpi_ds_create_node (walk_state,
595 op->common.parent->common.node,
596 op->common.parent);
593 if (ACPI_FAILURE (status)) { 597 if (ACPI_FAILURE (status)) {
594 break; 598 break;
595 } 599 }
@@ -600,7 +604,7 @@ acpi_ds_exec_end_op (
600 case AML_INT_EVAL_SUBTREE_OP: 604 case AML_INT_EVAL_SUBTREE_OP:
601 605
602 status = acpi_ds_eval_data_object_operands (walk_state, op, 606 status = acpi_ds_eval_data_object_operands (walk_state, op,
603 acpi_ns_get_attached_object (op->common.parent->common.node)); 607 acpi_ns_get_attached_object (op->common.parent->common.node));
604 break; 608 break;
605 609
606 default: 610 default:
@@ -609,7 +613,7 @@ acpi_ds_exec_end_op (
609 break; 613 break;
610 } 614 }
611 615
612 /* Done with this result state (Now that operand stack is built) */ 616 /* Done with result state (Now that operand stack is built) */
613 617
614 status = acpi_ds_result_stack_pop (walk_state); 618 status = acpi_ds_result_stack_pop (walk_state);
615 if (ACPI_FAILURE (status)) { 619 if (ACPI_FAILURE (status)) {
@@ -620,8 +624,7 @@ acpi_ds_exec_end_op (
620 * If a result object was returned from above, push it on the 624 * If a result object was returned from above, push it on the
621 * current result stack 625 * current result stack
622 */ 626 */
623 if (ACPI_SUCCESS (status) && 627 if (walk_state->result_obj) {
624 walk_state->result_obj) {
625 status = acpi_ds_result_push (walk_state->result_obj, walk_state); 628 status = acpi_ds_result_push (walk_state->result_obj, walk_state);
626 } 629 }
627 break; 630 break;
@@ -654,7 +657,8 @@ acpi_ds_exec_end_op (
654 657
655 case AML_TYPE_UNDEFINED: 658 case AML_TYPE_UNDEFINED:
656 659
657 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", op)); 660 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
661 "Undefined opcode type Op=%p\n", op));
658 return_ACPI_STATUS (AE_NOT_IMPLEMENTED); 662 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
659 663
660 664
@@ -709,13 +713,14 @@ cleanup:
709 status = acpi_gbl_exception_handler (status, 713 status = acpi_gbl_exception_handler (status,
710 walk_state->method_node->name.integer, walk_state->opcode, 714 walk_state->method_node->name.integer, walk_state->opcode,
711 walk_state->aml_offset, NULL); 715 walk_state->aml_offset, NULL);
712 acpi_ex_enter_interpreter (); 716 (void) acpi_ex_enter_interpreter ();
713 } 717 }
714 718
715 if (walk_state->result_obj) { 719 if (walk_state->result_obj) {
716 /* Break to debugger to display result */ 720 /* Break to debugger to display result */
717 721
718 ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state)); 722 ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj,
723 walk_state));
719 724
720 /* 725 /*
721 * Delete the result op if and only if: 726 * Delete the result op if and only if: