nsdump.c 18 KB

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