exresop.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /******************************************************************************
  2. *
  3. * Module Name: exresop - AML Interpreter operand/object resolution
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2008, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include <acpi/amlcode.h>
  44. #include <acpi/acparser.h>
  45. #include <acpi/acinterp.h>
  46. #include <acpi/acnamesp.h>
  47. #define _COMPONENT ACPI_EXECUTER
  48. ACPI_MODULE_NAME("exresop")
  49. /* Local prototypes */
  50. static acpi_status
  51. acpi_ex_check_object_type(acpi_object_type type_needed,
  52. acpi_object_type this_type, void *object);
  53. /*******************************************************************************
  54. *
  55. * FUNCTION: acpi_ex_check_object_type
  56. *
  57. * PARAMETERS: type_needed Object type needed
  58. * this_type Actual object type
  59. * Object Object pointer
  60. *
  61. * RETURN: Status
  62. *
  63. * DESCRIPTION: Check required type against actual type
  64. *
  65. ******************************************************************************/
  66. static acpi_status
  67. acpi_ex_check_object_type(acpi_object_type type_needed,
  68. acpi_object_type this_type, void *object)
  69. {
  70. ACPI_FUNCTION_ENTRY();
  71. if (type_needed == ACPI_TYPE_ANY) {
  72. /* All types OK, so we don't perform any typechecks */
  73. return (AE_OK);
  74. }
  75. if (type_needed == ACPI_TYPE_LOCAL_REFERENCE) {
  76. /*
  77. * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
  78. * objects and thus allow them to be targets. (As per the ACPI
  79. * specification, a store to a constant is a noop.)
  80. */
  81. if ((this_type == ACPI_TYPE_INTEGER) &&
  82. (((union acpi_operand_object *)object)->common.
  83. flags & AOPOBJ_AML_CONSTANT)) {
  84. return (AE_OK);
  85. }
  86. }
  87. if (type_needed != this_type) {
  88. ACPI_ERROR((AE_INFO,
  89. "Needed type [%s], found [%s] %p",
  90. acpi_ut_get_type_name(type_needed),
  91. acpi_ut_get_type_name(this_type), object));
  92. return (AE_AML_OPERAND_TYPE);
  93. }
  94. return (AE_OK);
  95. }
  96. /*******************************************************************************
  97. *
  98. * FUNCTION: acpi_ex_resolve_operands
  99. *
  100. * PARAMETERS: Opcode - Opcode being interpreted
  101. * stack_ptr - Pointer to the operand stack to be
  102. * resolved
  103. * walk_state - Current state
  104. *
  105. * RETURN: Status
  106. *
  107. * DESCRIPTION: Convert multiple input operands to the types required by the
  108. * target operator.
  109. *
  110. * Each 5-bit group in arg_types represents one required
  111. * operand and indicates the required Type. The corresponding operand
  112. * will be converted to the required type if possible, otherwise we
  113. * abort with an exception.
  114. *
  115. ******************************************************************************/
  116. acpi_status
  117. acpi_ex_resolve_operands(u16 opcode,
  118. union acpi_operand_object ** stack_ptr,
  119. struct acpi_walk_state * walk_state)
  120. {
  121. union acpi_operand_object *obj_desc;
  122. acpi_status status = AE_OK;
  123. u8 object_type;
  124. u32 arg_types;
  125. const struct acpi_opcode_info *op_info;
  126. u32 this_arg_type;
  127. acpi_object_type type_needed;
  128. u16 target_op = 0;
  129. ACPI_FUNCTION_TRACE_U32(ex_resolve_operands, opcode);
  130. op_info = acpi_ps_get_opcode_info(opcode);
  131. if (op_info->class == AML_CLASS_UNKNOWN) {
  132. return_ACPI_STATUS(AE_AML_BAD_OPCODE);
  133. }
  134. arg_types = op_info->runtime_args;
  135. if (arg_types == ARGI_INVALID_OPCODE) {
  136. ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", opcode));
  137. return_ACPI_STATUS(AE_AML_INTERNAL);
  138. }
  139. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  140. "Opcode %X [%s] RequiredOperandTypes=%8.8X\n",
  141. opcode, op_info->name, arg_types));
  142. /*
  143. * Normal exit is with (arg_types == 0) at end of argument list.
  144. * Function will return an exception from within the loop upon
  145. * finding an entry which is not (or cannot be converted
  146. * to) the required type; if stack underflows; or upon
  147. * finding a NULL stack entry (which should not happen).
  148. */
  149. while (GET_CURRENT_ARG_TYPE(arg_types)) {
  150. if (!stack_ptr || !*stack_ptr) {
  151. ACPI_ERROR((AE_INFO, "Null stack entry at %p",
  152. stack_ptr));
  153. return_ACPI_STATUS(AE_AML_INTERNAL);
  154. }
  155. /* Extract useful items */
  156. obj_desc = *stack_ptr;
  157. /* Decode the descriptor type */
  158. switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
  159. case ACPI_DESC_TYPE_NAMED:
  160. /* Namespace Node */
  161. object_type =
  162. ((struct acpi_namespace_node *)obj_desc)->type;
  163. /*
  164. * Resolve an alias object. The construction of these objects
  165. * guarantees that there is only one level of alias indirection;
  166. * thus, the attached object is always the aliased namespace node
  167. */
  168. if (object_type == ACPI_TYPE_LOCAL_ALIAS) {
  169. obj_desc =
  170. acpi_ns_get_attached_object((struct
  171. acpi_namespace_node
  172. *)obj_desc);
  173. *stack_ptr = obj_desc;
  174. object_type =
  175. ((struct acpi_namespace_node *)obj_desc)->
  176. type;
  177. }
  178. break;
  179. case ACPI_DESC_TYPE_OPERAND:
  180. /* ACPI internal object */
  181. object_type = ACPI_GET_OBJECT_TYPE(obj_desc);
  182. /* Check for bad acpi_object_type */
  183. if (!acpi_ut_valid_object_type(object_type)) {
  184. ACPI_ERROR((AE_INFO,
  185. "Bad operand object type [%X]",
  186. object_type));
  187. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  188. }
  189. if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
  190. /* Decode the Reference */
  191. op_info = acpi_ps_get_opcode_info(opcode);
  192. if (op_info->class == AML_CLASS_UNKNOWN) {
  193. return_ACPI_STATUS(AE_AML_BAD_OPCODE);
  194. }
  195. switch (obj_desc->reference.opcode) {
  196. case AML_DEBUG_OP:
  197. target_op = AML_DEBUG_OP;
  198. /*lint -fallthrough */
  199. case AML_INDEX_OP:
  200. case AML_REF_OF_OP:
  201. case AML_ARG_OP:
  202. case AML_LOCAL_OP:
  203. case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
  204. case AML_INT_NAMEPATH_OP: /* Reference to a named object */
  205. ACPI_DEBUG_ONLY_MEMBERS(ACPI_DEBUG_PRINT
  206. ((ACPI_DB_EXEC,
  207. "Operand is a Reference, RefOpcode [%s]\n",
  208. (acpi_ps_get_opcode_info
  209. (obj_desc->
  210. reference.
  211. opcode))->
  212. name)));
  213. break;
  214. default:
  215. ACPI_ERROR((AE_INFO,
  216. "Operand is a Reference, Unknown Reference Opcode: %X",
  217. obj_desc->reference.
  218. opcode));
  219. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  220. }
  221. }
  222. break;
  223. default:
  224. /* Invalid descriptor */
  225. ACPI_ERROR((AE_INFO,
  226. "Invalid descriptor %p [%s]",
  227. obj_desc,
  228. acpi_ut_get_descriptor_name(obj_desc)));
  229. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  230. }
  231. /* Get one argument type, point to the next */
  232. this_arg_type = GET_CURRENT_ARG_TYPE(arg_types);
  233. INCREMENT_ARG_LIST(arg_types);
  234. /*
  235. * Handle cases where the object does not need to be
  236. * resolved to a value
  237. */
  238. switch (this_arg_type) {
  239. case ARGI_REF_OR_STRING: /* Can be a String or Reference */
  240. if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  241. ACPI_DESC_TYPE_OPERAND)
  242. && (ACPI_GET_OBJECT_TYPE(obj_desc) ==
  243. ACPI_TYPE_STRING)) {
  244. /*
  245. * String found - the string references a named object and
  246. * must be resolved to a node
  247. */
  248. goto next_operand;
  249. }
  250. /*
  251. * Else not a string - fall through to the normal Reference
  252. * case below
  253. */
  254. /*lint -fallthrough */
  255. case ARGI_REFERENCE: /* References: */
  256. case ARGI_INTEGER_REF:
  257. case ARGI_OBJECT_REF:
  258. case ARGI_DEVICE_REF:
  259. case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
  260. case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
  261. case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
  262. /*
  263. * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
  264. * A Namespace Node is OK as-is
  265. */
  266. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  267. ACPI_DESC_TYPE_NAMED) {
  268. goto next_operand;
  269. }
  270. status =
  271. acpi_ex_check_object_type(ACPI_TYPE_LOCAL_REFERENCE,
  272. object_type, obj_desc);
  273. if (ACPI_FAILURE(status)) {
  274. return_ACPI_STATUS(status);
  275. }
  276. goto next_operand;
  277. case ARGI_DATAREFOBJ: /* Store operator only */
  278. /*
  279. * We don't want to resolve index_op reference objects during
  280. * a store because this would be an implicit de_ref_of operation.
  281. * Instead, we just want to store the reference object.
  282. * -- All others must be resolved below.
  283. */
  284. if ((opcode == AML_STORE_OP) &&
  285. (ACPI_GET_OBJECT_TYPE(*stack_ptr) ==
  286. ACPI_TYPE_LOCAL_REFERENCE)
  287. && ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) {
  288. goto next_operand;
  289. }
  290. break;
  291. default:
  292. /* All cases covered above */
  293. break;
  294. }
  295. /*
  296. * Resolve this object to a value
  297. */
  298. status = acpi_ex_resolve_to_value(stack_ptr, walk_state);
  299. if (ACPI_FAILURE(status)) {
  300. return_ACPI_STATUS(status);
  301. }
  302. /* Get the resolved object */
  303. obj_desc = *stack_ptr;
  304. /*
  305. * Check the resulting object (value) type
  306. */
  307. switch (this_arg_type) {
  308. /*
  309. * For the simple cases, only one type of resolved object
  310. * is allowed
  311. */
  312. case ARGI_MUTEX:
  313. /* Need an operand of type ACPI_TYPE_MUTEX */
  314. type_needed = ACPI_TYPE_MUTEX;
  315. break;
  316. case ARGI_EVENT:
  317. /* Need an operand of type ACPI_TYPE_EVENT */
  318. type_needed = ACPI_TYPE_EVENT;
  319. break;
  320. case ARGI_PACKAGE: /* Package */
  321. /* Need an operand of type ACPI_TYPE_PACKAGE */
  322. type_needed = ACPI_TYPE_PACKAGE;
  323. break;
  324. case ARGI_ANYTYPE:
  325. /* Any operand type will do */
  326. type_needed = ACPI_TYPE_ANY;
  327. break;
  328. case ARGI_DDBHANDLE:
  329. /* Need an operand of type ACPI_TYPE_DDB_HANDLE */
  330. type_needed = ACPI_TYPE_LOCAL_REFERENCE;
  331. break;
  332. /*
  333. * The more complex cases allow multiple resolved object types
  334. */
  335. case ARGI_INTEGER:
  336. /*
  337. * Need an operand of type ACPI_TYPE_INTEGER,
  338. * But we can implicitly convert from a STRING or BUFFER
  339. * Aka - "Implicit Source Operand Conversion"
  340. */
  341. status =
  342. acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16);
  343. if (ACPI_FAILURE(status)) {
  344. if (status == AE_TYPE) {
  345. ACPI_ERROR((AE_INFO,
  346. "Needed [Integer/String/Buffer], found [%s] %p",
  347. acpi_ut_get_object_type_name
  348. (obj_desc), obj_desc));
  349. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  350. }
  351. return_ACPI_STATUS(status);
  352. }
  353. if (obj_desc != *stack_ptr) {
  354. acpi_ut_remove_reference(obj_desc);
  355. }
  356. goto next_operand;
  357. case ARGI_BUFFER:
  358. /*
  359. * Need an operand of type ACPI_TYPE_BUFFER,
  360. * But we can implicitly convert from a STRING or INTEGER
  361. * Aka - "Implicit Source Operand Conversion"
  362. */
  363. status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr);
  364. if (ACPI_FAILURE(status)) {
  365. if (status == AE_TYPE) {
  366. ACPI_ERROR((AE_INFO,
  367. "Needed [Integer/String/Buffer], found [%s] %p",
  368. acpi_ut_get_object_type_name
  369. (obj_desc), obj_desc));
  370. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  371. }
  372. return_ACPI_STATUS(status);
  373. }
  374. if (obj_desc != *stack_ptr) {
  375. acpi_ut_remove_reference(obj_desc);
  376. }
  377. goto next_operand;
  378. case ARGI_STRING:
  379. /*
  380. * Need an operand of type ACPI_TYPE_STRING,
  381. * But we can implicitly convert from a BUFFER or INTEGER
  382. * Aka - "Implicit Source Operand Conversion"
  383. */
  384. status = acpi_ex_convert_to_string(obj_desc, stack_ptr,
  385. ACPI_IMPLICIT_CONVERT_HEX);
  386. if (ACPI_FAILURE(status)) {
  387. if (status == AE_TYPE) {
  388. ACPI_ERROR((AE_INFO,
  389. "Needed [Integer/String/Buffer], found [%s] %p",
  390. acpi_ut_get_object_type_name
  391. (obj_desc), obj_desc));
  392. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  393. }
  394. return_ACPI_STATUS(status);
  395. }
  396. if (obj_desc != *stack_ptr) {
  397. acpi_ut_remove_reference(obj_desc);
  398. }
  399. goto next_operand;
  400. case ARGI_COMPUTEDATA:
  401. /* Need an operand of type INTEGER, STRING or BUFFER */
  402. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  403. case ACPI_TYPE_INTEGER:
  404. case ACPI_TYPE_STRING:
  405. case ACPI_TYPE_BUFFER:
  406. /* Valid operand */
  407. break;
  408. default:
  409. ACPI_ERROR((AE_INFO,
  410. "Needed [Integer/String/Buffer], found [%s] %p",
  411. acpi_ut_get_object_type_name
  412. (obj_desc), obj_desc));
  413. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  414. }
  415. goto next_operand;
  416. case ARGI_BUFFER_OR_STRING:
  417. /* Need an operand of type STRING or BUFFER */
  418. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  419. case ACPI_TYPE_STRING:
  420. case ACPI_TYPE_BUFFER:
  421. /* Valid operand */
  422. break;
  423. case ACPI_TYPE_INTEGER:
  424. /* Highest priority conversion is to type Buffer */
  425. status =
  426. acpi_ex_convert_to_buffer(obj_desc,
  427. stack_ptr);
  428. if (ACPI_FAILURE(status)) {
  429. return_ACPI_STATUS(status);
  430. }
  431. if (obj_desc != *stack_ptr) {
  432. acpi_ut_remove_reference(obj_desc);
  433. }
  434. break;
  435. default:
  436. ACPI_ERROR((AE_INFO,
  437. "Needed [Integer/String/Buffer], found [%s] %p",
  438. acpi_ut_get_object_type_name
  439. (obj_desc), obj_desc));
  440. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  441. }
  442. goto next_operand;
  443. case ARGI_DATAOBJECT:
  444. /*
  445. * ARGI_DATAOBJECT is only used by the size_of operator.
  446. * Need a buffer, string, package, or ref_of reference.
  447. *
  448. * The only reference allowed here is a direct reference to
  449. * a namespace node.
  450. */
  451. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  452. case ACPI_TYPE_PACKAGE:
  453. case ACPI_TYPE_STRING:
  454. case ACPI_TYPE_BUFFER:
  455. case ACPI_TYPE_LOCAL_REFERENCE:
  456. /* Valid operand */
  457. break;
  458. default:
  459. ACPI_ERROR((AE_INFO,
  460. "Needed [Buffer/String/Package/Reference], found [%s] %p",
  461. acpi_ut_get_object_type_name
  462. (obj_desc), obj_desc));
  463. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  464. }
  465. goto next_operand;
  466. case ARGI_COMPLEXOBJ:
  467. /* Need a buffer or package or (ACPI 2.0) String */
  468. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  469. case ACPI_TYPE_PACKAGE:
  470. case ACPI_TYPE_STRING:
  471. case ACPI_TYPE_BUFFER:
  472. /* Valid operand */
  473. break;
  474. default:
  475. ACPI_ERROR((AE_INFO,
  476. "Needed [Buffer/String/Package], found [%s] %p",
  477. acpi_ut_get_object_type_name
  478. (obj_desc), obj_desc));
  479. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  480. }
  481. goto next_operand;
  482. case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
  483. /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
  484. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  485. case ACPI_TYPE_BUFFER:
  486. case ACPI_TYPE_REGION:
  487. /* Valid operand */
  488. break;
  489. default:
  490. ACPI_ERROR((AE_INFO,
  491. "Needed [Region/Buffer], found [%s] %p",
  492. acpi_ut_get_object_type_name
  493. (obj_desc), obj_desc));
  494. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  495. }
  496. goto next_operand;
  497. case ARGI_DATAREFOBJ:
  498. /* Used by the Store() operator only */
  499. switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
  500. case ACPI_TYPE_INTEGER:
  501. case ACPI_TYPE_PACKAGE:
  502. case ACPI_TYPE_STRING:
  503. case ACPI_TYPE_BUFFER:
  504. case ACPI_TYPE_BUFFER_FIELD:
  505. case ACPI_TYPE_LOCAL_REFERENCE:
  506. case ACPI_TYPE_LOCAL_REGION_FIELD:
  507. case ACPI_TYPE_LOCAL_BANK_FIELD:
  508. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  509. case ACPI_TYPE_DDB_HANDLE:
  510. /* Valid operand */
  511. break;
  512. default:
  513. if (acpi_gbl_enable_interpreter_slack) {
  514. /*
  515. * Enable original behavior of Store(), allowing any and all
  516. * objects as the source operand. The ACPI spec does not
  517. * allow this, however.
  518. */
  519. break;
  520. }
  521. if (target_op == AML_DEBUG_OP) {
  522. /* Allow store of any object to the Debug object */
  523. break;
  524. }
  525. ACPI_ERROR((AE_INFO,
  526. "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
  527. acpi_ut_get_object_type_name
  528. (obj_desc), obj_desc));
  529. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  530. }
  531. goto next_operand;
  532. default:
  533. /* Unknown type */
  534. ACPI_ERROR((AE_INFO,
  535. "Internal - Unknown ARGI (required operand) type %X",
  536. this_arg_type));
  537. return_ACPI_STATUS(AE_BAD_PARAMETER);
  538. }
  539. /*
  540. * Make sure that the original object was resolved to the
  541. * required object type (Simple cases only).
  542. */
  543. status = acpi_ex_check_object_type(type_needed,
  544. ACPI_GET_OBJECT_TYPE
  545. (*stack_ptr), *stack_ptr);
  546. if (ACPI_FAILURE(status)) {
  547. return_ACPI_STATUS(status);
  548. }
  549. next_operand:
  550. /*
  551. * If more operands needed, decrement stack_ptr to point
  552. * to next operand on stack
  553. */
  554. if (GET_CURRENT_ARG_TYPE(arg_types)) {
  555. stack_ptr--;
  556. }
  557. }
  558. ACPI_DUMP_OPERANDS(walk_state->operands,
  559. acpi_ps_get_opcode_name(opcode),
  560. walk_state->num_operands);
  561. return_ACPI_STATUS(status);
  562. }