utobject.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. /******************************************************************************
  2. *
  3. * Module Name: utobject - ACPI object create/delete/size/cache routines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2017, 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 "accommon.h"
  44. #include "acnamesp.h"
  45. #define _COMPONENT ACPI_UTILITIES
  46. ACPI_MODULE_NAME("utobject")
  47. /* Local prototypes */
  48. static acpi_status
  49. acpi_ut_get_simple_object_size(union acpi_operand_object *obj,
  50. acpi_size *obj_length);
  51. static acpi_status
  52. acpi_ut_get_package_object_size(union acpi_operand_object *obj,
  53. acpi_size *obj_length);
  54. static acpi_status
  55. acpi_ut_get_element_length(u8 object_type,
  56. union acpi_operand_object *source_object,
  57. union acpi_generic_state *state, void *context);
  58. /*******************************************************************************
  59. *
  60. * FUNCTION: acpi_ut_create_internal_object_dbg
  61. *
  62. * PARAMETERS: module_name - Source file name of caller
  63. * line_number - Line number of caller
  64. * component_id - Component type of caller
  65. * type - ACPI Type of the new object
  66. *
  67. * RETURN: A new internal object, null on failure
  68. *
  69. * DESCRIPTION: Create and initialize a new internal object.
  70. *
  71. * NOTE: We always allocate the worst-case object descriptor because
  72. * these objects are cached, and we want them to be
  73. * one-size-satisifies-any-request. This in itself may not be
  74. * the most memory efficient, but the efficiency of the object
  75. * cache should more than make up for this!
  76. *
  77. ******************************************************************************/
  78. union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
  79. *module_name,
  80. u32 line_number,
  81. u32 component_id,
  82. acpi_object_type
  83. type)
  84. {
  85. union acpi_operand_object *object;
  86. union acpi_operand_object *second_object;
  87. ACPI_FUNCTION_TRACE_STR(ut_create_internal_object_dbg,
  88. acpi_ut_get_type_name(type));
  89. /* Allocate the raw object descriptor */
  90. object =
  91. acpi_ut_allocate_object_desc_dbg(module_name, line_number,
  92. component_id);
  93. if (!object) {
  94. return_PTR(NULL);
  95. }
  96. switch (type) {
  97. case ACPI_TYPE_REGION:
  98. case ACPI_TYPE_BUFFER_FIELD:
  99. case ACPI_TYPE_LOCAL_BANK_FIELD:
  100. /* These types require a secondary object */
  101. second_object =
  102. acpi_ut_allocate_object_desc_dbg(module_name, line_number,
  103. component_id);
  104. if (!second_object) {
  105. acpi_ut_delete_object_desc(object);
  106. return_PTR(NULL);
  107. }
  108. second_object->common.type = ACPI_TYPE_LOCAL_EXTRA;
  109. second_object->common.reference_count = 1;
  110. /* Link the second object to the first */
  111. object->common.next_object = second_object;
  112. break;
  113. default:
  114. /* All others have no secondary object */
  115. break;
  116. }
  117. /* Save the object type in the object descriptor */
  118. object->common.type = (u8) type;
  119. /* Init the reference count */
  120. object->common.reference_count = 1;
  121. /* Any per-type initialization should go here */
  122. return_PTR(object);
  123. }
  124. /*******************************************************************************
  125. *
  126. * FUNCTION: acpi_ut_create_package_object
  127. *
  128. * PARAMETERS: count - Number of package elements
  129. *
  130. * RETURN: Pointer to a new Package object, null on failure
  131. *
  132. * DESCRIPTION: Create a fully initialized package object
  133. *
  134. ******************************************************************************/
  135. union acpi_operand_object *acpi_ut_create_package_object(u32 count)
  136. {
  137. union acpi_operand_object *package_desc;
  138. union acpi_operand_object **package_elements;
  139. ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);
  140. /* Create a new Package object */
  141. package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
  142. if (!package_desc) {
  143. return_PTR(NULL);
  144. }
  145. /*
  146. * Create the element array. Count+1 allows the array to be null
  147. * terminated.
  148. */
  149. package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size)count +
  150. 1) * sizeof(void *));
  151. if (!package_elements) {
  152. ACPI_FREE(package_desc);
  153. return_PTR(NULL);
  154. }
  155. package_desc->package.count = count;
  156. package_desc->package.elements = package_elements;
  157. return_PTR(package_desc);
  158. }
  159. /*******************************************************************************
  160. *
  161. * FUNCTION: acpi_ut_create_integer_object
  162. *
  163. * PARAMETERS: initial_value - Initial value for the integer
  164. *
  165. * RETURN: Pointer to a new Integer object, null on failure
  166. *
  167. * DESCRIPTION: Create an initialized integer object
  168. *
  169. ******************************************************************************/
  170. union acpi_operand_object *acpi_ut_create_integer_object(u64 initial_value)
  171. {
  172. union acpi_operand_object *integer_desc;
  173. ACPI_FUNCTION_TRACE(ut_create_integer_object);
  174. /* Create and initialize a new integer object */
  175. integer_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
  176. if (!integer_desc) {
  177. return_PTR(NULL);
  178. }
  179. integer_desc->integer.value = initial_value;
  180. return_PTR(integer_desc);
  181. }
  182. /*******************************************************************************
  183. *
  184. * FUNCTION: acpi_ut_create_buffer_object
  185. *
  186. * PARAMETERS: buffer_size - Size of buffer to be created
  187. *
  188. * RETURN: Pointer to a new Buffer object, null on failure
  189. *
  190. * DESCRIPTION: Create a fully initialized buffer object
  191. *
  192. ******************************************************************************/
  193. union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
  194. {
  195. union acpi_operand_object *buffer_desc;
  196. u8 *buffer = NULL;
  197. ACPI_FUNCTION_TRACE_U32(ut_create_buffer_object, buffer_size);
  198. /* Create a new Buffer object */
  199. buffer_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER);
  200. if (!buffer_desc) {
  201. return_PTR(NULL);
  202. }
  203. /* Create an actual buffer only if size > 0 */
  204. if (buffer_size > 0) {
  205. /* Allocate the actual buffer */
  206. buffer = ACPI_ALLOCATE_ZEROED(buffer_size);
  207. if (!buffer) {
  208. ACPI_ERROR((AE_INFO, "Could not allocate size %u",
  209. (u32)buffer_size));
  210. acpi_ut_remove_reference(buffer_desc);
  211. return_PTR(NULL);
  212. }
  213. }
  214. /* Complete buffer object initialization */
  215. buffer_desc->buffer.flags |= AOPOBJ_DATA_VALID;
  216. buffer_desc->buffer.pointer = buffer;
  217. buffer_desc->buffer.length = (u32) buffer_size;
  218. /* Return the new buffer descriptor */
  219. return_PTR(buffer_desc);
  220. }
  221. /*******************************************************************************
  222. *
  223. * FUNCTION: acpi_ut_create_string_object
  224. *
  225. * PARAMETERS: string_size - Size of string to be created. Does not
  226. * include NULL terminator, this is added
  227. * automatically.
  228. *
  229. * RETURN: Pointer to a new String object
  230. *
  231. * DESCRIPTION: Create a fully initialized string object
  232. *
  233. ******************************************************************************/
  234. union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
  235. {
  236. union acpi_operand_object *string_desc;
  237. char *string;
  238. ACPI_FUNCTION_TRACE_U32(ut_create_string_object, string_size);
  239. /* Create a new String object */
  240. string_desc = acpi_ut_create_internal_object(ACPI_TYPE_STRING);
  241. if (!string_desc) {
  242. return_PTR(NULL);
  243. }
  244. /*
  245. * Allocate the actual string buffer -- (Size + 1) for NULL terminator.
  246. * NOTE: Zero-length strings are NULL terminated
  247. */
  248. string = ACPI_ALLOCATE_ZEROED(string_size + 1);
  249. if (!string) {
  250. ACPI_ERROR((AE_INFO, "Could not allocate size %u",
  251. (u32)string_size));
  252. acpi_ut_remove_reference(string_desc);
  253. return_PTR(NULL);
  254. }
  255. /* Complete string object initialization */
  256. string_desc->string.pointer = string;
  257. string_desc->string.length = (u32) string_size;
  258. /* Return the new string descriptor */
  259. return_PTR(string_desc);
  260. }
  261. /*******************************************************************************
  262. *
  263. * FUNCTION: acpi_ut_valid_internal_object
  264. *
  265. * PARAMETERS: object - Object to be validated
  266. *
  267. * RETURN: TRUE if object is valid, FALSE otherwise
  268. *
  269. * DESCRIPTION: Validate a pointer to be of type union acpi_operand_object
  270. *
  271. ******************************************************************************/
  272. u8 acpi_ut_valid_internal_object(void *object)
  273. {
  274. ACPI_FUNCTION_NAME(ut_valid_internal_object);
  275. /* Check for a null pointer */
  276. if (!object) {
  277. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "**** Null Object Ptr\n"));
  278. return (FALSE);
  279. }
  280. /* Check the descriptor type field */
  281. switch (ACPI_GET_DESCRIPTOR_TYPE(object)) {
  282. case ACPI_DESC_TYPE_OPERAND:
  283. /* The object appears to be a valid union acpi_operand_object */
  284. return (TRUE);
  285. default:
  286. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  287. "%p is not an ACPI operand obj [%s]\n",
  288. object, acpi_ut_get_descriptor_name(object)));
  289. break;
  290. }
  291. return (FALSE);
  292. }
  293. /*******************************************************************************
  294. *
  295. * FUNCTION: acpi_ut_allocate_object_desc_dbg
  296. *
  297. * PARAMETERS: module_name - Caller's module name (for error output)
  298. * line_number - Caller's line number (for error output)
  299. * component_id - Caller's component ID (for error output)
  300. *
  301. * RETURN: Pointer to newly allocated object descriptor. Null on error
  302. *
  303. * DESCRIPTION: Allocate a new object descriptor. Gracefully handle
  304. * error conditions.
  305. *
  306. ******************************************************************************/
  307. void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
  308. u32 line_number, u32 component_id)
  309. {
  310. union acpi_operand_object *object;
  311. ACPI_FUNCTION_TRACE(ut_allocate_object_desc_dbg);
  312. object = acpi_os_acquire_object(acpi_gbl_operand_cache);
  313. if (!object) {
  314. ACPI_ERROR((module_name, line_number,
  315. "Could not allocate an object descriptor"));
  316. return_PTR(NULL);
  317. }
  318. /* Mark the descriptor type */
  319. ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND);
  320. ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
  321. object, (u32) sizeof(union acpi_operand_object)));
  322. return_PTR(object);
  323. }
  324. /*******************************************************************************
  325. *
  326. * FUNCTION: acpi_ut_delete_object_desc
  327. *
  328. * PARAMETERS: object - An Acpi internal object to be deleted
  329. *
  330. * RETURN: None.
  331. *
  332. * DESCRIPTION: Free an ACPI object descriptor or add it to the object cache
  333. *
  334. ******************************************************************************/
  335. void acpi_ut_delete_object_desc(union acpi_operand_object *object)
  336. {
  337. ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object);
  338. /* Object must be of type union acpi_operand_object */
  339. if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) {
  340. ACPI_ERROR((AE_INFO,
  341. "%p is not an ACPI Operand object [%s]", object,
  342. acpi_ut_get_descriptor_name(object)));
  343. return_VOID;
  344. }
  345. (void)acpi_os_release_object(acpi_gbl_operand_cache, object);
  346. return_VOID;
  347. }
  348. /*******************************************************************************
  349. *
  350. * FUNCTION: acpi_ut_get_simple_object_size
  351. *
  352. * PARAMETERS: internal_object - An ACPI operand object
  353. * obj_length - Where the length is returned
  354. *
  355. * RETURN: Status
  356. *
  357. * DESCRIPTION: This function is called to determine the space required to
  358. * contain a simple object for return to an external user.
  359. *
  360. * The length includes the object structure plus any additional
  361. * needed space.
  362. *
  363. ******************************************************************************/
  364. static acpi_status
  365. acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
  366. acpi_size *obj_length)
  367. {
  368. acpi_size length;
  369. acpi_size size;
  370. acpi_status status = AE_OK;
  371. ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object);
  372. /* Start with the length of the (external) Acpi object */
  373. length = sizeof(union acpi_object);
  374. /* A NULL object is allowed, can be a legal uninitialized package element */
  375. if (!internal_object) {
  376. /*
  377. * Object is NULL, just return the length of union acpi_object
  378. * (A NULL union acpi_object is an object of all zeroes.)
  379. */
  380. *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length);
  381. return_ACPI_STATUS(AE_OK);
  382. }
  383. /* A Namespace Node should never appear here */
  384. if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) {
  385. /* A namespace node should never get here */
  386. ACPI_ERROR((AE_INFO,
  387. "Received a namespace node [%4.4s] "
  388. "where an operand object is required",
  389. ACPI_CAST_PTR(struct acpi_namespace_node,
  390. internal_object)->name.ascii));
  391. return_ACPI_STATUS(AE_AML_INTERNAL);
  392. }
  393. /*
  394. * The final length depends on the object type
  395. * Strings and Buffers are packed right up against the parent object and
  396. * must be accessed bytewise or there may be alignment problems on
  397. * certain processors
  398. */
  399. switch (internal_object->common.type) {
  400. case ACPI_TYPE_STRING:
  401. length += (acpi_size)internal_object->string.length + 1;
  402. break;
  403. case ACPI_TYPE_BUFFER:
  404. length += (acpi_size)internal_object->buffer.length;
  405. break;
  406. case ACPI_TYPE_INTEGER:
  407. case ACPI_TYPE_PROCESSOR:
  408. case ACPI_TYPE_POWER:
  409. /* No extra data for these types */
  410. break;
  411. case ACPI_TYPE_LOCAL_REFERENCE:
  412. switch (internal_object->reference.class) {
  413. case ACPI_REFCLASS_NAME:
  414. /*
  415. * Get the actual length of the full pathname to this object.
  416. * The reference will be converted to the pathname to the object
  417. */
  418. size =
  419. acpi_ns_get_pathname_length(internal_object->
  420. reference.node);
  421. if (!size) {
  422. return_ACPI_STATUS(AE_BAD_PARAMETER);
  423. }
  424. length += ACPI_ROUND_UP_TO_NATIVE_WORD(size);
  425. break;
  426. default:
  427. /*
  428. * No other reference opcodes are supported.
  429. * Notably, Locals and Args are not supported, but this may be
  430. * required eventually.
  431. */
  432. ACPI_ERROR((AE_INFO,
  433. "Cannot convert to external object - "
  434. "unsupported Reference Class [%s] 0x%X in object %p",
  435. acpi_ut_get_reference_name(internal_object),
  436. internal_object->reference.class,
  437. internal_object));
  438. status = AE_TYPE;
  439. break;
  440. }
  441. break;
  442. default:
  443. ACPI_ERROR((AE_INFO, "Cannot convert to external object - "
  444. "unsupported type [%s] 0x%X in object %p",
  445. acpi_ut_get_object_type_name(internal_object),
  446. internal_object->common.type, internal_object));
  447. status = AE_TYPE;
  448. break;
  449. }
  450. /*
  451. * Account for the space required by the object rounded up to the next
  452. * multiple of the machine word size. This keeps each object aligned
  453. * on a machine word boundary. (preventing alignment faults on some
  454. * machines.)
  455. */
  456. *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length);
  457. return_ACPI_STATUS(status);
  458. }
  459. /*******************************************************************************
  460. *
  461. * FUNCTION: acpi_ut_get_element_length
  462. *
  463. * PARAMETERS: acpi_pkg_callback
  464. *
  465. * RETURN: Status
  466. *
  467. * DESCRIPTION: Get the length of one package element.
  468. *
  469. ******************************************************************************/
  470. static acpi_status
  471. acpi_ut_get_element_length(u8 object_type,
  472. union acpi_operand_object *source_object,
  473. union acpi_generic_state *state, void *context)
  474. {
  475. acpi_status status = AE_OK;
  476. struct acpi_pkg_info *info = (struct acpi_pkg_info *)context;
  477. acpi_size object_space;
  478. switch (object_type) {
  479. case ACPI_COPY_TYPE_SIMPLE:
  480. /*
  481. * Simple object - just get the size (Null object/entry is handled
  482. * here also) and sum it into the running package length
  483. */
  484. status =
  485. acpi_ut_get_simple_object_size(source_object,
  486. &object_space);
  487. if (ACPI_FAILURE(status)) {
  488. return (status);
  489. }
  490. info->length += object_space;
  491. break;
  492. case ACPI_COPY_TYPE_PACKAGE:
  493. /* Package object - nothing much to do here, let the walk handle it */
  494. info->num_packages++;
  495. state->pkg.this_target_obj = NULL;
  496. break;
  497. default:
  498. /* No other types allowed */
  499. return (AE_BAD_PARAMETER);
  500. }
  501. return (status);
  502. }
  503. /*******************************************************************************
  504. *
  505. * FUNCTION: acpi_ut_get_package_object_size
  506. *
  507. * PARAMETERS: internal_object - An ACPI internal object
  508. * obj_length - Where the length is returned
  509. *
  510. * RETURN: Status
  511. *
  512. * DESCRIPTION: This function is called to determine the space required to
  513. * contain a package object for return to an external user.
  514. *
  515. * This is moderately complex since a package contains other
  516. * objects including packages.
  517. *
  518. ******************************************************************************/
  519. static acpi_status
  520. acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
  521. acpi_size *obj_length)
  522. {
  523. acpi_status status;
  524. struct acpi_pkg_info info;
  525. ACPI_FUNCTION_TRACE_PTR(ut_get_package_object_size, internal_object);
  526. info.length = 0;
  527. info.object_space = 0;
  528. info.num_packages = 1;
  529. status =
  530. acpi_ut_walk_package_tree(internal_object, NULL,
  531. acpi_ut_get_element_length, &info);
  532. if (ACPI_FAILURE(status)) {
  533. return_ACPI_STATUS(status);
  534. }
  535. /*
  536. * We have handled all of the objects in all levels of the package.
  537. * just add the length of the package objects themselves.
  538. * Round up to the next machine word.
  539. */
  540. info.length +=
  541. ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) *
  542. (acpi_size)info.num_packages;
  543. /* Return the total package length */
  544. *obj_length = info.length;
  545. return_ACPI_STATUS(status);
  546. }
  547. /*******************************************************************************
  548. *
  549. * FUNCTION: acpi_ut_get_object_size
  550. *
  551. * PARAMETERS: internal_object - An ACPI internal object
  552. * obj_length - Where the length will be returned
  553. *
  554. * RETURN: Status
  555. *
  556. * DESCRIPTION: This function is called to determine the space required to
  557. * contain an object for return to an API user.
  558. *
  559. ******************************************************************************/
  560. acpi_status
  561. acpi_ut_get_object_size(union acpi_operand_object *internal_object,
  562. acpi_size *obj_length)
  563. {
  564. acpi_status status;
  565. ACPI_FUNCTION_ENTRY();
  566. if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
  567. ACPI_DESC_TYPE_OPERAND) &&
  568. (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
  569. status =
  570. acpi_ut_get_package_object_size(internal_object,
  571. obj_length);
  572. } else {
  573. status =
  574. acpi_ut_get_simple_object_size(internal_object, obj_length);
  575. }
  576. return (status);
  577. }