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.c94
1 files changed, 56 insertions, 38 deletions
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 8482aefaf38b..dbdf8262ba00 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -97,7 +97,8 @@ acpi_ex_opcode_0A_0T_1R (
97 union acpi_operand_object *return_desc = NULL; 97 union acpi_operand_object *return_desc = NULL;
98 98
99 99
100 ACPI_FUNCTION_TRACE_STR ("ex_opcode_0A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); 100 ACPI_FUNCTION_TRACE_STR ("ex_opcode_0A_0T_1R",
101 acpi_ps_get_opcode_name (walk_state->opcode));
101 102
102 103
103 /* Examine the AML opcode */ 104 /* Examine the AML opcode */
@@ -161,7 +162,8 @@ acpi_ex_opcode_1A_0T_0R (
161 acpi_status status = AE_OK; 162 acpi_status status = AE_OK;
162 163
163 164
164 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); 165 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_0R",
166 acpi_ps_get_opcode_name (walk_state->opcode));
165 167
166 168
167 /* Examine the AML opcode */ 169 /* Examine the AML opcode */
@@ -236,7 +238,8 @@ acpi_ex_opcode_1A_1T_0R (
236 union acpi_operand_object **operand = &walk_state->operands[0]; 238 union acpi_operand_object **operand = &walk_state->operands[0];
237 239
238 240
239 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); 241 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_0R",
242 acpi_ps_get_opcode_name (walk_state->opcode));
240 243
241 244
242 /* Examine the AML opcode */ 245 /* Examine the AML opcode */
@@ -289,7 +292,8 @@ acpi_ex_opcode_1A_1T_1R (
289 acpi_integer digit; 292 acpi_integer digit;
290 293
291 294
292 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); 295 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_1R",
296 acpi_ps_get_opcode_name (walk_state->opcode));
293 297
294 298
295 /* Examine the AML opcode */ 299 /* Examine the AML opcode */
@@ -409,8 +413,10 @@ acpi_ex_opcode_1A_1T_1R (
409 for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) { 413 for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
410 (void) acpi_ut_short_divide (digit, 10, &digit, &temp32); 414 (void) acpi_ut_short_divide (digit, 10, &digit, &temp32);
411 415
412 /* Insert the BCD digit that resides in the remainder from above */ 416 /*
413 417 * Insert the BCD digit that resides in the
418 * remainder from above
419 */
414 return_desc->integer.value |= (((acpi_integer) temp32) << 420 return_desc->integer.value |= (((acpi_integer) temp32) <<
415 ACPI_MUL_4 (i)); 421 ACPI_MUL_4 (i));
416 } 422 }
@@ -445,7 +451,8 @@ acpi_ex_opcode_1A_1T_1R (
445 451
446 /* Get the object reference, store it, and remove our reference */ 452 /* Get the object reference, store it, and remove our reference */
447 453
448 status = acpi_ex_get_object_reference (operand[0], &return_desc2, walk_state); 454 status = acpi_ex_get_object_reference (operand[0],
455 &return_desc2, walk_state);
449 if (ACPI_FAILURE (status)) { 456 if (ACPI_FAILURE (status)) {
450 goto cleanup; 457 goto cleanup;
451 } 458 }
@@ -482,10 +489,10 @@ acpi_ex_opcode_1A_1T_1R (
482 489
483 if (!walk_state->result_obj) { 490 if (!walk_state->result_obj) {
484 /* 491 /*
485 * Normally, we would remove a reference on the Operand[0] parameter; 492 * Normally, we would remove a reference on the Operand[0]
486 * But since it is being used as the internal return object 493 * parameter; But since it is being used as the internal return
487 * (meaning we would normally increment it), the two cancel out, 494 * object (meaning we would normally increment it), the two
488 * and we simply don't do anything. 495 * cancel out, and we simply don't do anything.
489 */ 496 */
490 walk_state->result_obj = operand[0]; 497 walk_state->result_obj = operand[0];
491 walk_state->operands[0] = NULL; /* Prevent deletion */ 498 walk_state->operands[0] = NULL; /* Prevent deletion */
@@ -549,9 +556,8 @@ acpi_ex_opcode_1A_1T_1R (
549 case AML_SHIFT_LEFT_BIT_OP: /* shift_left_bit (Source, bit_num) */ 556 case AML_SHIFT_LEFT_BIT_OP: /* shift_left_bit (Source, bit_num) */
550 case AML_SHIFT_RIGHT_BIT_OP: /* shift_right_bit (Source, bit_num) */ 557 case AML_SHIFT_RIGHT_BIT_OP: /* shift_right_bit (Source, bit_num) */
551 558
552 /* 559 /* These are two obsolete opcodes */
553 * These are two obsolete opcodes 560
554 */
555 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 561 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
556 "%s is obsolete and not implemented\n", 562 "%s is obsolete and not implemented\n",
557 acpi_ps_get_opcode_name (walk_state->opcode))); 563 acpi_ps_get_opcode_name (walk_state->opcode)));
@@ -568,9 +574,8 @@ acpi_ex_opcode_1A_1T_1R (
568 } 574 }
569 575
570 if (ACPI_SUCCESS (status)) { 576 if (ACPI_SUCCESS (status)) {
571 /* 577 /* Store the return value computed above into the target object */
572 * Store the return value computed above into the target object 578
573 */
574 status = acpi_ex_store (return_desc, operand[1], walk_state); 579 status = acpi_ex_store (return_desc, operand[1], walk_state);
575 } 580 }
576 581
@@ -615,7 +620,8 @@ acpi_ex_opcode_1A_0T_1R (
615 acpi_integer value; 620 acpi_integer value;
616 621
617 622
618 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); 623 ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_1R",
624 acpi_ps_get_opcode_name (walk_state->opcode));
619 625
620 626
621 /* Examine the AML opcode */ 627 /* Examine the AML opcode */
@@ -706,9 +712,9 @@ acpi_ex_opcode_1A_0T_1R (
706 712
707 /* 713 /*
708 * Note: The operand is not resolved at this point because we want to 714 * Note: The operand is not resolved at this point because we want to
709 * get the associated object, not its value. For example, we don't want 715 * get the associated object, not its value. For example, we don't
710 * to resolve a field_unit to its value, we want the actual field_unit 716 * want to resolve a field_unit to its value, we want the actual
711 * object. 717 * field_unit object.
712 */ 718 */
713 719
714 /* Get the type of the base object */ 720 /* Get the type of the base object */
@@ -738,7 +744,8 @@ acpi_ex_opcode_1A_0T_1R (
738 744
739 /* Get the base object */ 745 /* Get the base object */
740 746
741 status = acpi_ex_resolve_multiple (walk_state, operand[0], &type, &temp_desc); 747 status = acpi_ex_resolve_multiple (walk_state,
748 operand[0], &type, &temp_desc);
742 if (ACPI_FAILURE (status)) { 749 if (ACPI_FAILURE (status)) {
743 goto cleanup; 750 goto cleanup;
744 } 751 }
@@ -818,8 +825,10 @@ acpi_ex_opcode_1A_0T_1R (
818 825
819 /* Set Operand[0] to the value of the local/arg */ 826 /* Set Operand[0] to the value of the local/arg */
820 827
821 status = acpi_ds_method_data_get_value (operand[0]->reference.opcode, 828 status = acpi_ds_method_data_get_value (
822 operand[0]->reference.offset, walk_state, &temp_desc); 829 operand[0]->reference.opcode,
830 operand[0]->reference.offset,
831 walk_state, &temp_desc);
823 if (ACPI_FAILURE (status)) { 832 if (ACPI_FAILURE (status)) {
824 goto cleanup; 833 goto cleanup;
825 } 834 }
@@ -852,21 +861,26 @@ acpi_ex_opcode_1A_0T_1R (
852 case ACPI_TYPE_STRING: 861 case ACPI_TYPE_STRING:
853 862
854 /* 863 /*
855 * This is a deref_of (String). The string is a reference to a named ACPI object. 864 * This is a deref_of (String). The string is a reference
865 * to a named ACPI object.
856 * 866 *
857 * 1) Find the owning Node 867 * 1) Find the owning Node
858 * 2) Dereference the node to an actual object. Could be a Field, so we nee 868 * 2) Dereference the node to an actual object. Could be a
859 * to resolve the node to a value. 869 * Field, so we need to resolve the node to a value.
860 */ 870 */
861 status = acpi_ns_get_node_by_path (operand[0]->string.pointer, 871 status = acpi_ns_get_node_by_path (operand[0]->string.pointer,
862 walk_state->scope_info->scope.node, ACPI_NS_SEARCH_PARENT, 872 walk_state->scope_info->scope.node,
863 ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, &return_desc)); 873 ACPI_NS_SEARCH_PARENT,
874 ACPI_CAST_INDIRECT_PTR (
875 struct acpi_namespace_node, &return_desc));
864 if (ACPI_FAILURE (status)) { 876 if (ACPI_FAILURE (status)) {
865 goto cleanup; 877 goto cleanup;
866 } 878 }
867 879
868 status = acpi_ex_resolve_node_to_value ( 880 status = acpi_ex_resolve_node_to_value (
869 ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, &return_desc), walk_state); 881 ACPI_CAST_INDIRECT_PTR (
882 struct acpi_namespace_node, &return_desc),
883 walk_state);
870 goto cleanup; 884 goto cleanup;
871 885
872 886
@@ -883,14 +897,16 @@ acpi_ex_opcode_1A_0T_1R (
883 /* 897 /*
884 * This is a deref_of (object_reference) 898 * This is a deref_of (object_reference)
885 * Get the actual object from the Node (This is the dereference). 899 * Get the actual object from the Node (This is the dereference).
886 * -- This case may only happen when a local_x or arg_x is dereferenced above. 900 * This case may only happen when a local_x or arg_x is
901 * dereferenced above.
887 */ 902 */
888 return_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) operand[0]); 903 return_desc = acpi_ns_get_attached_object (
904 (struct acpi_namespace_node *) operand[0]);
889 } 905 }
890 else { 906 else {
891 /* 907 /*
892 * This must be a reference object produced by either the Index() or 908 * This must be a reference object produced by either the
893 * ref_of() operator 909 * Index() or ref_of() operator
894 */ 910 */
895 switch (operand[0]->reference.opcode) { 911 switch (operand[0]->reference.opcode) {
896 case AML_INDEX_OP: 912 case AML_INDEX_OP:
@@ -931,8 +947,8 @@ acpi_ex_opcode_1A_0T_1R (
931 case ACPI_TYPE_PACKAGE: 947 case ACPI_TYPE_PACKAGE:
932 948
933 /* 949 /*
934 * Return the referenced element of the package. We must add 950 * Return the referenced element of the package. We must
935 * another reference to the referenced object, however. 951 * add another reference to the referenced object, however.
936 */ 952 */
937 return_desc = *(operand[0]->reference.where); 953 return_desc = *(operand[0]->reference.where);
938 if (!return_desc) { 954 if (!return_desc) {
@@ -967,9 +983,11 @@ acpi_ex_opcode_1A_0T_1R (
967 983
968 return_desc = operand[0]->reference.object; 984 return_desc = operand[0]->reference.object;
969 985
970 if (ACPI_GET_DESCRIPTOR_TYPE (return_desc) == ACPI_DESC_TYPE_NAMED) { 986 if (ACPI_GET_DESCRIPTOR_TYPE (return_desc) ==
987 ACPI_DESC_TYPE_NAMED) {
971 988
972 return_desc = acpi_ns_get_attached_object ((struct acpi_namespace_node *) return_desc); 989 return_desc = acpi_ns_get_attached_object (
990 (struct acpi_namespace_node *) return_desc);
973 } 991 }
974 992
975 /* Add another reference to the object! */ 993 /* Add another reference to the object! */