psargs.c 18 KB

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