aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exoparg1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exoparg1.c')
-rw-r--r--drivers/acpi/executer/exoparg1.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 23d0823bcd5..4f3627ee2b2 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -342,6 +342,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
342 for (i = 0; 342 for (i = 0;
343 (i < acpi_gbl_integer_nybble_width) && (digit > 0); 343 (i < acpi_gbl_integer_nybble_width) && (digit > 0);
344 i++) { 344 i++) {
345
345 /* Get the least significant 4-bit BCD digit */ 346 /* Get the least significant 4-bit BCD digit */
346 347
347 temp32 = ((u32) digit) & 0xF; 348 temp32 = ((u32) digit) & 0xF;
@@ -487,6 +488,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
487 status = acpi_ex_convert_to_string(operand[0], &return_desc, 488 status = acpi_ex_convert_to_string(operand[0], &return_desc,
488 ACPI_EXPLICIT_CONVERT_DECIMAL); 489 ACPI_EXPLICIT_CONVERT_DECIMAL);
489 if (return_desc == operand[0]) { 490 if (return_desc == operand[0]) {
491
490 /* No conversion performed, add ref to handle return value */ 492 /* No conversion performed, add ref to handle return value */
491 acpi_ut_add_reference(return_desc); 493 acpi_ut_add_reference(return_desc);
492 } 494 }
@@ -497,6 +499,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
497 status = acpi_ex_convert_to_string(operand[0], &return_desc, 499 status = acpi_ex_convert_to_string(operand[0], &return_desc,
498 ACPI_EXPLICIT_CONVERT_HEX); 500 ACPI_EXPLICIT_CONVERT_HEX);
499 if (return_desc == operand[0]) { 501 if (return_desc == operand[0]) {
502
500 /* No conversion performed, add ref to handle return value */ 503 /* No conversion performed, add ref to handle return value */
501 acpi_ut_add_reference(return_desc); 504 acpi_ut_add_reference(return_desc);
502 } 505 }
@@ -506,6 +509,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
506 509
507 status = acpi_ex_convert_to_buffer(operand[0], &return_desc); 510 status = acpi_ex_convert_to_buffer(operand[0], &return_desc);
508 if (return_desc == operand[0]) { 511 if (return_desc == operand[0]) {
512
509 /* No conversion performed, add ref to handle return value */ 513 /* No conversion performed, add ref to handle return value */
510 acpi_ut_add_reference(return_desc); 514 acpi_ut_add_reference(return_desc);
511 } 515 }
@@ -516,6 +520,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
516 status = acpi_ex_convert_to_integer(operand[0], &return_desc, 520 status = acpi_ex_convert_to_integer(operand[0], &return_desc,
517 ACPI_ANY_BASE); 521 ACPI_ANY_BASE);
518 if (return_desc == operand[0]) { 522 if (return_desc == operand[0]) {
523
519 /* No conversion performed, add ref to handle return value */ 524 /* No conversion performed, add ref to handle return value */
520 acpi_ut_add_reference(return_desc); 525 acpi_ut_add_reference(return_desc);
521 } 526 }
@@ -541,6 +546,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
541 } 546 }
542 547
543 if (ACPI_SUCCESS(status)) { 548 if (ACPI_SUCCESS(status)) {
549
544 /* Store the return value computed above into the target object */ 550 /* Store the return value computed above into the target object */
545 551
546 status = acpi_ex_store(return_desc, operand[1], walk_state); 552 status = acpi_ex_store(return_desc, operand[1], walk_state);
@@ -625,6 +631,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
625 temp_desc = operand[0]; 631 temp_desc = operand[0];
626 if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) == 632 if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) ==
627 ACPI_DESC_TYPE_OPERAND) { 633 ACPI_DESC_TYPE_OPERAND) {
634
628 /* Internal reference object - prevent deletion */ 635 /* Internal reference object - prevent deletion */
629 636
630 acpi_ut_add_reference(temp_desc); 637 acpi_ut_add_reference(temp_desc);
@@ -777,8 +784,25 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
777 784
778 /* Check for a method local or argument, or standalone String */ 785 /* Check for a method local or argument, or standalone String */
779 786
780 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) != 787 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
781 ACPI_DESC_TYPE_NAMED) { 788 ACPI_DESC_TYPE_NAMED) {
789 temp_desc =
790 acpi_ns_get_attached_object((struct
791 acpi_namespace_node *)
792 operand[0]);
793 if (temp_desc
794 &&
795 ((ACPI_GET_OBJECT_TYPE(temp_desc) ==
796 ACPI_TYPE_STRING)
797 || (ACPI_GET_OBJECT_TYPE(temp_desc) ==
798 ACPI_TYPE_LOCAL_REFERENCE))) {
799 operand[0] = temp_desc;
800 acpi_ut_add_reference(temp_desc);
801 } else {
802 status = AE_AML_OPERAND_TYPE;
803 goto cleanup;
804 }
805 } else {
782 switch (ACPI_GET_OBJECT_TYPE(operand[0])) { 806 switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
783 case ACPI_TYPE_LOCAL_REFERENCE: 807 case ACPI_TYPE_LOCAL_REFERENCE:
784 /* 808 /*
@@ -827,13 +851,24 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
827 break; 851 break;
828 852
829 case ACPI_TYPE_STRING: 853 case ACPI_TYPE_STRING:
854 break;
830 855
856 default:
857 status = AE_AML_OPERAND_TYPE;
858 goto cleanup;
859 }
860 }
861
862 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
863 ACPI_DESC_TYPE_NAMED) {
864 if (ACPI_GET_OBJECT_TYPE(operand[0]) ==
865 ACPI_TYPE_STRING) {
831 /* 866 /*
832 * This is a deref_of (String). The string is a reference 867 * This is a deref_of (String). The string is a reference
833 * to a named ACPI object. 868 * to a named ACPI object.
834 * 869 *
835 * 1) Find the owning Node 870 * 1) Find the owning Node
836 * 2) Dereference the node to an actual object. Could be a 871 * 2) Dereference the node to an actual object. Could be a
837 * Field, so we need to resolve the node to a value. 872 * Field, so we need to resolve the node to a value.
838 */ 873 */
839 status = 874 status =
@@ -857,11 +892,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
857 (struct acpi_namespace_node, &return_desc), 892 (struct acpi_namespace_node, &return_desc),
858 walk_state); 893 walk_state);
859 goto cleanup; 894 goto cleanup;
860
861 default:
862
863 status = AE_AML_OPERAND_TYPE;
864 goto cleanup;
865 } 895 }
866 } 896 }
867 897