nsdump.c revision 83174
134192Sjdp/****************************************************************************** 234192Sjdp * 334192Sjdp * Module Name: nsdump - table dumping routines for debug 434192Sjdp * $Revision: 99 $ 534192Sjdp * 634192Sjdp *****************************************************************************/ 734192Sjdp 834192Sjdp/****************************************************************************** 934192Sjdp * 1034192Sjdp * 1. Copyright Notice 1134192Sjdp * 1234192Sjdp * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. 1334192Sjdp * All rights reserved. 1434192Sjdp * 1534192Sjdp * 2. License 1634192Sjdp * 1734192Sjdp * 2.1. This is your license from Intel Corp. under its intellectual property 1834192Sjdp * rights. You may have additional license terms from the party that provided 1934192Sjdp * you this software, covering your right to use that party's intellectual 2034192Sjdp * property rights. 2134192Sjdp * 2234192Sjdp * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2334192Sjdp * copy of the source code appearing in this file ("Covered Code") an 2434192Sjdp * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2534192Sjdp * base code distributed originally by Intel ("Original Intel Code") to copy, 2634192Sjdp 2734192Sjdp * make derivatives, distribute, use and display any portion of the Covered 2834192Sjdp * Code in any form, with the right to sublicense such rights; and 2934192Sjdp * 3034192Sjdp * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 3134192Sjdp * license (with the right to sublicense), under only those claims of Intel 3234192Sjdp * patents that are infringed by the Original Intel Code, to make, use, sell, 3334192Sjdp * offer to sell, and import the Covered Code and derivative works thereof 3434192Sjdp * solely to the minimum extent necessary to exercise the above copyright 3534192Sjdp * license, and in no event shall the patent license extend to any additions 3634192Sjdp * to or modifications of the Original Intel Code. No other license or right 3734192Sjdp * is granted directly or by implication, estoppel or otherwise; 3834192Sjdp * 3934192Sjdp * The above copyright and patent license is granted only if the following 4034192Sjdp * conditions are met: 4134192Sjdp * 4234192Sjdp * 3. Conditions 4334192Sjdp * 4434192Sjdp * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4534192Sjdp * Redistribution of source code of any substantial portion of the Covered 4634192Sjdp * Code or modification with rights to further distribute source must include 4734192Sjdp * the above Copyright Notice, the above License, this list of Conditions, 4834192Sjdp * and the following Disclaimer and Export Compliance provision. In addition, 4934192Sjdp * Licensee must cause all Covered Code to which Licensee contributes to 5034192Sjdp * contain a file documenting the changes Licensee made to create that Covered 5134192Sjdp * Code and the date of any change. Licensee must include in that file the 5234192Sjdp * documentation of any changes made by any predecessor Licensee. Licensee 5334192Sjdp * must include a prominent statement that the modification is derived, 5434192Sjdp * directly or indirectly, from Original Intel Code. 5534192Sjdp * 5634192Sjdp * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5734192Sjdp * Redistribution of source code of any substantial portion of the Covered 5834192Sjdp * Code or modification without rights to further distribute source must 5934192Sjdp * include the following Disclaimer and Export Compliance provision in the 6034192Sjdp * documentation and/or other materials provided with distribution. In 6134192Sjdp * addition, Licensee may not authorize further sublicense of source of any 6234192Sjdp * portion of the Covered Code, and must include terms to the effect that the 6334192Sjdp * license from Licensee to its licensee is limited to the intellectual 6434192Sjdp * property embodied in the software Licensee provides to its licensee, and 6534192Sjdp * not to intellectual property embodied in modifications its licensee may 6634192Sjdp * make. 6734192Sjdp * 6834192Sjdp * 3.3. Redistribution of Executable. Redistribution in executable form of any 6934192Sjdp * substantial portion of the Covered Code or modification must reproduce the 7034192Sjdp * above Copyright Notice, and the following Disclaimer and Export Compliance 7134192Sjdp * provision in the documentation and/or other materials provided with the 7234192Sjdp * distribution. 7334192Sjdp * 7434192Sjdp * 3.4. Intel retains all right, title, and interest in and to the Original 7534192Sjdp * Intel Code. 7634192Sjdp * 7734192Sjdp * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7834192Sjdp * Intel shall be used in advertising or otherwise to promote the sale, use or 7934192Sjdp * other dealings in products derived from or relating to the Covered Code 8034192Sjdp * without prior written authorization from Intel. 8134192Sjdp * 8234192Sjdp * 4. Disclaimer and Export Compliance 8334192Sjdp * 8434192Sjdp * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8534192Sjdp * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8634192Sjdp * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8734192Sjdp * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8834192Sjdp * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8934192Sjdp * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 9034192Sjdp * PARTICULAR PURPOSE. 9134192Sjdp * 9234192Sjdp * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9334192Sjdp * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9434192Sjdp * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9534192Sjdp * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9634192Sjdp * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9734192Sjdp * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9834192Sjdp * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9934192Sjdp * LIMITED REMEDY. 10034192Sjdp * 10134192Sjdp * 4.3. Licensee shall not export, either directly or indirectly, any of this 10234192Sjdp * software or system incorporating such software without first obtaining any 10334192Sjdp * required license or other approval from the U. S. Department of Commerce or 10434192Sjdp * any other agency or department of the United States Government. In the 10534192Sjdp * event Licensee exports any such software from the United States or 10634192Sjdp * re-exports any such software from a foreign destination, Licensee shall 10734192Sjdp * ensure that the distribution and export/re-export of the software is in 10834192Sjdp * compliance with all laws, regulations, orders, or other restrictions of the 10934192Sjdp * U.S. Export Administration Regulations. Licensee agrees that neither it nor 11034192Sjdp * any of its subsidiaries will export/re-export any technical data, process, 11134192Sjdp * software, or service, directly or indirectly, to any country for which the 11234192Sjdp * United States government or any agency thereof requires an export license, 11334192Sjdp * other governmental approval, or letter of assurance, without first obtaining 11434192Sjdp * such license, approval or letter. 11534192Sjdp * 11634192Sjdp *****************************************************************************/ 11734192Sjdp 11834192Sjdp#define __NSDUMP_C__ 11934192Sjdp 12034192Sjdp#include "acpi.h" 12134192Sjdp#include "acinterp.h" 12234192Sjdp#include "acnamesp.h" 123#include "actables.h" 124 125 126#define _COMPONENT ACPI_NAMESPACE 127 MODULE_NAME ("nsdump") 128 129 130#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) 131 132/******************************************************************************* 133 * 134 * FUNCTION: AcpiNsDumpPathname 135 * 136 * PARAMETERS: Handle - Object 137 * Msg - Prefix message 138 * Level - Desired debug level 139 * Component - Caller's component ID 140 * 141 * DESCRIPTION: Print an object's full namespace pathname 142 * Manages allocation/freeing of a pathname buffer 143 * 144 ******************************************************************************/ 145 146ACPI_STATUS 147AcpiNsDumpPathname ( 148 ACPI_HANDLE Handle, 149 NATIVE_CHAR *Msg, 150 UINT32 Level, 151 UINT32 Component) 152{ 153 NATIVE_CHAR *Buffer; 154 UINT32 Length; 155 156 157 FUNCTION_TRACE ("NsDumpPathname"); 158 159 160 /* Do this only if the requested debug level and component are enabled */ 161 162 if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component)) 163 { 164 return_ACPI_STATUS (AE_OK); 165 } 166 167 Buffer = ACPI_MEM_ALLOCATE (PATHNAME_MAX); 168 if (!Buffer) 169 { 170 return_ACPI_STATUS (AE_NO_MEMORY); 171 } 172 173 /* Convert handle to a full pathname and print it (with supplied message) */ 174 175 Length = PATHNAME_MAX; 176 if (ACPI_SUCCESS (AcpiNsHandleToPathname (Handle, &Length, Buffer))) 177 { 178 AcpiOsPrintf ("%s %s (%p)\n", Msg, Buffer, Handle); 179 } 180 181 ACPI_MEM_FREE (Buffer); 182 183 return_ACPI_STATUS (AE_OK); 184} 185 186 187/******************************************************************************* 188 * 189 * FUNCTION: AcpiNsDumpOneObject 190 * 191 * PARAMETERS: Handle - Node to be dumped 192 * Level - Nesting level of the handle 193 * Context - Passed into WalkNamespace 194 * 195 * DESCRIPTION: Dump a single Node 196 * This procedure is a UserFunction called by AcpiNsWalkNamespace. 197 * 198 ******************************************************************************/ 199 200ACPI_STATUS 201AcpiNsDumpOneObject ( 202 ACPI_HANDLE ObjHandle, 203 UINT32 Level, 204 void *Context, 205 void **ReturnValue) 206{ 207 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context; 208 ACPI_NAMESPACE_NODE *ThisNode; 209 UINT8 *Value; 210 ACPI_OPERAND_OBJECT *ObjDesc = NULL; 211 ACPI_OBJECT_TYPE8 ObjType; 212 ACPI_OBJECT_TYPE8 Type; 213 UINT32 BytesToDump; 214 UINT32 DownstreamSiblingMask = 0; 215 UINT32 LevelTmp; 216 UINT32 WhichBit; 217 218 219 PROC_NAME ("NsDumpOneObject"); 220 221 222 ThisNode = AcpiNsConvertHandleToEntry (ObjHandle); 223 224 LevelTmp = Level; 225 Type = ThisNode->Type; 226 WhichBit = 1; 227 228 229 if (!(AcpiDbgLevel & Info->DebugLevel)) 230 { 231 return (AE_OK); 232 } 233 234 if (!ObjHandle) 235 { 236 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n")); 237 return (AE_OK); 238 } 239 240 /* Check if the owner matches */ 241 242 if ((Info->OwnerId != ACPI_UINT32_MAX) && 243 (Info->OwnerId != ThisNode->OwnerId)) 244 { 245 return (AE_OK); 246 } 247 248 249 /* Indent the object according to the level */ 250 251 while (LevelTmp--) 252 { 253 254 /* Print appropriate characters to form tree structure */ 255 256 if (LevelTmp) 257 { 258 if (DownstreamSiblingMask & WhichBit) 259 { 260 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "|")); 261 } 262 263 else 264 { 265 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); 266 } 267 268 WhichBit <<= 1; 269 } 270 271 else 272 { 273 if (AcpiNsExistDownstreamSibling (ThisNode + 1)) 274 { 275 DownstreamSiblingMask |= (1 << (Level - 1)); 276 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); 277 } 278 279 else 280 { 281 DownstreamSiblingMask &= ACPI_UINT32_MAX ^ (1 << (Level - 1)); 282 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); 283 } 284 285 if (ThisNode->Child == NULL) 286 { 287 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); 288 } 289 290 else if (AcpiNsExistDownstreamSibling (ThisNode->Child)) 291 { 292 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); 293 } 294 295 else 296 { 297 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); 298 } 299 } 300 } 301 302 303 /* Check the integrity of our data */ 304 305 if (Type > INTERNAL_TYPE_MAX) 306 { 307 Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */ 308 } 309 310 if (!AcpiUtValidAcpiName (ThisNode->Name)) 311 { 312 REPORT_WARNING (("Invalid ACPI Name %08X\n", ThisNode->Name)); 313 } 314 315 /* 316 * Now we can print out the pertinent information 317 */ 318 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-9s ", &ThisNode->Name, AcpiUtGetTypeName (Type))); 319 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p S:%p O:%p", ThisNode, ThisNode->Child, ThisNode->Object)); 320 321 322 if (!ThisNode->Object) 323 { 324 /* No attached object, we are done */ 325 326 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); 327 return (AE_OK); 328 } 329 330 switch (Type) 331 { 332 333 case ACPI_TYPE_METHOD: 334 335 /* Name is a Method and its AML offset/length are set */ 336 337 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n", 338 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.Pcode, 339 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.PcodeLength)); 340 341 break; 342 343 344 case ACPI_TYPE_INTEGER: 345 346 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X\n", 347 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Integer.Value)); 348 break; 349 350 351 case ACPI_TYPE_STRING: 352 353 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n", 354 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Pointer, 355 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Length)); 356 break; 357 358 359 case ACPI_TYPE_BUFFER: 360 361 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n", 362 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Pointer, 363 ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Length)); 364 break; 365 366 367 default: 368 369 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); 370 break; 371 } 372 373 /* If debug turned off, done */ 374 375 if (!(AcpiDbgLevel & ACPI_LV_VALUES)) 376 { 377 return (AE_OK); 378 } 379 380 381 /* If there is an attached object, display it */ 382 383 Value = ThisNode->Object; 384 385 /* Dump attached objects */ 386 387 while (Value) 388 { 389 ObjType = INTERNAL_TYPE_INVALID; 390 391 /* Decode the type of attached object and dump the contents */ 392 393 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", Value)); 394 395 if (AcpiTbSystemTablePointer (Value)) 396 { 397 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to AML Code)\n")); 398 BytesToDump = 16; 399 } 400 401 else if (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_NAMED)) 402 { 403 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n")); 404 BytesToDump = sizeof (ACPI_NAMESPACE_NODE); 405 } 406 407 408 else if (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_INTERNAL)) 409 { 410 ObjDesc = (ACPI_OPERAND_OBJECT *) Value; 411 ObjType = ObjDesc->Common.Type; 412 413 if (ObjType > INTERNAL_TYPE_MAX) 414 { 415 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType)); 416 BytesToDump = 32; 417 } 418 419 else 420 { 421 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [%s])\n", 422 ObjType, AcpiUtGetTypeName (ObjType))); 423 BytesToDump = sizeof (ACPI_OPERAND_OBJECT); 424 } 425 } 426 427 else 428 { 429 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n", Value)); 430 BytesToDump = 16; 431 } 432 433 DUMP_BUFFER (Value, BytesToDump); 434 435 /* If value is NOT an internal object, we are done */ 436 437 if ((AcpiTbSystemTablePointer (Value)) || 438 (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_NAMED))) 439 { 440 goto Cleanup; 441 } 442 443 /* 444 * Valid object, get the pointer to next level, if any 445 */ 446 switch (ObjType) 447 { 448 case ACPI_TYPE_STRING: 449 Value = (UINT8 *) ObjDesc->String.Pointer; 450 break; 451 452 case ACPI_TYPE_BUFFER: 453 Value = (UINT8 *) ObjDesc->Buffer.Pointer; 454 break; 455 456 case ACPI_TYPE_BUFFER_FIELD: 457 Value = (UINT8 *) ObjDesc->BufferField.BufferObj; 458 break; 459 460 case ACPI_TYPE_PACKAGE: 461 Value = (UINT8 *) ObjDesc->Package.Elements; 462 break; 463 464 case ACPI_TYPE_METHOD: 465 Value = (UINT8 *) ObjDesc->Method.Pcode; 466 break; 467 468 case INTERNAL_TYPE_REGION_FIELD: 469 Value = (UINT8 *) ObjDesc->Field.RegionObj; 470 break; 471 472 case INTERNAL_TYPE_BANK_FIELD: 473 Value = (UINT8 *) ObjDesc->BankField.RegionObj; 474 break; 475 476 case INTERNAL_TYPE_INDEX_FIELD: 477 Value = (UINT8 *) ObjDesc->IndexField.IndexObj; 478 break; 479 480 default: 481 goto Cleanup; 482 } 483 484 ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ 485 } 486 487Cleanup: 488 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); 489 return (AE_OK); 490} 491 492 493/******************************************************************************* 494 * 495 * FUNCTION: AcpiNsDumpObjects 496 * 497 * PARAMETERS: Type - Object type to be dumped 498 * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX 499 * for an effectively unlimited depth. 500 * OwnerId - Dump only objects owned by this ID. Use 501 * ACPI_UINT32_MAX to match all owners. 502 * StartHandle - Where in namespace to start/end search 503 * 504 * DESCRIPTION: Dump typed objects within the loaded namespace. 505 * Uses AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject. 506 * 507 ******************************************************************************/ 508 509void 510AcpiNsDumpObjects ( 511 ACPI_OBJECT_TYPE8 Type, 512 UINT32 MaxDepth, 513 UINT32 OwnerId, 514 ACPI_HANDLE StartHandle) 515{ 516 ACPI_WALK_INFO Info; 517 518 519 FUNCTION_ENTRY (); 520 521 522 Info.DebugLevel = ACPI_LV_TABLES; 523 Info.OwnerId = OwnerId; 524 525 AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject, 526 (void *) &Info, NULL); 527} 528 529 530#ifndef _ACPI_ASL_COMPILER 531/******************************************************************************* 532 * 533 * FUNCTION: AcpiNsDumpOneDevice 534 * 535 * PARAMETERS: Handle - Node to be dumped 536 * Level - Nesting level of the handle 537 * Context - Passed into WalkNamespace 538 * 539 * DESCRIPTION: Dump a single Node that represents a device 540 * This procedure is a UserFunction called by AcpiNsWalkNamespace. 541 * 542 ******************************************************************************/ 543 544ACPI_STATUS 545AcpiNsDumpOneDevice ( 546 ACPI_HANDLE ObjHandle, 547 UINT32 Level, 548 void *Context, 549 void **ReturnValue) 550{ 551 ACPI_DEVICE_INFO Info; 552 ACPI_STATUS Status; 553 UINT32 i; 554 555 556 PROC_NAME ("NsDumpOneDevice"); 557 558 559 Status = AcpiNsDumpOneObject (ObjHandle, Level, Context, ReturnValue); 560 561 Status = AcpiGetObjectInfo (ObjHandle, &Info); 562 if (ACPI_SUCCESS (Status)) 563 { 564 for (i = 0; i < Level; i++) 565 { 566 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); 567 } 568 569 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %.8X, ADR: %.8X, Status: %x\n", 570 Info.HardwareId, Info.Address, Info.CurrentStatus)); 571 } 572 573 return (Status); 574} 575 576 577/******************************************************************************* 578 * 579 * FUNCTION: AcpiNsDumpRootDevices 580 * 581 * PARAMETERS: None 582 * 583 * DESCRIPTION: Dump all objects of type "device" 584 * 585 ******************************************************************************/ 586 587void 588AcpiNsDumpRootDevices (void) 589{ 590 ACPI_HANDLE SysBusHandle; 591 592 593 PROC_NAME ("NsDumpRootDevices"); 594 595 596 /* Only dump the table if tracing is enabled */ 597 598 if (!(ACPI_LV_TABLES & AcpiDbgLevel)) 599 { 600 return; 601 } 602 603 AcpiGetHandle (0, NS_SYSTEM_BUS, &SysBusHandle); 604 605 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n")); 606 AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_UINT32_MAX, NS_WALK_NO_UNLOCK, 607 AcpiNsDumpOneDevice, NULL, NULL); 608} 609 610#endif 611 612/******************************************************************************* 613 * 614 * FUNCTION: AcpiNsDumpTables 615 * 616 * PARAMETERS: SearchBase - Root of subtree to be dumped, or 617 * NS_ALL to dump the entire namespace 618 * MaxDepth - Maximum depth of dump. Use INT_MAX 619 * for an effectively unlimited depth. 620 * 621 * DESCRIPTION: Dump the name space, or a portion of it. 622 * 623 ******************************************************************************/ 624 625void 626AcpiNsDumpTables ( 627 ACPI_HANDLE SearchBase, 628 UINT32 MaxDepth) 629{ 630 ACPI_HANDLE SearchHandle = SearchBase; 631 632 633 FUNCTION_TRACE ("NsDumpTables"); 634 635 636 if (!AcpiGbl_RootNode) 637 { 638 /* 639 * If the name space has not been initialized, 640 * there is nothing to dump. 641 */ 642 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "name space not initialized!\n")); 643 return_VOID; 644 } 645 646 if (NS_ALL == SearchBase) 647 { 648 /* entire namespace */ 649 650 SearchHandle = AcpiGbl_RootNode; 651 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n")); 652 } 653 654 655 AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SearchHandle); 656 return_VOID; 657} 658 659 660/******************************************************************************* 661 * 662 * FUNCTION: AcpiNsDumpEntry 663 * 664 * PARAMETERS: Handle - Node to be dumped 665 * DebugLevel - Output level 666 * 667 * DESCRIPTION: Dump a single Node 668 * 669 ******************************************************************************/ 670 671void 672AcpiNsDumpEntry ( 673 ACPI_HANDLE Handle, 674 UINT32 DebugLevel) 675{ 676 ACPI_WALK_INFO Info; 677 678 679 FUNCTION_ENTRY (); 680 681 682 Info.DebugLevel = DebugLevel; 683 Info.OwnerId = ACPI_UINT32_MAX; 684 685 AcpiNsDumpOneObject (Handle, 1, &Info, NULL); 686} 687 688#endif 689 690