diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dswexec.c')
| -rw-r--r-- | drivers/acpi/dispatcher/dswexec.c | 80 |
1 files changed, 30 insertions, 50 deletions
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c index e522763bb692..f1af655ff113 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 - 2005, R. Byron Moore | 9 | * Copyright (C) 2000 - 2006, R. Byron Moore |
| 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 |
| @@ -100,9 +100,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
| 100 | if (result_obj) { | 100 | if (result_obj) { |
| 101 | status = acpi_ds_result_pop(&obj_desc, walk_state); | 101 | status = acpi_ds_result_pop(&obj_desc, walk_state); |
| 102 | if (ACPI_FAILURE(status)) { | 102 | if (ACPI_FAILURE(status)) { |
| 103 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 103 | ACPI_EXCEPTION((AE_INFO, status, |
| 104 | "Could not get result from predicate evaluation, %s\n", | 104 | "Could not get result from predicate evaluation")); |
| 105 | acpi_format_exception(status))); | ||
| 106 | 105 | ||
| 107 | return_ACPI_STATUS(status); | 106 | return_ACPI_STATUS(status); |
| 108 | } | 107 | } |
| @@ -123,9 +122,9 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | if (!obj_desc) { | 124 | if (!obj_desc) { |
| 126 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 125 | ACPI_ERROR((AE_INFO, |
| 127 | "No predicate obj_desc=%p State=%p\n", | 126 | "No predicate obj_desc=%p State=%p", |
| 128 | obj_desc, walk_state)); | 127 | obj_desc, walk_state)); |
| 129 | 128 | ||
| 130 | return_ACPI_STATUS(AE_AML_NO_OPERAND); | 129 | return_ACPI_STATUS(AE_AML_NO_OPERAND); |
| 131 | } | 130 | } |
| @@ -140,10 +139,10 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
| 140 | } | 139 | } |
| 141 | 140 | ||
| 142 | if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) { | 141 | if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) { |
| 143 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 142 | ACPI_ERROR((AE_INFO, |
| 144 | "Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n", | 143 | "Bad predicate (not an integer) obj_desc=%p State=%p Type=%X", |
| 145 | obj_desc, walk_state, | 144 | obj_desc, walk_state, |
| 146 | ACPI_GET_OBJECT_TYPE(obj_desc))); | 145 | ACPI_GET_OBJECT_TYPE(obj_desc))); |
| 147 | 146 | ||
| 148 | status = AE_AML_OPERAND_TYPE; | 147 | status = AE_AML_OPERAND_TYPE; |
| 149 | goto cleanup; | 148 | goto cleanup; |
| @@ -314,12 +313,13 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, | |||
| 314 | 313 | ||
| 315 | case AML_CLASS_EXECUTE: | 314 | case AML_CLASS_EXECUTE: |
| 316 | case AML_CLASS_CREATE: | 315 | case AML_CLASS_CREATE: |
| 317 | |||
| 318 | /* | 316 | /* |
| 319 | * Most operators with arguments. | 317 | * Most operators with arguments. |
| 320 | * Start a new result/operand state | 318 | * Start a new result/operand state |
| 321 | */ | 319 | */ |
| 322 | status = acpi_ds_result_stack_push(walk_state); | 320 | if (walk_state->opcode != AML_CREATE_FIELD_OP) { |
| 321 | status = acpi_ds_result_stack_push(walk_state); | ||
| 322 | } | ||
| 323 | break; | 323 | break; |
| 324 | 324 | ||
| 325 | default: | 325 | default: |
| @@ -361,8 +361,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 361 | op_class = walk_state->op_info->class; | 361 | op_class = walk_state->op_info->class; |
| 362 | 362 | ||
| 363 | if (op_class == AML_CLASS_UNKNOWN) { | 363 | if (op_class == AML_CLASS_UNKNOWN) { |
| 364 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown opcode %X\n", | 364 | ACPI_ERROR((AE_INFO, "Unknown opcode %X", |
| 365 | op->common.aml_opcode)); | 365 | op->common.aml_opcode)); |
| 366 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); | 366 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); |
| 367 | } | 367 | } |
| 368 | 368 | ||
| @@ -452,12 +452,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 452 | walk_state->operands[1]->reference.offset)) { | 452 | walk_state->operands[1]->reference.offset)) { |
| 453 | status = AE_OK; | 453 | status = AE_OK; |
| 454 | } else { | 454 | } else { |
| 455 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 455 | ACPI_EXCEPTION((AE_INFO, status, |
| 456 | "[%s]: Could not resolve operands, %s\n", | 456 | "While resolving operands for [%s]", |
| 457 | acpi_ps_get_opcode_name | 457 | acpi_ps_get_opcode_name |
| 458 | (walk_state->opcode), | 458 | (walk_state->opcode))); |
| 459 | acpi_format_exception | ||
| 460 | (status))); | ||
| 461 | } | 459 | } |
| 462 | } | 460 | } |
| 463 | 461 | ||
| @@ -676,8 +674,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 676 | 674 | ||
| 677 | case AML_TYPE_UNDEFINED: | 675 | case AML_TYPE_UNDEFINED: |
| 678 | 676 | ||
| 679 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 677 | ACPI_ERROR((AE_INFO, |
| 680 | "Undefined opcode type Op=%p\n", op)); | 678 | "Undefined opcode type Op=%p", op)); |
| 681 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); | 679 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); |
| 682 | 680 | ||
| 683 | case AML_TYPE_BOGUS: | 681 | case AML_TYPE_BOGUS: |
| @@ -689,10 +687,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 689 | 687 | ||
| 690 | default: | 688 | default: |
| 691 | 689 | ||
| 692 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 690 | ACPI_ERROR((AE_INFO, |
| 693 | "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", | 691 | "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p", |
| 694 | op_class, op_type, | 692 | op_class, op_type, op->common.aml_opcode, |
| 695 | op->common.aml_opcode, op)); | 693 | op)); |
| 696 | 694 | ||
| 697 | status = AE_NOT_IMPLEMENTED; | 695 | status = AE_NOT_IMPLEMENTED; |
| 698 | break; | 696 | break; |
| @@ -723,20 +721,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 723 | 721 | ||
| 724 | cleanup: | 722 | cleanup: |
| 725 | 723 | ||
| 726 | /* Invoke exception handler on error */ | ||
| 727 | |||
| 728 | if (ACPI_FAILURE(status) && | ||
| 729 | acpi_gbl_exception_handler && !(status & AE_CODE_CONTROL)) { | ||
| 730 | acpi_ex_exit_interpreter(); | ||
| 731 | status = acpi_gbl_exception_handler(status, | ||
| 732 | walk_state->method_node-> | ||
| 733 | name.integer, | ||
| 734 | walk_state->opcode, | ||
| 735 | walk_state->aml_offset, | ||
| 736 | NULL); | ||
| 737 | (void)acpi_ex_enter_interpreter(); | ||
| 738 | } | ||
| 739 | |||
| 740 | if (walk_state->result_obj) { | 724 | if (walk_state->result_obj) { |
| 741 | /* Break to debugger to display result */ | 725 | /* Break to debugger to display result */ |
| 742 | 726 | ||
| @@ -758,18 +742,14 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
| 758 | } | 742 | } |
| 759 | #endif | 743 | #endif |
| 760 | 744 | ||
| 761 | /* Always clear the object stack */ | 745 | /* Invoke exception handler on error */ |
| 762 | |||
| 763 | walk_state->num_operands = 0; | ||
| 764 | |||
| 765 | #ifdef ACPI_DISASSEMBLER | ||
| 766 | |||
| 767 | /* On error, display method locals/args */ | ||
| 768 | 746 | ||
| 769 | if (ACPI_FAILURE(status)) { | 747 | if (ACPI_FAILURE(status)) { |
| 770 | acpi_dm_dump_method_info(status, walk_state, op); | 748 | status = acpi_ds_method_error(status, walk_state); |
| 771 | } | 749 | } |
| 772 | #endif | ||
| 773 | 750 | ||
| 751 | /* Always clear the object stack */ | ||
| 752 | |||
| 753 | walk_state->num_operands = 0; | ||
| 774 | return_ACPI_STATUS(status); | 754 | return_ACPI_STATUS(status); |
| 775 | } | 755 | } |
