diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dswexec.c')
-rw-r--r-- | drivers/acpi/dispatcher/dswexec.c | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c index e522763bb692..5a9b91fe93d2 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,7 @@ 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_REPORT_ERROR(("Could not get result from predicate evaluation, %s\n", acpi_format_exception(status))); |
104 | "Could not get result from predicate evaluation, %s\n", | ||
105 | acpi_format_exception(status))); | ||
106 | 104 | ||
107 | return_ACPI_STATUS(status); | 105 | return_ACPI_STATUS(status); |
108 | } | 106 | } |
@@ -123,9 +121,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
123 | } | 121 | } |
124 | 122 | ||
125 | if (!obj_desc) { | 123 | if (!obj_desc) { |
126 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 124 | ACPI_REPORT_ERROR(("No predicate obj_desc=%p State=%p\n", |
127 | "No predicate obj_desc=%p State=%p\n", | 125 | obj_desc, walk_state)); |
128 | obj_desc, walk_state)); | ||
129 | 126 | ||
130 | return_ACPI_STATUS(AE_AML_NO_OPERAND); | 127 | return_ACPI_STATUS(AE_AML_NO_OPERAND); |
131 | } | 128 | } |
@@ -140,10 +137,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
140 | } | 137 | } |
141 | 138 | ||
142 | if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) { | 139 | if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) { |
143 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 140 | ACPI_REPORT_ERROR(("Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n", obj_desc, walk_state, ACPI_GET_OBJECT_TYPE(obj_desc))); |
144 | "Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n", | ||
145 | obj_desc, walk_state, | ||
146 | ACPI_GET_OBJECT_TYPE(obj_desc))); | ||
147 | 141 | ||
148 | status = AE_AML_OPERAND_TYPE; | 142 | status = AE_AML_OPERAND_TYPE; |
149 | goto cleanup; | 143 | goto cleanup; |
@@ -314,12 +308,13 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, | |||
314 | 308 | ||
315 | case AML_CLASS_EXECUTE: | 309 | case AML_CLASS_EXECUTE: |
316 | case AML_CLASS_CREATE: | 310 | case AML_CLASS_CREATE: |
317 | |||
318 | /* | 311 | /* |
319 | * Most operators with arguments. | 312 | * Most operators with arguments. |
320 | * Start a new result/operand state | 313 | * Start a new result/operand state |
321 | */ | 314 | */ |
322 | status = acpi_ds_result_stack_push(walk_state); | 315 | if (walk_state->opcode != AML_CREATE_FIELD_OP) { |
316 | status = acpi_ds_result_stack_push(walk_state); | ||
317 | } | ||
323 | break; | 318 | break; |
324 | 319 | ||
325 | default: | 320 | default: |
@@ -361,8 +356,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
361 | op_class = walk_state->op_info->class; | 356 | op_class = walk_state->op_info->class; |
362 | 357 | ||
363 | if (op_class == AML_CLASS_UNKNOWN) { | 358 | if (op_class == AML_CLASS_UNKNOWN) { |
364 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown opcode %X\n", | 359 | ACPI_REPORT_ERROR(("Unknown opcode %X\n", |
365 | op->common.aml_opcode)); | 360 | op->common.aml_opcode)); |
366 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); | 361 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); |
367 | } | 362 | } |
368 | 363 | ||
@@ -452,12 +447,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
452 | walk_state->operands[1]->reference.offset)) { | 447 | walk_state->operands[1]->reference.offset)) { |
453 | status = AE_OK; | 448 | status = AE_OK; |
454 | } else { | 449 | } else { |
455 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 450 | ACPI_REPORT_ERROR(("[%s]: Could not resolve operands, %s\n", acpi_ps_get_opcode_name(walk_state->opcode), acpi_format_exception(status))); |
456 | "[%s]: Could not resolve operands, %s\n", | ||
457 | acpi_ps_get_opcode_name | ||
458 | (walk_state->opcode), | ||
459 | acpi_format_exception | ||
460 | (status))); | ||
461 | } | 451 | } |
462 | } | 452 | } |
463 | 453 | ||
@@ -676,8 +666,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
676 | 666 | ||
677 | case AML_TYPE_UNDEFINED: | 667 | case AML_TYPE_UNDEFINED: |
678 | 668 | ||
679 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 669 | ACPI_REPORT_ERROR(("Undefined opcode type Op=%p\n", |
680 | "Undefined opcode type Op=%p\n", op)); | 670 | op)); |
681 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); | 671 | return_ACPI_STATUS(AE_NOT_IMPLEMENTED); |
682 | 672 | ||
683 | case AML_TYPE_BOGUS: | 673 | case AML_TYPE_BOGUS: |
@@ -689,10 +679,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
689 | 679 | ||
690 | default: | 680 | default: |
691 | 681 | ||
692 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 682 | ACPI_REPORT_ERROR(("Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", op_class, op_type, op->common.aml_opcode, op)); |
693 | "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", | ||
694 | op_class, op_type, | ||
695 | op->common.aml_opcode, op)); | ||
696 | 683 | ||
697 | status = AE_NOT_IMPLEMENTED; | 684 | status = AE_NOT_IMPLEMENTED; |
698 | break; | 685 | break; |
@@ -723,20 +710,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
723 | 710 | ||
724 | cleanup: | 711 | cleanup: |
725 | 712 | ||
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) { | 713 | if (walk_state->result_obj) { |
741 | /* Break to debugger to display result */ | 714 | /* Break to debugger to display result */ |
742 | 715 | ||
@@ -758,18 +731,14 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) | |||
758 | } | 731 | } |
759 | #endif | 732 | #endif |
760 | 733 | ||
761 | /* Always clear the object stack */ | 734 | /* 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 | 735 | ||
769 | if (ACPI_FAILURE(status)) { | 736 | if (ACPI_FAILURE(status)) { |
770 | acpi_dm_dump_method_info(status, walk_state, op); | 737 | status = acpi_ds_method_error(status, walk_state); |
771 | } | 738 | } |
772 | #endif | ||
773 | 739 | ||
740 | /* Always clear the object stack */ | ||
741 | |||
742 | walk_state->num_operands = 0; | ||
774 | return_ACPI_STATUS(status); | 743 | return_ACPI_STATUS(status); |
775 | } | 744 | } |