nsdump.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. /******************************************************************************
  2. *
  3. * Module Name: nsdump - table dumping routines for debug
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2008, 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 <acpi/acnamesp.h>
  44. #include <acpi/acparser.h>
  45. #define _COMPONENT ACPI_NAMESPACE
  46. ACPI_MODULE_NAME("nsdump")
  47. /* Local prototypes */
  48. #ifdef ACPI_OBSOLETE_FUNCTIONS
  49. void acpi_ns_dump_root_devices(void);
  50. static acpi_status
  51. acpi_ns_dump_one_device(acpi_handle obj_handle,
  52. u32 level, void *context, void **return_value);
  53. #endif
  54. #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
  55. /*******************************************************************************
  56. *
  57. * FUNCTION: acpi_ns_print_pathname
  58. *
  59. * PARAMETERS: num_segments - Number of ACPI name segments
  60. * Pathname - The compressed (internal) path
  61. *
  62. * RETURN: None
  63. *
  64. * DESCRIPTION: Print an object's full namespace pathname
  65. *
  66. ******************************************************************************/
  67. void acpi_ns_print_pathname(u32 num_segments, char *pathname)
  68. {
  69. u32 i;
  70. ACPI_FUNCTION_NAME(ns_print_pathname);
  71. if (!(acpi_dbg_level & ACPI_LV_NAMES)
  72. || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
  73. return;
  74. }
  75. /* Print the entire name */
  76. ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "["));
  77. while (num_segments) {
  78. for (i = 0; i < 4; i++) {
  79. ACPI_IS_PRINT(pathname[i]) ?
  80. acpi_os_printf("%c", pathname[i]) :
  81. acpi_os_printf("?");
  82. }
  83. pathname += ACPI_NAME_SIZE;
  84. num_segments--;
  85. if (num_segments) {
  86. acpi_os_printf(".");
  87. }
  88. }
  89. acpi_os_printf("]\n");
  90. }
  91. /*******************************************************************************
  92. *
  93. * FUNCTION: acpi_ns_dump_pathname
  94. *
  95. * PARAMETERS: Handle - Object
  96. * Msg - Prefix message
  97. * Level - Desired debug level
  98. * Component - Caller's component ID
  99. *
  100. * RETURN: None
  101. *
  102. * DESCRIPTION: Print an object's full namespace pathname
  103. * Manages allocation/freeing of a pathname buffer
  104. *
  105. ******************************************************************************/
  106. void
  107. acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
  108. {
  109. ACPI_FUNCTION_TRACE(ns_dump_pathname);
  110. /* Do this only if the requested debug level and component are enabled */
  111. if (!(acpi_dbg_level & level) || !(acpi_dbg_layer & component)) {
  112. return_VOID;
  113. }
  114. /* Convert handle to a full pathname and print it (with supplied message) */
  115. acpi_ns_print_node_pathname(handle, msg);
  116. acpi_os_printf("\n");
  117. return_VOID;
  118. }
  119. /*******************************************************************************
  120. *
  121. * FUNCTION: acpi_ns_dump_one_object
  122. *
  123. * PARAMETERS: obj_handle - Node to be dumped
  124. * Level - Nesting level of the handle
  125. * Context - Passed into walk_namespace
  126. * return_value - Not used
  127. *
  128. * RETURN: Status
  129. *
  130. * DESCRIPTION: Dump a single Node
  131. * This procedure is a user_function called by acpi_ns_walk_namespace.
  132. *
  133. ******************************************************************************/
  134. acpi_status
  135. acpi_ns_dump_one_object(acpi_handle obj_handle,
  136. u32 level, void *context, void **return_value)
  137. {
  138. struct acpi_walk_info *info = (struct acpi_walk_info *)context;
  139. struct acpi_namespace_node *this_node;
  140. union acpi_operand_object *obj_desc = NULL;
  141. acpi_object_type obj_type;
  142. acpi_object_type type;
  143. u32 bytes_to_dump;
  144. u32 dbg_level;
  145. u32 i;
  146. ACPI_FUNCTION_NAME(ns_dump_one_object);
  147. /* Is output enabled? */
  148. if (!(acpi_dbg_level & info->debug_level)) {
  149. return (AE_OK);
  150. }
  151. if (!obj_handle) {
  152. ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Null object handle\n"));
  153. return (AE_OK);
  154. }
  155. this_node = acpi_ns_map_handle_to_node(obj_handle);
  156. type = this_node->type;
  157. /* Check if the owner matches */
  158. if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
  159. (info->owner_id != this_node->owner_id)) {
  160. return (AE_OK);
  161. }
  162. if (!(info->display_type & ACPI_DISPLAY_SHORT)) {
  163. /* Indent the object according to the level */
  164. acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " ");
  165. /* Check the node type and name */
  166. if (type > ACPI_TYPE_LOCAL_MAX) {
  167. ACPI_WARNING((AE_INFO, "Invalid ACPI Object Type %08X",
  168. type));
  169. }
  170. if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
  171. this_node->name.integer =
  172. acpi_ut_repair_name(this_node->name.ascii);
  173. ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X",
  174. this_node->name.integer));
  175. }
  176. acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
  177. }
  178. /*
  179. * Now we can print out the pertinent information
  180. */
  181. acpi_os_printf(" %-12s %p %2.2X ",
  182. acpi_ut_get_type_name(type), this_node,
  183. this_node->owner_id);
  184. dbg_level = acpi_dbg_level;
  185. acpi_dbg_level = 0;
  186. obj_desc = acpi_ns_get_attached_object(this_node);
  187. acpi_dbg_level = dbg_level;
  188. /* Temp nodes are those nodes created by a control method */
  189. if (this_node->flags & ANOBJ_TEMPORARY) {
  190. acpi_os_printf("(T) ");
  191. }
  192. switch (info->display_type & ACPI_DISPLAY_MASK) {
  193. case ACPI_DISPLAY_SUMMARY:
  194. if (!obj_desc) {
  195. /* No attached object, we are done */
  196. acpi_os_printf("\n");
  197. return (AE_OK);
  198. }
  199. switch (type) {
  200. case ACPI_TYPE_PROCESSOR:
  201. acpi_os_printf("ID %X Len %.4X Addr %p\n",
  202. obj_desc->processor.proc_id,
  203. obj_desc->processor.length,
  204. ACPI_CAST_PTR(void,
  205. obj_desc->processor.
  206. address));
  207. break;
  208. case ACPI_TYPE_DEVICE:
  209. acpi_os_printf("Notify Object: %p\n", obj_desc);
  210. break;
  211. case ACPI_TYPE_METHOD:
  212. acpi_os_printf("Args %X Len %.4X Aml %p\n",
  213. (u32) obj_desc->method.param_count,
  214. obj_desc->method.aml_length,
  215. obj_desc->method.aml_start);
  216. break;
  217. case ACPI_TYPE_INTEGER:
  218. acpi_os_printf("= %8.8X%8.8X\n",
  219. ACPI_FORMAT_UINT64(obj_desc->integer.
  220. value));
  221. break;
  222. case ACPI_TYPE_PACKAGE:
  223. if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
  224. acpi_os_printf("Elements %.2X\n",
  225. obj_desc->package.count);
  226. } else {
  227. acpi_os_printf("[Length not yet evaluated]\n");
  228. }
  229. break;
  230. case ACPI_TYPE_BUFFER:
  231. if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
  232. acpi_os_printf("Len %.2X",
  233. obj_desc->buffer.length);
  234. /* Dump some of the buffer */
  235. if (obj_desc->buffer.length > 0) {
  236. acpi_os_printf(" =");
  237. for (i = 0;
  238. (i < obj_desc->buffer.length
  239. && i < 12); i++) {
  240. acpi_os_printf(" %.2hX",
  241. obj_desc->buffer.
  242. pointer[i]);
  243. }
  244. }
  245. acpi_os_printf("\n");
  246. } else {
  247. acpi_os_printf("[Length not yet evaluated]\n");
  248. }
  249. break;
  250. case ACPI_TYPE_STRING:
  251. acpi_os_printf("Len %.2X ", obj_desc->string.length);
  252. acpi_ut_print_string(obj_desc->string.pointer, 32);
  253. acpi_os_printf("\n");
  254. break;
  255. case ACPI_TYPE_REGION:
  256. acpi_os_printf("[%s]",
  257. acpi_ut_get_region_name(obj_desc->region.
  258. space_id));
  259. if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
  260. acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
  261. ACPI_FORMAT_NATIVE_UINT
  262. (obj_desc->region.address),
  263. obj_desc->region.length);
  264. } else {
  265. acpi_os_printf
  266. (" [Address/Length not yet evaluated]\n");
  267. }
  268. break;
  269. case ACPI_TYPE_LOCAL_REFERENCE:
  270. acpi_os_printf("[%s]\n",
  271. acpi_ps_get_opcode_name(obj_desc->
  272. reference.
  273. opcode));
  274. break;
  275. case ACPI_TYPE_BUFFER_FIELD:
  276. if (obj_desc->buffer_field.buffer_obj &&
  277. obj_desc->buffer_field.buffer_obj->buffer.node) {
  278. acpi_os_printf("Buf [%4.4s]",
  279. acpi_ut_get_node_name(obj_desc->
  280. buffer_field.
  281. buffer_obj->
  282. buffer.
  283. node));
  284. }
  285. break;
  286. case ACPI_TYPE_LOCAL_REGION_FIELD:
  287. acpi_os_printf("Rgn [%4.4s]",
  288. acpi_ut_get_node_name(obj_desc->
  289. common_field.
  290. region_obj->region.
  291. node));
  292. break;
  293. case ACPI_TYPE_LOCAL_BANK_FIELD:
  294. acpi_os_printf("Rgn [%4.4s] Bnk [%4.4s]",
  295. acpi_ut_get_node_name(obj_desc->
  296. common_field.
  297. region_obj->region.
  298. node),
  299. acpi_ut_get_node_name(obj_desc->
  300. bank_field.
  301. bank_obj->
  302. common_field.
  303. node));
  304. break;
  305. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  306. acpi_os_printf("Idx [%4.4s] Dat [%4.4s]",
  307. acpi_ut_get_node_name(obj_desc->
  308. index_field.
  309. index_obj->
  310. common_field.node),
  311. acpi_ut_get_node_name(obj_desc->
  312. index_field.
  313. data_obj->
  314. common_field.
  315. node));
  316. break;
  317. case ACPI_TYPE_LOCAL_ALIAS:
  318. case ACPI_TYPE_LOCAL_METHOD_ALIAS:
  319. acpi_os_printf("Target %4.4s (%p)\n",
  320. acpi_ut_get_node_name(obj_desc),
  321. obj_desc);
  322. break;
  323. default:
  324. acpi_os_printf("Object %p\n", obj_desc);
  325. break;
  326. }
  327. /* Common field handling */
  328. switch (type) {
  329. case ACPI_TYPE_BUFFER_FIELD:
  330. case ACPI_TYPE_LOCAL_REGION_FIELD:
  331. case ACPI_TYPE_LOCAL_BANK_FIELD:
  332. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  333. acpi_os_printf(" Off %.3X Len %.2X Acc %.2hd\n",
  334. (obj_desc->common_field.
  335. base_byte_offset * 8)
  336. +
  337. obj_desc->common_field.
  338. start_field_bit_offset,
  339. obj_desc->common_field.bit_length,
  340. obj_desc->common_field.
  341. access_byte_width);
  342. break;
  343. default:
  344. break;
  345. }
  346. break;
  347. case ACPI_DISPLAY_OBJECTS:
  348. acpi_os_printf("O:%p", obj_desc);
  349. if (!obj_desc) {
  350. /* No attached object, we are done */
  351. acpi_os_printf("\n");
  352. return (AE_OK);
  353. }
  354. acpi_os_printf("(R%d)", obj_desc->common.reference_count);
  355. switch (type) {
  356. case ACPI_TYPE_METHOD:
  357. /* Name is a Method and its AML offset/length are set */
  358. acpi_os_printf(" M:%p-%X\n", obj_desc->method.aml_start,
  359. obj_desc->method.aml_length);
  360. break;
  361. case ACPI_TYPE_INTEGER:
  362. acpi_os_printf(" I:%8.8X8.8%X\n",
  363. ACPI_FORMAT_UINT64(obj_desc->integer.
  364. value));
  365. break;
  366. case ACPI_TYPE_STRING:
  367. acpi_os_printf(" S:%p-%X\n", obj_desc->string.pointer,
  368. obj_desc->string.length);
  369. break;
  370. case ACPI_TYPE_BUFFER:
  371. acpi_os_printf(" B:%p-%X\n", obj_desc->buffer.pointer,
  372. obj_desc->buffer.length);
  373. break;
  374. default:
  375. acpi_os_printf("\n");
  376. break;
  377. }
  378. break;
  379. default:
  380. acpi_os_printf("\n");
  381. break;
  382. }
  383. /* If debug turned off, done */
  384. if (!(acpi_dbg_level & ACPI_LV_VALUES)) {
  385. return (AE_OK);
  386. }
  387. /* If there is an attached object, display it */
  388. dbg_level = acpi_dbg_level;
  389. acpi_dbg_level = 0;
  390. obj_desc = acpi_ns_get_attached_object(this_node);
  391. acpi_dbg_level = dbg_level;
  392. /* Dump attached objects */
  393. while (obj_desc) {
  394. obj_type = ACPI_TYPE_INVALID;
  395. acpi_os_printf("Attached Object %p: ", obj_desc);
  396. /* Decode the type of attached object and dump the contents */
  397. switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
  398. case ACPI_DESC_TYPE_NAMED:
  399. acpi_os_printf("(Ptr to Node)\n");
  400. bytes_to_dump = sizeof(struct acpi_namespace_node);
  401. ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
  402. break;
  403. case ACPI_DESC_TYPE_OPERAND:
  404. obj_type = ACPI_GET_OBJECT_TYPE(obj_desc);
  405. if (obj_type > ACPI_TYPE_LOCAL_MAX) {
  406. acpi_os_printf
  407. ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
  408. obj_type);
  409. bytes_to_dump = 32;
  410. } else {
  411. acpi_os_printf
  412. ("(Pointer to ACPI Object type %.2X [%s])\n",
  413. obj_type, acpi_ut_get_type_name(obj_type));
  414. bytes_to_dump =
  415. sizeof(union acpi_operand_object);
  416. }
  417. ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
  418. break;
  419. default:
  420. break;
  421. }
  422. /* If value is NOT an internal object, we are done */
  423. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) !=
  424. ACPI_DESC_TYPE_OPERAND) {
  425. goto cleanup;
  426. }
  427. /*
  428. * Valid object, get the pointer to next level, if any
  429. */
  430. switch (obj_type) {
  431. case ACPI_TYPE_BUFFER:
  432. case ACPI_TYPE_STRING:
  433. /*
  434. * NOTE: takes advantage of common fields between string/buffer
  435. */
  436. bytes_to_dump = obj_desc->string.length;
  437. obj_desc = (void *)obj_desc->string.pointer;
  438. acpi_os_printf("(Buffer/String pointer %p length %X)\n",
  439. obj_desc, bytes_to_dump);
  440. ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
  441. goto cleanup;
  442. case ACPI_TYPE_BUFFER_FIELD:
  443. obj_desc =
  444. (union acpi_operand_object *)obj_desc->buffer_field.
  445. buffer_obj;
  446. break;
  447. case ACPI_TYPE_PACKAGE:
  448. obj_desc = (void *)obj_desc->package.elements;
  449. break;
  450. case ACPI_TYPE_METHOD:
  451. obj_desc = (void *)obj_desc->method.aml_start;
  452. break;
  453. case ACPI_TYPE_LOCAL_REGION_FIELD:
  454. obj_desc = (void *)obj_desc->field.region_obj;
  455. break;
  456. case ACPI_TYPE_LOCAL_BANK_FIELD:
  457. obj_desc = (void *)obj_desc->bank_field.region_obj;
  458. break;
  459. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  460. obj_desc = (void *)obj_desc->index_field.index_obj;
  461. break;
  462. default:
  463. goto cleanup;
  464. }
  465. obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
  466. }
  467. cleanup:
  468. acpi_os_printf("\n");
  469. return (AE_OK);
  470. }
  471. #ifdef ACPI_FUTURE_USAGE
  472. /*******************************************************************************
  473. *
  474. * FUNCTION: acpi_ns_dump_objects
  475. *
  476. * PARAMETERS: Type - Object type to be dumped
  477. * display_type - 0 or ACPI_DISPLAY_SUMMARY
  478. * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
  479. * for an effectively unlimited depth.
  480. * owner_id - Dump only objects owned by this ID. Use
  481. * ACPI_UINT32_MAX to match all owners.
  482. * start_handle - Where in namespace to start/end search
  483. *
  484. * RETURN: None
  485. *
  486. * DESCRIPTION: Dump typed objects within the loaded namespace.
  487. * Uses acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object.
  488. *
  489. ******************************************************************************/
  490. void
  491. acpi_ns_dump_objects(acpi_object_type type,
  492. u8 display_type,
  493. u32 max_depth,
  494. acpi_owner_id owner_id, acpi_handle start_handle)
  495. {
  496. struct acpi_walk_info info;
  497. ACPI_FUNCTION_ENTRY();
  498. info.debug_level = ACPI_LV_TABLES;
  499. info.owner_id = owner_id;
  500. info.display_type = display_type;
  501. (void)acpi_ns_walk_namespace(type, start_handle, max_depth,
  502. ACPI_NS_WALK_NO_UNLOCK |
  503. ACPI_NS_WALK_TEMP_NODES,
  504. acpi_ns_dump_one_object, (void *)&info,
  505. NULL);
  506. }
  507. #endif /* ACPI_FUTURE_USAGE */
  508. /*******************************************************************************
  509. *
  510. * FUNCTION: acpi_ns_dump_entry
  511. *
  512. * PARAMETERS: Handle - Node to be dumped
  513. * debug_level - Output level
  514. *
  515. * RETURN: None
  516. *
  517. * DESCRIPTION: Dump a single Node
  518. *
  519. ******************************************************************************/
  520. void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level)
  521. {
  522. struct acpi_walk_info info;
  523. ACPI_FUNCTION_ENTRY();
  524. info.debug_level = debug_level;
  525. info.owner_id = ACPI_OWNER_ID_MAX;
  526. info.display_type = ACPI_DISPLAY_SUMMARY;
  527. (void)acpi_ns_dump_one_object(handle, 1, &info, NULL);
  528. }
  529. #ifdef ACPI_ASL_COMPILER
  530. /*******************************************************************************
  531. *
  532. * FUNCTION: acpi_ns_dump_tables
  533. *
  534. * PARAMETERS: search_base - Root of subtree to be dumped, or
  535. * NS_ALL to dump the entire namespace
  536. * max_depth - Maximum depth of dump. Use INT_MAX
  537. * for an effectively unlimited depth.
  538. *
  539. * RETURN: None
  540. *
  541. * DESCRIPTION: Dump the name space, or a portion of it.
  542. *
  543. ******************************************************************************/
  544. void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
  545. {
  546. acpi_handle search_handle = search_base;
  547. ACPI_FUNCTION_TRACE(ns_dump_tables);
  548. if (!acpi_gbl_root_node) {
  549. /*
  550. * If the name space has not been initialized,
  551. * there is nothing to dump.
  552. */
  553. ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
  554. "namespace not initialized!\n"));
  555. return_VOID;
  556. }
  557. if (ACPI_NS_ALL == search_base) {
  558. /* Entire namespace */
  559. search_handle = acpi_gbl_root_node;
  560. ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "\\\n"));
  561. }
  562. acpi_ns_dump_objects(ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
  563. ACPI_OWNER_ID_MAX, search_handle);
  564. return_VOID;
  565. }
  566. #endif /* _ACPI_ASL_COMPILER */
  567. #endif /* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */