diff options
Diffstat (limited to 'drivers/acpi/executer/exresop.c')
-rw-r--r-- | drivers/acpi/executer/exresop.c | 96 |
1 files changed, 74 insertions, 22 deletions
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c index 804faebf825..a1c000f5a41 100644 --- a/drivers/acpi/executer/exresop.c +++ b/drivers/acpi/executer/exresop.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <acpi/amlcode.h> | 46 | #include <acpi/amlcode.h> |
47 | #include <acpi/acparser.h> | 47 | #include <acpi/acparser.h> |
48 | #include <acpi/acinterp.h> | 48 | #include <acpi/acinterp.h> |
49 | #include <acpi/acnamesp.h> | ||
49 | 50 | ||
50 | #define _COMPONENT ACPI_EXECUTER | 51 | #define _COMPONENT ACPI_EXECUTER |
51 | ACPI_MODULE_NAME("exresop") | 52 | ACPI_MODULE_NAME("exresop") |
@@ -95,9 +96,10 @@ acpi_ex_check_object_type(acpi_object_type type_needed, | |||
95 | } | 96 | } |
96 | 97 | ||
97 | if (type_needed != this_type) { | 98 | if (type_needed != this_type) { |
98 | ACPI_REPORT_ERROR(("Needed type [%s], found [%s] %p\n", | 99 | ACPI_ERROR((AE_INFO, |
99 | acpi_ut_get_type_name(type_needed), | 100 | "Needed type [%s], found [%s] %p", |
100 | acpi_ut_get_type_name(this_type), object)); | 101 | acpi_ut_get_type_name(type_needed), |
102 | acpi_ut_get_type_name(this_type), object)); | ||
101 | 103 | ||
102 | return (AE_AML_OPERAND_TYPE); | 104 | return (AE_AML_OPERAND_TYPE); |
103 | } | 105 | } |
@@ -150,7 +152,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
150 | 152 | ||
151 | arg_types = op_info->runtime_args; | 153 | arg_types = op_info->runtime_args; |
152 | if (arg_types == ARGI_INVALID_OPCODE) { | 154 | if (arg_types == ARGI_INVALID_OPCODE) { |
153 | ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", opcode)); | 155 | ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", opcode)); |
154 | 156 | ||
155 | return_ACPI_STATUS(AE_AML_INTERNAL); | 157 | return_ACPI_STATUS(AE_AML_INTERNAL); |
156 | } | 158 | } |
@@ -168,8 +170,8 @@ acpi_ex_resolve_operands(u16 opcode, | |||
168 | */ | 170 | */ |
169 | while (GET_CURRENT_ARG_TYPE(arg_types)) { | 171 | while (GET_CURRENT_ARG_TYPE(arg_types)) { |
170 | if (!stack_ptr || !*stack_ptr) { | 172 | if (!stack_ptr || !*stack_ptr) { |
171 | ACPI_REPORT_ERROR(("Null stack entry at %p\n", | 173 | ACPI_ERROR((AE_INFO, "Null stack entry at %p", |
172 | stack_ptr)); | 174 | stack_ptr)); |
173 | 175 | ||
174 | return_ACPI_STATUS(AE_AML_INTERNAL); | 176 | return_ACPI_STATUS(AE_AML_INTERNAL); |
175 | } | 177 | } |
@@ -187,6 +189,22 @@ acpi_ex_resolve_operands(u16 opcode, | |||
187 | 189 | ||
188 | object_type = | 190 | object_type = |
189 | ((struct acpi_namespace_node *)obj_desc)->type; | 191 | ((struct acpi_namespace_node *)obj_desc)->type; |
192 | |||
193 | /* | ||
194 | * Resolve an alias object. The construction of these objects | ||
195 | * guarantees that there is only one level of alias indirection; | ||
196 | * thus, the attached object is always the aliased namespace node | ||
197 | */ | ||
198 | if (object_type == ACPI_TYPE_LOCAL_ALIAS) { | ||
199 | obj_desc = | ||
200 | acpi_ns_get_attached_object((struct | ||
201 | acpi_namespace_node | ||
202 | *)obj_desc); | ||
203 | *stack_ptr = obj_desc; | ||
204 | object_type = | ||
205 | ((struct acpi_namespace_node *)obj_desc)-> | ||
206 | type; | ||
207 | } | ||
190 | break; | 208 | break; |
191 | 209 | ||
192 | case ACPI_DESC_TYPE_OPERAND: | 210 | case ACPI_DESC_TYPE_OPERAND: |
@@ -198,7 +216,9 @@ acpi_ex_resolve_operands(u16 opcode, | |||
198 | /* Check for bad acpi_object_type */ | 216 | /* Check for bad acpi_object_type */ |
199 | 217 | ||
200 | if (!acpi_ut_valid_object_type(object_type)) { | 218 | if (!acpi_ut_valid_object_type(object_type)) { |
201 | ACPI_REPORT_ERROR(("Bad operand object type [%X]\n", object_type)); | 219 | ACPI_ERROR((AE_INFO, |
220 | "Bad operand object type [%X]", | ||
221 | object_type)); | ||
202 | 222 | ||
203 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 223 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
204 | } | 224 | } |
@@ -236,7 +256,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
236 | break; | 256 | break; |
237 | 257 | ||
238 | default: | 258 | default: |
239 | ACPI_REPORT_ERROR(("Operand is a Reference, Unknown Reference Opcode: %X\n", obj_desc->reference.opcode)); | 259 | ACPI_ERROR((AE_INFO, |
260 | "Operand is a Reference, Unknown Reference Opcode: %X", | ||
261 | obj_desc->reference. | ||
262 | opcode)); | ||
240 | 263 | ||
241 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 264 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
242 | } | 265 | } |
@@ -247,10 +270,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
247 | 270 | ||
248 | /* Invalid descriptor */ | 271 | /* Invalid descriptor */ |
249 | 272 | ||
250 | ACPI_REPORT_ERROR(("Invalid descriptor %p [%s]\n", | 273 | ACPI_ERROR((AE_INFO, |
251 | obj_desc, | 274 | "Invalid descriptor %p [%s]", |
252 | acpi_ut_get_descriptor_name | 275 | obj_desc, |
253 | (obj_desc))); | 276 | acpi_ut_get_descriptor_name(obj_desc))); |
254 | 277 | ||
255 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 278 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
256 | } | 279 | } |
@@ -408,7 +431,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
408 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); | 431 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); |
409 | if (ACPI_FAILURE(status)) { | 432 | if (ACPI_FAILURE(status)) { |
410 | if (status == AE_TYPE) { | 433 | if (status == AE_TYPE) { |
411 | ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 434 | ACPI_ERROR((AE_INFO, |
435 | "Needed [Integer/String/Buffer], found [%s] %p", | ||
436 | acpi_ut_get_object_type_name | ||
437 | (obj_desc), obj_desc)); | ||
412 | 438 | ||
413 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 439 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
414 | } | 440 | } |
@@ -431,7 +457,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
431 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); | 457 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); |
432 | if (ACPI_FAILURE(status)) { | 458 | if (ACPI_FAILURE(status)) { |
433 | if (status == AE_TYPE) { | 459 | if (status == AE_TYPE) { |
434 | ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 460 | ACPI_ERROR((AE_INFO, |
461 | "Needed [Integer/String/Buffer], found [%s] %p", | ||
462 | acpi_ut_get_object_type_name | ||
463 | (obj_desc), obj_desc)); | ||
435 | 464 | ||
436 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 465 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
437 | } | 466 | } |
@@ -455,7 +484,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
455 | ACPI_IMPLICIT_CONVERT_HEX); | 484 | ACPI_IMPLICIT_CONVERT_HEX); |
456 | if (ACPI_FAILURE(status)) { | 485 | if (ACPI_FAILURE(status)) { |
457 | if (status == AE_TYPE) { | 486 | if (status == AE_TYPE) { |
458 | ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 487 | ACPI_ERROR((AE_INFO, |
488 | "Needed [Integer/String/Buffer], found [%s] %p", | ||
489 | acpi_ut_get_object_type_name | ||
490 | (obj_desc), obj_desc)); | ||
459 | 491 | ||
460 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 492 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
461 | } | 493 | } |
@@ -481,7 +513,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
481 | break; | 513 | break; |
482 | 514 | ||
483 | default: | 515 | default: |
484 | ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 516 | ACPI_ERROR((AE_INFO, |
517 | "Needed [Integer/String/Buffer], found [%s] %p", | ||
518 | acpi_ut_get_object_type_name | ||
519 | (obj_desc), obj_desc)); | ||
485 | 520 | ||
486 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 521 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
487 | } | 522 | } |
@@ -515,7 +550,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
515 | break; | 550 | break; |
516 | 551 | ||
517 | default: | 552 | default: |
518 | ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 553 | ACPI_ERROR((AE_INFO, |
554 | "Needed [Integer/String/Buffer], found [%s] %p", | ||
555 | acpi_ut_get_object_type_name | ||
556 | (obj_desc), obj_desc)); | ||
519 | 557 | ||
520 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 558 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
521 | } | 559 | } |
@@ -539,7 +577,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
539 | break; | 577 | break; |
540 | 578 | ||
541 | default: | 579 | default: |
542 | ACPI_REPORT_ERROR(("Needed [Buffer/String/Package/Reference], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 580 | ACPI_ERROR((AE_INFO, |
581 | "Needed [Buffer/String/Package/Reference], found [%s] %p", | ||
582 | acpi_ut_get_object_type_name | ||
583 | (obj_desc), obj_desc)); | ||
543 | 584 | ||
544 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 585 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
545 | } | 586 | } |
@@ -558,7 +599,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
558 | break; | 599 | break; |
559 | 600 | ||
560 | default: | 601 | default: |
561 | ACPI_REPORT_ERROR(("Needed [Buffer/String/Package], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 602 | ACPI_ERROR((AE_INFO, |
603 | "Needed [Buffer/String/Package], found [%s] %p", | ||
604 | acpi_ut_get_object_type_name | ||
605 | (obj_desc), obj_desc)); | ||
562 | 606 | ||
563 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 607 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
564 | } | 608 | } |
@@ -578,7 +622,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
578 | break; | 622 | break; |
579 | 623 | ||
580 | default: | 624 | default: |
581 | ACPI_REPORT_ERROR(("Needed [Region/region_field], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 625 | ACPI_ERROR((AE_INFO, |
626 | "Needed [Region/region_field], found [%s] %p", | ||
627 | acpi_ut_get_object_type_name | ||
628 | (obj_desc), obj_desc)); | ||
582 | 629 | ||
583 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 630 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
584 | } | 631 | } |
@@ -620,7 +667,10 @@ acpi_ex_resolve_operands(u16 opcode, | |||
620 | break; | 667 | break; |
621 | } | 668 | } |
622 | 669 | ||
623 | ACPI_REPORT_ERROR(("Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc)); | 670 | ACPI_ERROR((AE_INFO, |
671 | "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p", | ||
672 | acpi_ut_get_object_type_name | ||
673 | (obj_desc), obj_desc)); | ||
624 | 674 | ||
625 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 675 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
626 | } | 676 | } |
@@ -630,7 +680,9 @@ acpi_ex_resolve_operands(u16 opcode, | |||
630 | 680 | ||
631 | /* Unknown type */ | 681 | /* Unknown type */ |
632 | 682 | ||
633 | ACPI_REPORT_ERROR(("Internal - Unknown ARGI (required operand) type %X\n", this_arg_type)); | 683 | ACPI_ERROR((AE_INFO, |
684 | "Internal - Unknown ARGI (required operand) type %X", | ||
685 | this_arg_type)); | ||
634 | 686 | ||
635 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 687 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
636 | } | 688 | } |