psargs.c 19 KB

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