0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <acpi/acpi.h>
0011 #include "accommon.h"
0012 #include "acparser.h"
0013 #include "acdispat.h"
0014 #include "acinterp.h"
0015 #include "amlcode.h"
0016 #include "acnamesp.h"
0017
0018 #define _COMPONENT ACPI_EXECUTER
0019 ACPI_MODULE_NAME("exoparg1")
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
0054 {
0055 acpi_status status = AE_OK;
0056 union acpi_operand_object *return_desc = NULL;
0057
0058 ACPI_FUNCTION_TRACE_STR(ex_opcode_0A_0T_1R,
0059 acpi_ps_get_opcode_name(walk_state->opcode));
0060
0061
0062
0063 switch (walk_state->opcode) {
0064 case AML_TIMER_OP:
0065
0066
0067
0068 return_desc =
0069 acpi_ut_create_integer_object(acpi_os_get_timer());
0070 if (!return_desc) {
0071 status = AE_NO_MEMORY;
0072 goto cleanup;
0073 }
0074 break;
0075
0076 default:
0077
0078 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
0079 walk_state->opcode));
0080 status = AE_AML_BAD_OPCODE;
0081 break;
0082 }
0083
0084 cleanup:
0085
0086
0087
0088 if ((ACPI_FAILURE(status)) || walk_state->result_obj) {
0089 acpi_ut_remove_reference(return_desc);
0090 walk_state->result_obj = NULL;
0091 } else {
0092
0093
0094 walk_state->result_obj = return_desc;
0095 }
0096
0097 return_ACPI_STATUS(status);
0098 }
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113 acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state)
0114 {
0115 union acpi_operand_object **operand = &walk_state->operands[0];
0116 acpi_status status = AE_OK;
0117
0118 ACPI_FUNCTION_TRACE_STR(ex_opcode_1A_0T_0R,
0119 acpi_ps_get_opcode_name(walk_state->opcode));
0120
0121
0122
0123 switch (walk_state->opcode) {
0124 case AML_RELEASE_OP:
0125
0126 status = acpi_ex_release_mutex(operand[0], walk_state);
0127 break;
0128
0129 case AML_RESET_OP:
0130
0131 status = acpi_ex_system_reset_event(operand[0]);
0132 break;
0133
0134 case AML_SIGNAL_OP:
0135
0136 status = acpi_ex_system_signal_event(operand[0]);
0137 break;
0138
0139 case AML_SLEEP_OP:
0140
0141 status = acpi_ex_system_do_sleep(operand[0]->integer.value);
0142 break;
0143
0144 case AML_STALL_OP:
0145
0146 status =
0147 acpi_ex_system_do_stall((u32) operand[0]->integer.value);
0148 break;
0149
0150 case AML_UNLOAD_OP:
0151
0152 status = acpi_ex_unload_table(operand[0]);
0153 break;
0154
0155 default:
0156
0157 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
0158 walk_state->opcode));
0159 status = AE_AML_BAD_OPCODE;
0160 break;
0161 }
0162
0163 return_ACPI_STATUS(status);
0164 }
0165
0166 #ifdef _OBSOLETE_CODE
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180 acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state)
0181 {
0182 acpi_status status = AE_OK;
0183 union acpi_operand_object **operand = &walk_state->operands[0];
0184
0185 ACPI_FUNCTION_TRACE_STR(ex_opcode_1A_1T_0R,
0186 acpi_ps_get_opcode_name(walk_state->opcode));
0187
0188
0189
0190 switch (walk_state->opcode) {
0191 #ifdef _OBSOLETE_CODE
0192 case AML_LOAD_OP:
0193
0194 status = acpi_ex_load_op(operand[0], operand[1], walk_state);
0195 break;
0196 #endif
0197
0198 default:
0199
0200 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
0201 walk_state->opcode));
0202 status = AE_AML_BAD_OPCODE;
0203 goto cleanup;
0204 }
0205
0206 cleanup:
0207
0208 return_ACPI_STATUS(status);
0209 }
0210 #endif
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227 acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
0228 {
0229 acpi_status status = AE_OK;
0230 union acpi_operand_object **operand = &walk_state->operands[0];
0231 union acpi_operand_object *return_desc = NULL;
0232 union acpi_operand_object *return_desc2 = NULL;
0233 u32 temp32;
0234 u32 i;
0235 u64 power_of_ten;
0236 u64 digit;
0237
0238 ACPI_FUNCTION_TRACE_STR(ex_opcode_1A_1T_1R,
0239 acpi_ps_get_opcode_name(walk_state->opcode));
0240
0241
0242
0243 switch (walk_state->opcode) {
0244 case AML_BIT_NOT_OP:
0245 case AML_FIND_SET_LEFT_BIT_OP:
0246 case AML_FIND_SET_RIGHT_BIT_OP:
0247 case AML_FROM_BCD_OP:
0248 case AML_LOAD_OP:
0249 case AML_TO_BCD_OP:
0250 case AML_CONDITIONAL_REF_OF_OP:
0251
0252
0253
0254 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
0255 if (!return_desc) {
0256 status = AE_NO_MEMORY;
0257 goto cleanup;
0258 }
0259
0260 switch (walk_state->opcode) {
0261 case AML_BIT_NOT_OP:
0262
0263 return_desc->integer.value = ~operand[0]->integer.value;
0264 break;
0265
0266 case AML_FIND_SET_LEFT_BIT_OP:
0267
0268 return_desc->integer.value = operand[0]->integer.value;
0269
0270
0271
0272
0273
0274 for (temp32 = 0; return_desc->integer.value &&
0275 temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) {
0276 return_desc->integer.value >>= 1;
0277 }
0278
0279 return_desc->integer.value = temp32;
0280 break;
0281
0282 case AML_FIND_SET_RIGHT_BIT_OP:
0283
0284 return_desc->integer.value = operand[0]->integer.value;
0285
0286
0287
0288
0289
0290 for (temp32 = 0; return_desc->integer.value &&
0291 temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) {
0292 return_desc->integer.value <<= 1;
0293 }
0294
0295
0296
0297 return_desc->integer.value =
0298 temp32 ==
0299 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - temp32;
0300 break;
0301
0302 case AML_FROM_BCD_OP:
0303
0304
0305
0306
0307
0308 power_of_ten = 1;
0309 return_desc->integer.value = 0;
0310 digit = operand[0]->integer.value;
0311
0312
0313
0314 for (i = 0;
0315 (i < acpi_gbl_integer_nybble_width) && (digit > 0);
0316 i++) {
0317
0318
0319
0320 temp32 = ((u32) digit) & 0xF;
0321
0322
0323
0324 if (temp32 > 9) {
0325 ACPI_ERROR((AE_INFO,
0326 "BCD digit too large (not decimal): 0x%X",
0327 temp32));
0328
0329 status = AE_AML_NUMERIC_OVERFLOW;
0330 goto cleanup;
0331 }
0332
0333
0334
0335 return_desc->integer.value +=
0336 (((u64) temp32) * power_of_ten);
0337
0338
0339
0340 digit >>= 4;
0341
0342
0343
0344 power_of_ten *= 10;
0345 }
0346 break;
0347
0348 case AML_LOAD_OP:
0349
0350 return_desc->integer.value = 0;
0351 status =
0352 acpi_ex_load_op(operand[0], return_desc,
0353 walk_state);
0354 if (ACPI_SUCCESS(status)) {
0355
0356
0357
0358 return_desc->integer.value = 0xFFFFFFFFFFFFFFFF;
0359 }
0360 break;
0361
0362 case AML_TO_BCD_OP:
0363
0364 return_desc->integer.value = 0;
0365 digit = operand[0]->integer.value;
0366
0367
0368
0369 for (i = 0;
0370 (i < acpi_gbl_integer_nybble_width) && (digit > 0);
0371 i++) {
0372 (void)acpi_ut_short_divide(digit, 10, &digit,
0373 &temp32);
0374
0375
0376
0377
0378
0379 return_desc->integer.value |=
0380 (((u64) temp32) << ACPI_MUL_4(i));
0381 }
0382
0383
0384
0385 if (digit > 0) {
0386 ACPI_ERROR((AE_INFO,
0387 "Integer too large to convert to BCD: 0x%8.8X%8.8X",
0388 ACPI_FORMAT_UINT64(operand[0]->
0389 integer.value)));
0390 status = AE_AML_NUMERIC_OVERFLOW;
0391 goto cleanup;
0392 }
0393 break;
0394
0395 case AML_CONDITIONAL_REF_OF_OP:
0396
0397
0398
0399
0400
0401 if ((struct acpi_namespace_node *)operand[0] ==
0402 acpi_gbl_root_node) {
0403
0404
0405
0406
0407 return_desc->integer.value = 0;
0408 goto cleanup;
0409 }
0410
0411
0412
0413 status = acpi_ex_get_object_reference(operand[0],
0414 &return_desc2,
0415 walk_state);
0416 if (ACPI_FAILURE(status)) {
0417 goto cleanup;
0418 }
0419
0420 status =
0421 acpi_ex_store(return_desc2, operand[1], walk_state);
0422 acpi_ut_remove_reference(return_desc2);
0423
0424
0425
0426 return_desc->integer.value = ACPI_UINT64_MAX;
0427 goto cleanup;
0428
0429 default:
0430
0431
0432
0433 break;
0434 }
0435 break;
0436
0437 case AML_STORE_OP:
0438
0439
0440
0441
0442
0443 status = acpi_ex_store(operand[0], operand[1], walk_state);
0444 if (ACPI_FAILURE(status)) {
0445 return_ACPI_STATUS(status);
0446 }
0447
0448
0449
0450 if (!walk_state->result_obj) {
0451
0452
0453
0454
0455
0456
0457 walk_state->result_obj = operand[0];
0458 walk_state->operands[0] = NULL;
0459 }
0460 return_ACPI_STATUS(status);
0461
0462
0463
0464
0465 case AML_COPY_OBJECT_OP:
0466
0467 status =
0468 acpi_ut_copy_iobject_to_iobject(operand[0], &return_desc,
0469 walk_state);
0470 break;
0471
0472 case AML_TO_DECIMAL_STRING_OP:
0473
0474 status =
0475 acpi_ex_convert_to_string(operand[0], &return_desc,
0476 ACPI_EXPLICIT_CONVERT_DECIMAL);
0477 if (return_desc == operand[0]) {
0478
0479
0480
0481 acpi_ut_add_reference(return_desc);
0482 }
0483 break;
0484
0485 case AML_TO_HEX_STRING_OP:
0486
0487 status =
0488 acpi_ex_convert_to_string(operand[0], &return_desc,
0489 ACPI_EXPLICIT_CONVERT_HEX);
0490 if (return_desc == operand[0]) {
0491
0492
0493
0494 acpi_ut_add_reference(return_desc);
0495 }
0496 break;
0497
0498 case AML_TO_BUFFER_OP:
0499
0500 status = acpi_ex_convert_to_buffer(operand[0], &return_desc);
0501 if (return_desc == operand[0]) {
0502
0503
0504
0505 acpi_ut_add_reference(return_desc);
0506 }
0507 break;
0508
0509 case AML_TO_INTEGER_OP:
0510
0511
0512
0513 status =
0514 acpi_ex_convert_to_integer(operand[0], &return_desc, 0);
0515 if (return_desc == operand[0]) {
0516
0517
0518
0519 acpi_ut_add_reference(return_desc);
0520 }
0521 break;
0522
0523 case AML_SHIFT_LEFT_BIT_OP:
0524 case AML_SHIFT_RIGHT_BIT_OP:
0525
0526
0527
0528 ACPI_ERROR((AE_INFO,
0529 "%s is obsolete and not implemented",
0530 acpi_ps_get_opcode_name(walk_state->opcode)));
0531 status = AE_SUPPORT;
0532 goto cleanup;
0533
0534 default:
0535
0536 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
0537 walk_state->opcode));
0538 status = AE_AML_BAD_OPCODE;
0539 goto cleanup;
0540 }
0541
0542 if (ACPI_SUCCESS(status)) {
0543
0544
0545
0546 status = acpi_ex_store(return_desc, operand[1], walk_state);
0547 }
0548
0549 cleanup:
0550
0551
0552
0553 if (ACPI_FAILURE(status)) {
0554 acpi_ut_remove_reference(return_desc);
0555 }
0556
0557
0558
0559 else if (!walk_state->result_obj) {
0560 walk_state->result_obj = return_desc;
0561 }
0562
0563 return_ACPI_STATUS(status);
0564 }
0565
0566
0567
0568
0569
0570
0571
0572
0573
0574
0575
0576
0577
0578 acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
0579 {
0580 union acpi_operand_object **operand = &walk_state->operands[0];
0581 union acpi_operand_object *temp_desc;
0582 union acpi_operand_object *return_desc = NULL;
0583 acpi_status status = AE_OK;
0584 u32 type;
0585 u64 value;
0586
0587 ACPI_FUNCTION_TRACE_STR(ex_opcode_1A_0T_1R,
0588 acpi_ps_get_opcode_name(walk_state->opcode));
0589
0590
0591
0592 switch (walk_state->opcode) {
0593 case AML_LOGICAL_NOT_OP:
0594
0595 return_desc = acpi_ut_create_integer_object((u64) 0);
0596 if (!return_desc) {
0597 status = AE_NO_MEMORY;
0598 goto cleanup;
0599 }
0600
0601
0602
0603
0604
0605 if (!operand[0]->integer.value) {
0606 return_desc->integer.value = ACPI_UINT64_MAX;
0607 }
0608 break;
0609
0610 case AML_DECREMENT_OP:
0611 case AML_INCREMENT_OP:
0612
0613
0614
0615
0616 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
0617 if (!return_desc) {
0618 status = AE_NO_MEMORY;
0619 goto cleanup;
0620 }
0621
0622
0623
0624
0625
0626 temp_desc = operand[0];
0627 if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) ==
0628 ACPI_DESC_TYPE_OPERAND) {
0629
0630
0631
0632 acpi_ut_add_reference(temp_desc);
0633 }
0634
0635
0636
0637
0638
0639
0640
0641
0642 status = acpi_ex_resolve_operands(AML_LOGICAL_NOT_OP,
0643 &temp_desc, walk_state);
0644 if (ACPI_FAILURE(status)) {
0645 ACPI_EXCEPTION((AE_INFO, status,
0646 "While resolving operands for [%s]",
0647 acpi_ps_get_opcode_name(walk_state->
0648 opcode)));
0649
0650 goto cleanup;
0651 }
0652
0653
0654
0655
0656
0657 if (walk_state->opcode == AML_INCREMENT_OP) {
0658 return_desc->integer.value =
0659 temp_desc->integer.value + 1;
0660 } else {
0661 return_desc->integer.value =
0662 temp_desc->integer.value - 1;
0663 }
0664
0665
0666
0667 acpi_ut_remove_reference(temp_desc);
0668
0669
0670
0671
0672
0673 status = acpi_ex_store(return_desc, operand[0], walk_state);
0674 break;
0675
0676 case AML_OBJECT_TYPE_OP:
0677
0678
0679
0680
0681
0682
0683
0684
0685
0686 status =
0687 acpi_ex_resolve_multiple(walk_state, operand[0], &type,
0688 NULL);
0689 if (ACPI_FAILURE(status)) {
0690 goto cleanup;
0691 }
0692
0693
0694
0695 return_desc = acpi_ut_create_integer_object((u64) type);
0696 if (!return_desc) {
0697 status = AE_NO_MEMORY;
0698 goto cleanup;
0699 }
0700 break;
0701
0702 case AML_SIZE_OF_OP:
0703
0704
0705
0706
0707
0708
0709
0710 status =
0711 acpi_ex_resolve_multiple(walk_state, operand[0], &type,
0712 &temp_desc);
0713 if (ACPI_FAILURE(status)) {
0714 goto cleanup;
0715 }
0716
0717
0718
0719
0720
0721
0722
0723
0724
0725
0726 switch (type) {
0727 case ACPI_TYPE_INTEGER:
0728
0729 value = acpi_gbl_integer_byte_width;
0730 break;
0731
0732 case ACPI_TYPE_STRING:
0733
0734 value = temp_desc->string.length;
0735 break;
0736
0737 case ACPI_TYPE_BUFFER:
0738
0739
0740
0741 status = acpi_ds_get_buffer_arguments(temp_desc);
0742 value = temp_desc->buffer.length;
0743 break;
0744
0745 case ACPI_TYPE_PACKAGE:
0746
0747
0748
0749 status = acpi_ds_get_package_arguments(temp_desc);
0750 value = temp_desc->package.count;
0751 break;
0752
0753 default:
0754
0755 ACPI_ERROR((AE_INFO,
0756 "Operand must be Buffer/Integer/String/Package"
0757 " - found type %s",
0758 acpi_ut_get_type_name(type)));
0759
0760 status = AE_AML_OPERAND_TYPE;
0761 goto cleanup;
0762 }
0763
0764 if (ACPI_FAILURE(status)) {
0765 goto cleanup;
0766 }
0767
0768
0769
0770
0771
0772 return_desc = acpi_ut_create_integer_object(value);
0773 if (!return_desc) {
0774 status = AE_NO_MEMORY;
0775 goto cleanup;
0776 }
0777 break;
0778
0779 case AML_REF_OF_OP:
0780
0781 status =
0782 acpi_ex_get_object_reference(operand[0], &return_desc,
0783 walk_state);
0784 if (ACPI_FAILURE(status)) {
0785 goto cleanup;
0786 }
0787 break;
0788
0789 case AML_DEREF_OF_OP:
0790
0791
0792
0793 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
0794 ACPI_DESC_TYPE_NAMED) {
0795 temp_desc =
0796 acpi_ns_get_attached_object((struct
0797 acpi_namespace_node *)
0798 operand[0]);
0799 if (temp_desc
0800 && ((temp_desc->common.type == ACPI_TYPE_STRING)
0801 || (temp_desc->common.type ==
0802 ACPI_TYPE_LOCAL_REFERENCE))) {
0803 operand[0] = temp_desc;
0804 acpi_ut_add_reference(temp_desc);
0805 } else {
0806 status = AE_AML_OPERAND_TYPE;
0807 goto cleanup;
0808 }
0809 } else {
0810 switch ((operand[0])->common.type) {
0811 case ACPI_TYPE_LOCAL_REFERENCE:
0812
0813
0814
0815
0816
0817 switch (operand[0]->reference.class) {
0818 case ACPI_REFCLASS_LOCAL:
0819 case ACPI_REFCLASS_ARG:
0820
0821
0822
0823 status =
0824 acpi_ds_method_data_get_value
0825 (operand[0]->reference.class,
0826 operand[0]->reference.value,
0827 walk_state, &temp_desc);
0828 if (ACPI_FAILURE(status)) {
0829 goto cleanup;
0830 }
0831
0832
0833
0834
0835
0836 acpi_ut_remove_reference(operand[0]);
0837 operand[0] = temp_desc;
0838 break;
0839
0840 case ACPI_REFCLASS_REFOF:
0841
0842
0843
0844 temp_desc =
0845 operand[0]->reference.object;
0846 acpi_ut_remove_reference(operand[0]);
0847 operand[0] = temp_desc;
0848 break;
0849
0850 default:
0851
0852
0853 break;
0854 }
0855 break;
0856
0857 case ACPI_TYPE_STRING:
0858
0859 break;
0860
0861 default:
0862
0863 status = AE_AML_OPERAND_TYPE;
0864 goto cleanup;
0865 }
0866 }
0867
0868 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
0869 ACPI_DESC_TYPE_NAMED) {
0870 if ((operand[0])->common.type == ACPI_TYPE_STRING) {
0871
0872
0873
0874
0875
0876
0877
0878
0879 status =
0880 acpi_ns_get_node_unlocked(walk_state->
0881 scope_info->scope.
0882 node,
0883 operand[0]->
0884 string.pointer,
0885 ACPI_NS_SEARCH_PARENT,
0886 ACPI_CAST_INDIRECT_PTR
0887 (struct
0888 acpi_namespace_node,
0889 &return_desc));
0890 if (ACPI_FAILURE(status)) {
0891 goto cleanup;
0892 }
0893
0894 status =
0895 acpi_ex_resolve_node_to_value
0896 (ACPI_CAST_INDIRECT_PTR
0897 (struct acpi_namespace_node, &return_desc),
0898 walk_state);
0899 goto cleanup;
0900 }
0901 }
0902
0903
0904
0905 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
0906 ACPI_DESC_TYPE_NAMED) {
0907
0908
0909
0910
0911
0912
0913
0914 switch (((struct acpi_namespace_node *)operand[0])->
0915 type) {
0916 case ACPI_TYPE_DEVICE:
0917 case ACPI_TYPE_THERMAL:
0918
0919
0920
0921 return_desc = operand[0];
0922 break;
0923
0924 default:
0925
0926
0927 return_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)operand[0]);
0928 acpi_ut_add_reference(return_desc);
0929 break;
0930 }
0931 } else {
0932
0933
0934
0935
0936 switch (operand[0]->reference.class) {
0937 case ACPI_REFCLASS_INDEX:
0938
0939
0940
0941
0942 switch (operand[0]->reference.target_type) {
0943 case ACPI_TYPE_BUFFER_FIELD:
0944
0945 temp_desc =
0946 operand[0]->reference.object;
0947
0948
0949
0950
0951
0952
0953
0954
0955
0956
0957
0958
0959
0960 return_desc =
0961 acpi_ut_create_integer_object((u64)
0962 temp_desc->buffer.pointer[operand[0]->reference.value]);
0963 if (!return_desc) {
0964 status = AE_NO_MEMORY;
0965 goto cleanup;
0966 }
0967 break;
0968
0969 case ACPI_TYPE_PACKAGE:
0970
0971
0972
0973
0974 return_desc =
0975 *(operand[0]->reference.where);
0976 if (!return_desc) {
0977
0978
0979
0980
0981
0982 return_ACPI_STATUS
0983 (AE_AML_UNINITIALIZED_ELEMENT);
0984 }
0985
0986 acpi_ut_add_reference(return_desc);
0987 break;
0988
0989 default:
0990
0991 ACPI_ERROR((AE_INFO,
0992 "Unknown Index TargetType 0x%X in reference object %p",
0993 operand[0]->reference.
0994 target_type, operand[0]));
0995
0996 status = AE_AML_OPERAND_TYPE;
0997 goto cleanup;
0998 }
0999 break;
1000
1001 case ACPI_REFCLASS_REFOF:
1002
1003 return_desc = operand[0]->reference.object;
1004
1005 if (ACPI_GET_DESCRIPTOR_TYPE(return_desc) ==
1006 ACPI_DESC_TYPE_NAMED) {
1007 return_desc =
1008 acpi_ns_get_attached_object((struct
1009 acpi_namespace_node
1010 *)
1011 return_desc);
1012 if (!return_desc) {
1013 break;
1014 }
1015
1016
1017
1018
1019
1020 switch (return_desc->common.type) {
1021 case ACPI_TYPE_BUFFER_FIELD:
1022 case ACPI_TYPE_LOCAL_REGION_FIELD:
1023 case ACPI_TYPE_LOCAL_BANK_FIELD:
1024 case ACPI_TYPE_LOCAL_INDEX_FIELD:
1025
1026 status =
1027 acpi_ex_read_data_from_field
1028 (walk_state, return_desc,
1029 &temp_desc);
1030 if (ACPI_FAILURE(status)) {
1031 return_ACPI_STATUS
1032 (status);
1033 }
1034
1035 return_desc = temp_desc;
1036 break;
1037
1038 default:
1039
1040
1041
1042 acpi_ut_add_reference
1043 (return_desc);
1044 break;
1045 }
1046 }
1047 break;
1048
1049 default:
1050
1051 ACPI_ERROR((AE_INFO,
1052 "Unknown class in reference(%p) - 0x%2.2X",
1053 operand[0],
1054 operand[0]->reference.class));
1055
1056 status = AE_TYPE;
1057 goto cleanup;
1058 }
1059 }
1060 break;
1061
1062 default:
1063
1064 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
1065 walk_state->opcode));
1066
1067 status = AE_AML_BAD_OPCODE;
1068 goto cleanup;
1069 }
1070
1071 cleanup:
1072
1073
1074
1075 if (ACPI_FAILURE(status)) {
1076 acpi_ut_remove_reference(return_desc);
1077 }
1078
1079
1080
1081 else {
1082 walk_state->result_obj = return_desc;
1083 }
1084
1085 return_ACPI_STATUS(status);
1086 }