diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dswexec.c')
-rw-r--r-- | drivers/acpi/dispatcher/dswexec.c | 78 |
1 files changed, 34 insertions, 44 deletions
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c index 69693fa07224..b246b9657ead 100644 --- a/drivers/acpi/dispatcher/dswexec.c +++ b/drivers/acpi/dispatcher/dswexec.c | |||
@@ -6,7 +6,7 @@ | |||
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * Copyright (C) 2000 - 2007, R. Byron Moore | 9 | * Copyright (C) 2000 - 2008, Intel Corp. |
10 | * All rights reserved. | 10 | * All rights reserved. |
11 | * | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without |
@@ -285,11 +285,6 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, | |||
285 | switch (opcode_class) { | 285 | switch (opcode_class) { |
286 | case AML_CLASS_CONTROL: | 286 | case AML_CLASS_CONTROL: |
287 | 287 | ||
288 | status = acpi_ds_result_stack_push(walk_state); | ||
289 | if (ACPI_FAILURE(status)) { | ||
290 | goto error_exit; | ||
291 | } | ||
292 | |||
293 | status = acpi_ds_exec_begin_control_op(walk_state, op); | 288 | status = acpi_ds_exec_begin_control_op(walk_state, op); |
294 | break; | 289 | break; |
295 | 290 | ||
@@ -305,20 +300,11 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, | |||
305 | status = acpi_ds_load2_begin_op(walk_state, NULL); | 300 | status = acpi_ds_load2_begin_op(walk_state, NULL); |
306 | } | 301 | } |
307 | 302 | ||
308 | if (op->common.aml_opcode == AML_REGION_OP) { | ||
309 | status = acpi_ds_result_stack_push(walk_state); | ||
310 | } | ||
311 | break; | 303 | break; |
312 | 304 | ||
313 | case AML_CLASS_EXECUTE: | 305 | case AML_CLASS_EXECUTE: |
314 | case AML_CLASS_CREATE: | 306 | case AML_CLASS_CREATE: |
315 | /* | 307 | |
316 | * Most operators with arguments (except create_xxx_field operators) | ||
317 | * Start a new result/operand state | ||
318 | */ | ||
319 | if (walk_state->op_info->object_type != ACPI_TYPE_BUFFER_FIELD) { | ||
320 | status = acpi_ds_result_stack_push(walk_state); | ||
321 | } | ||
322 | break; | 308 | break; |
323 | 309 | ||
324 | default: | 310 | default: |
@@ -374,6 +360,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
374 | /* Init the walk state */ | 360 | /* Init the walk state */ |
375 | 361 | ||
376 | walk_state->num_operands = 0; | 362 | walk_state->num_operands = 0; |
363 | walk_state->operand_index = 0; | ||
377 | walk_state->return_desc = NULL; | 364 | walk_state->return_desc = NULL; |
378 | walk_state->result_obj = NULL; | 365 | walk_state->result_obj = NULL; |
379 | 366 | ||
@@ -388,10 +375,17 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
388 | /* Decode the Opcode Class */ | 375 | /* Decode the Opcode Class */ |
389 | 376 | ||
390 | switch (op_class) { | 377 | switch (op_class) { |
391 | case AML_CLASS_ARGUMENT: /* constants, literals, etc. - do nothing */ | 378 | case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */ |
379 | |||
380 | if (walk_state->opcode == AML_INT_NAMEPATH_OP) { | ||
381 | status = acpi_ds_evaluate_name_path(walk_state); | ||
382 | if (ACPI_FAILURE(status)) { | ||
383 | goto cleanup; | ||
384 | } | ||
385 | } | ||
392 | break; | 386 | break; |
393 | 387 | ||
394 | case AML_CLASS_EXECUTE: /* most operators with arguments */ | 388 | case AML_CLASS_EXECUTE: /* Most operators with arguments */ |
395 | 389 | ||
396 | /* Build resolved operand stack */ | 390 | /* Build resolved operand stack */ |
397 | 391 | ||
@@ -400,13 +394,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
400 | goto cleanup; | 394 | goto cleanup; |
401 | } | 395 | } |
402 | 396 | ||
403 | /* Done with this result state (Now that operand stack is built) */ | ||
404 | |||
405 | status = acpi_ds_result_stack_pop(walk_state); | ||
406 | if (ACPI_FAILURE(status)) { | ||
407 | goto cleanup; | ||
408 | } | ||
409 | |||
410 | /* | 397 | /* |
411 | * All opcodes require operand resolution, with the only exceptions | 398 | * All opcodes require operand resolution, with the only exceptions |
412 | * being the object_type and size_of operators. | 399 | * being the object_type and size_of operators. |
@@ -487,16 +474,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
487 | 474 | ||
488 | status = acpi_ds_exec_end_control_op(walk_state, op); | 475 | status = acpi_ds_exec_end_control_op(walk_state, op); |
489 | 476 | ||
490 | /* Make sure to properly pop the result stack */ | ||
491 | |||
492 | if (ACPI_SUCCESS(status)) { | ||
493 | status = acpi_ds_result_stack_pop(walk_state); | ||
494 | } else if (status == AE_CTRL_PENDING) { | ||
495 | status = acpi_ds_result_stack_pop(walk_state); | ||
496 | if (ACPI_SUCCESS(status)) { | ||
497 | status = AE_CTRL_PENDING; | ||
498 | } | ||
499 | } | ||
500 | break; | 477 | break; |
501 | 478 | ||
502 | case AML_TYPE_METHOD_CALL: | 479 | case AML_TYPE_METHOD_CALL: |
@@ -516,7 +493,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
516 | 493 | ||
517 | op->common.node = | 494 | op->common.node = |
518 | (struct acpi_namespace_node *)op->asl.value. | 495 | (struct acpi_namespace_node *)op->asl.value. |
519 | arg->asl.node->object; | 496 | arg->asl.node; |
520 | acpi_ut_add_reference(op->asl.value.arg->asl. | 497 | acpi_ut_add_reference(op->asl.value.arg->asl. |
521 | node->object); | 498 | node->object); |
522 | return_ACPI_STATUS(AE_OK); | 499 | return_ACPI_STATUS(AE_OK); |
@@ -632,13 +609,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
632 | break; | 609 | break; |
633 | } | 610 | } |
634 | 611 | ||
635 | /* Done with result state (Now that operand stack is built) */ | ||
636 | |||
637 | status = acpi_ds_result_stack_pop(walk_state); | ||
638 | if (ACPI_FAILURE(status)) { | ||
639 | goto cleanup; | ||
640 | } | ||
641 | |||
642 | /* | 612 | /* |
643 | * If a result object was returned from above, push it on the | 613 | * If a result object was returned from above, push it on the |
644 | * current result stack | 614 | * current result stack |
@@ -671,8 +641,28 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
671 | if (ACPI_FAILURE(status)) { | 641 | if (ACPI_FAILURE(status)) { |
672 | break; | 642 | break; |
673 | } | 643 | } |
644 | } else if (op->common.aml_opcode == AML_DATA_REGION_OP) { | ||
645 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
646 | "Executing DataTableRegion Strings Op=%p\n", | ||
647 | op)); | ||
648 | |||
649 | status = | ||
650 | acpi_ds_eval_table_region_operands | ||
651 | (walk_state, op); | ||
652 | if (ACPI_FAILURE(status)) { | ||
653 | break; | ||
654 | } | ||
655 | } else if (op->common.aml_opcode == AML_BANK_FIELD_OP) { | ||
656 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
657 | "Executing BankField Op=%p\n", | ||
658 | op)); | ||
674 | 659 | ||
675 | status = acpi_ds_result_stack_pop(walk_state); | 660 | status = |
661 | acpi_ds_eval_bank_field_operands(walk_state, | ||
662 | op); | ||
663 | if (ACPI_FAILURE(status)) { | ||
664 | break; | ||
665 | } | ||
676 | } | 666 | } |
677 | break; | 667 | break; |
678 | 668 | ||