psargs.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. /******************************************************************************
  2. *
  3. * Module Name: psargs - Parse AML opcode arguments
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  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/acparser.h>
  44. #include <acpi/amlcode.h>
  45. #include <acpi/acnamesp.h>
  46. #define _COMPONENT ACPI_PARSER
  47. ACPI_MODULE_NAME ("psargs")
  48. /*******************************************************************************
  49. *
  50. * FUNCTION: acpi_ps_get_next_package_length
  51. *
  52. * PARAMETERS: parser_state - Current parser state object
  53. *
  54. * RETURN: Decoded package length. On completion, the AML pointer points
  55. * past the length byte or bytes.
  56. *
  57. * DESCRIPTION: Decode and return a package length field
  58. *
  59. ******************************************************************************/
  60. u32
  61. acpi_ps_get_next_package_length (
  62. struct acpi_parse_state *parser_state)
  63. {
  64. u32 encoded_length;
  65. u32 length = 0;
  66. ACPI_FUNCTION_TRACE ("ps_get_next_package_length");
  67. encoded_length = (u32) ACPI_GET8 (parser_state->aml);
  68. parser_state->aml++;
  69. switch (encoded_length >> 6) /* bits 6-7 contain encoding scheme */ {
  70. case 0: /* 1-byte encoding (bits 0-5) */
  71. length = (encoded_length & 0x3F);
  72. break;
  73. case 1: /* 2-byte encoding (next byte + bits 0-3) */
  74. length = ((ACPI_GET8 (parser_state->aml) << 04) |
  75. (encoded_length & 0x0F));
  76. parser_state->aml++;
  77. break;
  78. case 2: /* 3-byte encoding (next 2 bytes + bits 0-3) */
  79. length = ((ACPI_GET8 (parser_state->aml + 1) << 12) |
  80. (ACPI_GET8 (parser_state->aml) << 04) |
  81. (encoded_length & 0x0F));
  82. parser_state->aml += 2;
  83. break;
  84. case 3: /* 4-byte encoding (next 3 bytes + bits 0-3) */
  85. length = ((ACPI_GET8 (parser_state->aml + 2) << 20) |
  86. (ACPI_GET8 (parser_state->aml + 1) << 12) |
  87. (ACPI_GET8 (parser_state->aml) << 04) |
  88. (encoded_length & 0x0F));
  89. parser_state->aml += 3;
  90. break;
  91. default:
  92. /* Can't get here, only 2 bits / 4 cases */
  93. break;
  94. }
  95. return_VALUE (length);
  96. }
  97. /*******************************************************************************
  98. *
  99. * FUNCTION: acpi_ps_get_next_package_end
  100. *
  101. * PARAMETERS: parser_state - Current parser state object
  102. *
  103. * RETURN: Pointer to end-of-package +1
  104. *
  105. * DESCRIPTION: Get next package length and return a pointer past the end of
  106. * the package. Consumes the package length field
  107. *
  108. ******************************************************************************/
  109. u8 *
  110. acpi_ps_get_next_package_end (
  111. struct acpi_parse_state *parser_state)
  112. {
  113. u8 *start = parser_state->aml;
  114. acpi_native_uint length;
  115. ACPI_FUNCTION_TRACE ("ps_get_next_package_end");
  116. /* Function below changes parser_state->Aml */
  117. length = (acpi_native_uint) acpi_ps_get_next_package_length (parser_state);
  118. return_PTR (start + length); /* end of package */
  119. }
  120. /*******************************************************************************
  121. *
  122. * FUNCTION: acpi_ps_get_next_namestring
  123. *
  124. * PARAMETERS: parser_state - Current parser state object
  125. *
  126. * RETURN: Pointer to the start of the name string (pointer points into
  127. * the AML.
  128. *
  129. * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name
  130. * prefix characters. Set parser state to point past the string.
  131. * (Name is consumed from the AML.)
  132. *
  133. ******************************************************************************/
  134. char *
  135. acpi_ps_get_next_namestring (
  136. struct acpi_parse_state *parser_state)
  137. {
  138. u8 *start = parser_state->aml;
  139. u8 *end = parser_state->aml;
  140. ACPI_FUNCTION_TRACE ("ps_get_next_namestring");
  141. /* Handle multiple prefix characters */
  142. while (acpi_ps_is_prefix_char (ACPI_GET8 (end))) {
  143. /* Include prefix '\\' or '^' */
  144. end++;
  145. }
  146. /* Decode the path */
  147. switch (ACPI_GET8 (end)) {
  148. case 0:
  149. /* null_name */
  150. if (end == start) {
  151. start = NULL;
  152. }
  153. end++;
  154. break;
  155. case AML_DUAL_NAME_PREFIX:
  156. /* Two name segments */
  157. end += 1 + (2 * ACPI_NAME_SIZE);
  158. break;
  159. case AML_MULTI_NAME_PREFIX_OP:
  160. /* Multiple name segments, 4 chars each */
  161. end += 2 + ((acpi_size) ACPI_GET8 (end + 1) * ACPI_NAME_SIZE);
  162. break;
  163. default:
  164. /* Single name segment */
  165. end += ACPI_NAME_SIZE;
  166. break;
  167. }
  168. parser_state->aml = (u8*) end;
  169. return_PTR ((char *) start);
  170. }
  171. /*******************************************************************************
  172. *
  173. * FUNCTION: acpi_ps_get_next_namepath
  174. *
  175. * PARAMETERS: parser_state - Current parser state object
  176. * Arg - Where the namepath will be stored
  177. * arg_count - If the namepath points to a control method
  178. * the method's argument is returned here.
  179. * method_call - Whether the namepath can possibly be the
  180. * start of a method call
  181. *
  182. * RETURN: Status
  183. *
  184. * DESCRIPTION: Get next name (if method call, return # of required args).
  185. * Names are looked up in the internal namespace to determine
  186. * if the name represents a control method. If a method
  187. * is found, the number of arguments to the method is returned.
  188. * This information is critical for parsing to continue correctly.
  189. *
  190. ******************************************************************************/
  191. acpi_status
  192. acpi_ps_get_next_namepath (
  193. struct acpi_walk_state *walk_state,
  194. struct acpi_parse_state *parser_state,
  195. union acpi_parse_object *arg,
  196. u8 method_call)
  197. {
  198. char *path;
  199. union acpi_parse_object *name_op;
  200. acpi_status status = AE_OK;
  201. union acpi_operand_object *method_desc;
  202. struct acpi_namespace_node *node;
  203. union acpi_generic_state scope_info;
  204. ACPI_FUNCTION_TRACE ("ps_get_next_namepath");
  205. path = acpi_ps_get_next_namestring (parser_state);
  206. /* Null path case is allowed */
  207. if (path) {
  208. /*
  209. * Lookup the name in the internal namespace
  210. */
  211. scope_info.scope.node = NULL;
  212. node = parser_state->start_node;
  213. if (node) {
  214. scope_info.scope.node = node;
  215. }
  216. /*
  217. * Lookup object. We don't want to add anything new to the namespace
  218. * here, however. So we use MODE_EXECUTE. Allow searching of the
  219. * parent tree, but don't open a new scope -- we just want to lookup the
  220. * object (MUST BE mode EXECUTE to perform upsearch)
  221. */
  222. status = acpi_ns_lookup (&scope_info, path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
  223. ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &node);
  224. if (ACPI_SUCCESS (status) && method_call) {
  225. if (node->type == ACPI_TYPE_METHOD) {
  226. /*
  227. * This name is actually a control method invocation
  228. */
  229. method_desc = acpi_ns_get_attached_object (node);
  230. ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
  231. "Control Method - %p Desc %p Path=%p\n",
  232. node, method_desc, path));
  233. name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
  234. if (!name_op) {
  235. return_ACPI_STATUS (AE_NO_MEMORY);
  236. }
  237. /* Change arg into a METHOD CALL and attach name to it */
  238. acpi_ps_init_op (arg, AML_INT_METHODCALL_OP);
  239. name_op->common.value.name = path;
  240. /* Point METHODCALL/NAME to the METHOD Node */
  241. name_op->common.node = node;
  242. acpi_ps_append_arg (arg, name_op);
  243. if (!method_desc) {
  244. ACPI_REPORT_ERROR ((
  245. "ps_get_next_namepath: Control Method %p has no attached object\n",
  246. node));
  247. return_ACPI_STATUS (AE_AML_INTERNAL);
  248. }
  249. ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
  250. "Control Method - %p Args %X\n",
  251. node, method_desc->method.param_count));
  252. /* Get the number of arguments to expect */
  253. walk_state->arg_count = method_desc->method.param_count;
  254. return_ACPI_STATUS (AE_OK);
  255. }
  256. /*
  257. * Else this is normal named object reference.
  258. * Just init the NAMEPATH object with the pathname.
  259. * (See code below)
  260. */
  261. }
  262. if (ACPI_FAILURE (status)) {
  263. /*
  264. * 1) Any error other than NOT_FOUND is always severe
  265. * 2) NOT_FOUND is only important if we are executing a method.
  266. * 3) If executing a cond_ref_of opcode, NOT_FOUND is ok.
  267. */
  268. if ((((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) &&
  269. (status == AE_NOT_FOUND) &&
  270. (walk_state->op->common.aml_opcode != AML_COND_REF_OF_OP)) ||
  271. (status != AE_NOT_FOUND)) {
  272. ACPI_REPORT_NSERROR (path, status);
  273. acpi_os_printf ("search_node %p start_node %p return_node %p\n",
  274. scope_info.scope.node, parser_state->start_node, node);
  275. }
  276. else {
  277. /*
  278. * We got a NOT_FOUND during table load or we encountered
  279. * a cond_ref_of(x) where the target does not exist.
  280. * -- either case is ok
  281. */
  282. status = AE_OK;
  283. }
  284. }
  285. }
  286. /*
  287. * Regardless of success/failure above,
  288. * Just initialize the Op with the pathname.
  289. */
  290. acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
  291. arg->common.value.name = path;
  292. return_ACPI_STATUS (status);
  293. }
  294. /*******************************************************************************
  295. *
  296. * FUNCTION: acpi_ps_get_next_simple_arg
  297. *
  298. * PARAMETERS: parser_state - Current parser state object
  299. * arg_type - The argument type (AML_*_ARG)
  300. * Arg - Where the argument is returned
  301. *
  302. * RETURN: None
  303. *
  304. * DESCRIPTION: Get the next simple argument (constant, string, or namestring)
  305. *
  306. ******************************************************************************/
  307. void
  308. acpi_ps_get_next_simple_arg (
  309. struct acpi_parse_state *parser_state,
  310. u32 arg_type,
  311. union acpi_parse_object *arg)
  312. {
  313. ACPI_FUNCTION_TRACE_U32 ("ps_get_next_simple_arg", arg_type);
  314. switch (arg_type) {
  315. case ARGP_BYTEDATA:
  316. acpi_ps_init_op (arg, AML_BYTE_OP);
  317. arg->common.value.integer = (u32) ACPI_GET8 (parser_state->aml);
  318. parser_state->aml++;
  319. break;
  320. case ARGP_WORDDATA:
  321. acpi_ps_init_op (arg, AML_WORD_OP);
  322. /* Get 2 bytes from the AML stream */
  323. ACPI_MOVE_16_TO_32 (&arg->common.value.integer, parser_state->aml);
  324. parser_state->aml += 2;
  325. break;
  326. case ARGP_DWORDDATA:
  327. acpi_ps_init_op (arg, AML_DWORD_OP);
  328. /* Get 4 bytes from the AML stream */
  329. ACPI_MOVE_32_TO_32 (&arg->common.value.integer, parser_state->aml);
  330. parser_state->aml += 4;
  331. break;
  332. case ARGP_QWORDDATA:
  333. acpi_ps_init_op (arg, AML_QWORD_OP);
  334. /* Get 8 bytes from the AML stream */
  335. ACPI_MOVE_64_TO_64 (&arg->common.value.integer, parser_state->aml);
  336. parser_state->aml += 8;
  337. break;
  338. case ARGP_CHARLIST:
  339. acpi_ps_init_op (arg, AML_STRING_OP);
  340. arg->common.value.string = (char *) parser_state->aml;
  341. while (ACPI_GET8 (parser_state->aml) != '\0') {
  342. parser_state->aml++;
  343. }
  344. parser_state->aml++;
  345. break;
  346. case ARGP_NAME:
  347. case ARGP_NAMESTRING:
  348. acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
  349. arg->common.value.name = acpi_ps_get_next_namestring (parser_state);
  350. break;
  351. default:
  352. ACPI_REPORT_ERROR (("Invalid arg_type %X\n", arg_type));
  353. break;
  354. }
  355. return_VOID;
  356. }
  357. /*******************************************************************************
  358. *
  359. * FUNCTION: acpi_ps_get_next_field
  360. *
  361. * PARAMETERS: parser_state - Current parser state object
  362. *
  363. * RETURN: A newly allocated FIELD op
  364. *
  365. * DESCRIPTION: Get next field (named_field, reserved_field, or access_field)
  366. *
  367. ******************************************************************************/
  368. union acpi_parse_object *
  369. acpi_ps_get_next_field (
  370. struct acpi_parse_state *parser_state)
  371. {
  372. u32 aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
  373. parser_state->aml_start);
  374. union acpi_parse_object *field;
  375. u16 opcode;
  376. u32 name;
  377. ACPI_FUNCTION_TRACE ("ps_get_next_field");
  378. /* determine field type */
  379. switch (ACPI_GET8 (parser_state->aml)) {
  380. default:
  381. opcode = AML_INT_NAMEDFIELD_OP;
  382. break;
  383. case 0x00:
  384. opcode = AML_INT_RESERVEDFIELD_OP;
  385. parser_state->aml++;
  386. break;
  387. case 0x01:
  388. opcode = AML_INT_ACCESSFIELD_OP;
  389. parser_state->aml++;
  390. break;
  391. }
  392. /* Allocate a new field op */
  393. field = acpi_ps_alloc_op (opcode);
  394. if (!field) {
  395. return_PTR (NULL);
  396. }
  397. field->common.aml_offset = aml_offset;
  398. /* Decode the field type */
  399. switch (opcode) {
  400. case AML_INT_NAMEDFIELD_OP:
  401. /* Get the 4-character name */
  402. ACPI_MOVE_32_TO_32 (&name, parser_state->aml);
  403. acpi_ps_set_name (field, name);
  404. parser_state->aml += ACPI_NAME_SIZE;
  405. /* Get the length which is encoded as a package length */
  406. field->common.value.size = acpi_ps_get_next_package_length (parser_state);
  407. break;
  408. case AML_INT_RESERVEDFIELD_OP:
  409. /* Get the length which is encoded as a package length */
  410. field->common.value.size = acpi_ps_get_next_package_length (parser_state);
  411. break;
  412. case AML_INT_ACCESSFIELD_OP:
  413. /*
  414. * Get access_type and access_attrib and merge into the field Op
  415. * access_type is first operand, access_attribute is second
  416. */
  417. field->common.value.integer = (ACPI_GET8 (parser_state->aml) << 8);
  418. parser_state->aml++;
  419. field->common.value.integer |= ACPI_GET8 (parser_state->aml);
  420. parser_state->aml++;
  421. break;
  422. default:
  423. /* Opcode was set in previous switch */
  424. break;
  425. }
  426. return_PTR (field);
  427. }
  428. /*******************************************************************************
  429. *
  430. * FUNCTION: acpi_ps_get_next_arg
  431. *
  432. * PARAMETERS: parser_state - Current parser state object
  433. * arg_type - The argument type (AML_*_ARG)
  434. * arg_count - If the argument points to a control method
  435. * the method's argument is returned here.
  436. *
  437. * RETURN: Status, and an op object containing the next argument.
  438. *
  439. * DESCRIPTION: Get next argument (including complex list arguments that require
  440. * pushing the parser stack)
  441. *
  442. ******************************************************************************/
  443. acpi_status
  444. acpi_ps_get_next_arg (
  445. struct acpi_walk_state *walk_state,
  446. struct acpi_parse_state *parser_state,
  447. u32 arg_type,
  448. union acpi_parse_object **return_arg)
  449. {
  450. union acpi_parse_object *arg = NULL;
  451. union acpi_parse_object *prev = NULL;
  452. union acpi_parse_object *field;
  453. u32 subop;
  454. acpi_status status = AE_OK;
  455. ACPI_FUNCTION_TRACE_PTR ("ps_get_next_arg", parser_state);
  456. switch (arg_type) {
  457. case ARGP_BYTEDATA:
  458. case ARGP_WORDDATA:
  459. case ARGP_DWORDDATA:
  460. case ARGP_CHARLIST:
  461. case ARGP_NAME:
  462. case ARGP_NAMESTRING:
  463. /* constants, strings, and namestrings are all the same size */
  464. arg = acpi_ps_alloc_op (AML_BYTE_OP);
  465. if (!arg) {
  466. return_ACPI_STATUS (AE_NO_MEMORY);
  467. }
  468. acpi_ps_get_next_simple_arg (parser_state, arg_type, arg);
  469. break;
  470. case ARGP_PKGLENGTH:
  471. /* Package length, nothing returned */
  472. parser_state->pkg_end = acpi_ps_get_next_package_end (parser_state);
  473. break;
  474. case ARGP_FIELDLIST:
  475. if (parser_state->aml < parser_state->pkg_end) {
  476. /* Non-empty list */
  477. while (parser_state->aml < parser_state->pkg_end) {
  478. field = acpi_ps_get_next_field (parser_state);
  479. if (!field) {
  480. return_ACPI_STATUS (AE_NO_MEMORY);
  481. }
  482. if (prev) {
  483. prev->common.next = field;
  484. }
  485. else {
  486. arg = field;
  487. }
  488. prev = field;
  489. }
  490. /* Skip to End of byte data */
  491. parser_state->aml = parser_state->pkg_end;
  492. }
  493. break;
  494. case ARGP_BYTELIST:
  495. if (parser_state->aml < parser_state->pkg_end) {
  496. /* Non-empty list */
  497. arg = acpi_ps_alloc_op (AML_INT_BYTELIST_OP);
  498. if (!arg) {
  499. return_ACPI_STATUS (AE_NO_MEMORY);
  500. }
  501. /* Fill in bytelist data */
  502. arg->common.value.size = (u32) ACPI_PTR_DIFF (parser_state->pkg_end,
  503. parser_state->aml);
  504. arg->named.data = parser_state->aml;
  505. /* Skip to End of byte data */
  506. parser_state->aml = parser_state->pkg_end;
  507. }
  508. break;
  509. case ARGP_TARGET:
  510. case ARGP_SUPERNAME:
  511. case ARGP_SIMPLENAME:
  512. subop = acpi_ps_peek_opcode (parser_state);
  513. if (subop == 0 ||
  514. acpi_ps_is_leading_char (subop) ||
  515. acpi_ps_is_prefix_char (subop)) {
  516. /* null_name or name_string */
  517. arg = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
  518. if (!arg) {
  519. return_ACPI_STATUS (AE_NO_MEMORY);
  520. }
  521. status = acpi_ps_get_next_namepath (walk_state, parser_state, arg, 0);
  522. }
  523. else {
  524. /* single complex argument, nothing returned */
  525. walk_state->arg_count = 1;
  526. }
  527. break;
  528. case ARGP_DATAOBJ:
  529. case ARGP_TERMARG:
  530. /* single complex argument, nothing returned */
  531. walk_state->arg_count = 1;
  532. break;
  533. case ARGP_DATAOBJLIST:
  534. case ARGP_TERMLIST:
  535. case ARGP_OBJLIST:
  536. if (parser_state->aml < parser_state->pkg_end) {
  537. /* non-empty list of variable arguments, nothing returned */
  538. walk_state->arg_count = ACPI_VAR_ARGS;
  539. }
  540. break;
  541. default:
  542. ACPI_REPORT_ERROR (("Invalid arg_type: %X\n", arg_type));
  543. status = AE_AML_OPERAND_TYPE;
  544. break;
  545. }
  546. *return_arg = arg;
  547. return_ACPI_STATUS (status);
  548. }