psargs.c 19 KB

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