Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/drivers/acpica/nsdump.c need to be fixed.

0001 /******************************************************************************
0002  *
0003  * Module Name: nsdump - table dumping routines for debug
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights.  You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025 
0026  * make derivatives, distribute, use and display any portion of the Covered
0027  * Code in any form, with the right to sublicense such rights; and
0028  *
0029  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0030  * license (with the right to sublicense), under only those claims of Intel
0031  * patents that are infringed by the Original Intel Code, to make, use, sell,
0032  * offer to sell, and import the Covered Code and derivative works thereof
0033  * solely to the minimum extent necessary to exercise the above copyright
0034  * license, and in no event shall the patent license extend to any additions
0035  * to or modifications of the Original Intel Code.  No other license or right
0036  * is granted directly or by implication, estoppel or otherwise;
0037  *
0038  * The above copyright and patent license is granted only if the following
0039  * conditions are met:
0040  *
0041  * 3. Conditions
0042  *
0043  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0044  * Redistribution of source code of any substantial portion of the Covered
0045  * Code or modification with rights to further distribute source must include
0046  * the above Copyright Notice, the above License, this list of Conditions,
0047  * and the following Disclaimer and Export Compliance provision.  In addition,
0048  * Licensee must cause all Covered Code to which Licensee contributes to
0049  * contain a file documenting the changes Licensee made to create that Covered
0050  * Code and the date of any change.  Licensee must include in that file the
0051  * documentation of any changes made by any predecessor Licensee.  Licensee
0052  * must include a prominent statement that the modification is derived,
0053  * directly or indirectly, from Original Intel Code.
0054  *
0055  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0056  * Redistribution of source code of any substantial portion of the Covered
0057  * Code or modification without rights to further distribute source must
0058  * include the following Disclaimer and Export Compliance provision in the
0059  * documentation and/or other materials provided with distribution.  In
0060  * addition, Licensee may not authorize further sublicense of source of any
0061  * portion of the Covered Code, and must include terms to the effect that the
0062  * license from Licensee to its licensee is limited to the intellectual
0063  * property embodied in the software Licensee provides to its licensee, and
0064  * not to intellectual property embodied in modifications its licensee may
0065  * make.
0066  *
0067  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0068  * substantial portion of the Covered Code or modification must reproduce the
0069  * above Copyright Notice, and the following Disclaimer and Export Compliance
0070  * provision in the documentation and/or other materials provided with the
0071  * distribution.
0072  *
0073  * 3.4. Intel retains all right, title, and interest in and to the Original
0074  * Intel Code.
0075  *
0076  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0077  * Intel shall be used in advertising or otherwise to promote the sale, use or
0078  * other dealings in products derived from or relating to the Covered Code
0079  * without prior written authorization from Intel.
0080  *
0081  * 4. Disclaimer and Export Compliance
0082  *
0083  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0084  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0085  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0086  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0087  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0088  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0089  * PARTICULAR PURPOSE.
0090  *
0091  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0092  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0093  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0094  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0095  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0096  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0097  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0098  * LIMITED REMEDY.
0099  *
0100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0101  * software or system incorporating such software without first obtaining any
0102  * required license or other approval from the U. S. Department of Commerce or
0103  * any other agency or department of the United States Government.  In the
0104  * event Licensee exports any such software from the United States or
0105  * re-exports any such software from a foreign destination, Licensee shall
0106  * ensure that the distribution and export/re-export of the software is in
0107  * compliance with all laws, regulations, orders, or other restrictions of the
0108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0109  * any of its subsidiaries will export/re-export any technical data, process,
0110  * software, or service, directly or indirectly, to any country for which the
0111  * United States government or any agency thereof requires an export license,
0112  * other governmental approval, or letter of assurance, without first obtaining
0113  * such license, approval or letter.
0114  *
0115  *****************************************************************************/
0116 
0117 #define __NSDUMP_C__
0118 
0119 #include "acpi.h"
0120 #include "accommon.h"
0121 #include "acnamesp.h"
0122 
0123 
0124 #define _COMPONENT          ACPI_NAMESPACE
0125         ACPI_MODULE_NAME    ("nsdump")
0126 
0127 /* Local prototypes */
0128 
0129 #ifdef ACPI_OBSOLETE_FUNCTIONS
0130 void
0131 AcpiNsDumpRootDevices (
0132     void);
0133 
0134 static ACPI_STATUS
0135 AcpiNsDumpOneDevice (
0136     ACPI_HANDLE             ObjHandle,
0137     UINT32                  Level,
0138     void                    *Context,
0139     void                    **ReturnValue);
0140 #endif
0141 
0142 
0143 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0144 /*******************************************************************************
0145  *
0146  * FUNCTION:    AcpiNsPrintPathname
0147  *
0148  * PARAMETERS:  NumSegments         - Number of ACPI name segments
0149  *              Pathname            - The compressed (internal) path
0150  *
0151  * RETURN:      None
0152  *
0153  * DESCRIPTION: Print an object's full namespace pathname
0154  *
0155  ******************************************************************************/
0156 
0157 void
0158 AcpiNsPrintPathname (
0159     UINT32                  NumSegments,
0160     char                    *Pathname)
0161 {
0162     UINT32                  i;
0163 
0164 
0165     ACPI_FUNCTION_NAME (NsPrintPathname);
0166 
0167 
0168     if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE))
0169     {
0170         return;
0171     }
0172 
0173     /* Print the entire name */
0174 
0175     ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
0176 
0177     while (NumSegments)
0178     {
0179         for (i = 0; i < 4; i++)
0180         {
0181             ACPI_IS_PRINT (Pathname[i]) ?
0182                 AcpiOsPrintf ("%c", Pathname[i]) :
0183                 AcpiOsPrintf ("?");
0184         }
0185 
0186         Pathname += ACPI_NAME_SIZE;
0187         NumSegments--;
0188         if (NumSegments)
0189         {
0190             AcpiOsPrintf (".");
0191         }
0192     }
0193 
0194     AcpiOsPrintf ("]\n");
0195 }
0196 
0197 
0198 /*******************************************************************************
0199  *
0200  * FUNCTION:    AcpiNsDumpPathname
0201  *
0202  * PARAMETERS:  Handle              - Object
0203  *              Msg                 - Prefix message
0204  *              Level               - Desired debug level
0205  *              Component           - Caller's component ID
0206  *
0207  * RETURN:      None
0208  *
0209  * DESCRIPTION: Print an object's full namespace pathname
0210  *              Manages allocation/freeing of a pathname buffer
0211  *
0212  ******************************************************************************/
0213 
0214 void
0215 AcpiNsDumpPathname (
0216     ACPI_HANDLE             Handle,
0217     char                    *Msg,
0218     UINT32                  Level,
0219     UINT32                  Component)
0220 {
0221 
0222     ACPI_FUNCTION_TRACE (NsDumpPathname);
0223 
0224 
0225     /* Do this only if the requested debug level and component are enabled */
0226 
0227     if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
0228     {
0229         return_VOID;
0230     }
0231 
0232     /* Convert handle to a full pathname and print it (with supplied message) */
0233 
0234     AcpiNsPrintNodePathname (Handle, Msg);
0235     AcpiOsPrintf ("\n");
0236     return_VOID;
0237 }
0238 
0239 
0240 /*******************************************************************************
0241  *
0242  * FUNCTION:    AcpiNsDumpOneObject
0243  *
0244  * PARAMETERS:  ObjHandle           - Node to be dumped
0245  *              Level               - Nesting level of the handle
0246  *              Context             - Passed into WalkNamespace
0247  *              ReturnValue         - Not used
0248  *
0249  * RETURN:      Status
0250  *
0251  * DESCRIPTION: Dump a single Node
0252  *              This procedure is a UserFunction called by AcpiNsWalkNamespace.
0253  *
0254  ******************************************************************************/
0255 
0256 ACPI_STATUS
0257 AcpiNsDumpOneObject (
0258     ACPI_HANDLE             ObjHandle,
0259     UINT32                  Level,
0260     void                    *Context,
0261     void                    **ReturnValue)
0262 {
0263     ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
0264     ACPI_NAMESPACE_NODE     *ThisNode;
0265     ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
0266     ACPI_OBJECT_TYPE        ObjType;
0267     ACPI_OBJECT_TYPE        Type;
0268     UINT32                  BytesToDump;
0269     UINT32                  DbgLevel;
0270     UINT32                  i;
0271 
0272 
0273     ACPI_FUNCTION_NAME (NsDumpOneObject);
0274 
0275 
0276     /* Is output enabled? */
0277 
0278     if (!(AcpiDbgLevel & Info->DebugLevel))
0279     {
0280         return (AE_OK);
0281     }
0282 
0283     if (!ObjHandle)
0284     {
0285         ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
0286         return (AE_OK);
0287     }
0288 
0289     ThisNode = AcpiNsMapHandleToNode (ObjHandle);
0290     if (!ThisNode)
0291     {
0292         ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n",
0293             ObjHandle));
0294         return (AE_OK);
0295     }
0296 
0297     Type = ThisNode->Type;
0298 
0299     /* Check if the owner matches */
0300 
0301     if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&
0302         (Info->OwnerId != ThisNode->OwnerId))
0303     {
0304         return (AE_OK);
0305     }
0306 
0307     if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))
0308     {
0309         /* Indent the object according to the level */
0310 
0311         AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
0312 
0313         /* Check the node type and name */
0314 
0315         if (Type > ACPI_TYPE_LOCAL_MAX)
0316         {
0317             ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type %08X", Type));
0318         }
0319 
0320         AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
0321     }
0322 
0323     /* Now we can print out the pertinent information */
0324 
0325     AcpiOsPrintf (" %-12s %p %2.2X ",
0326             AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
0327 
0328     DbgLevel = AcpiDbgLevel;
0329     AcpiDbgLevel = 0;
0330     ObjDesc = AcpiNsGetAttachedObject (ThisNode);
0331     AcpiDbgLevel = DbgLevel;
0332 
0333     /* Temp nodes are those nodes created by a control method */
0334 
0335     if (ThisNode->Flags & ANOBJ_TEMPORARY)
0336     {
0337         AcpiOsPrintf ("(T) ");
0338     }
0339 
0340     switch (Info->DisplayType & ACPI_DISPLAY_MASK)
0341     {
0342     case ACPI_DISPLAY_SUMMARY:
0343 
0344         if (!ObjDesc)
0345         {
0346             /* No attached object, we are done */
0347 
0348             AcpiOsPrintf ("\n");
0349             return (AE_OK);
0350         }
0351 
0352         switch (Type)
0353         {
0354         case ACPI_TYPE_PROCESSOR:
0355 
0356             AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
0357                 ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
0358                 ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
0359             break;
0360 
0361 
0362         case ACPI_TYPE_DEVICE:
0363 
0364             AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
0365             break;
0366 
0367 
0368         case ACPI_TYPE_METHOD:
0369 
0370             AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
0371                 (UINT32) ObjDesc->Method.ParamCount,
0372                 ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
0373             break;
0374 
0375 
0376         case ACPI_TYPE_INTEGER:
0377 
0378             AcpiOsPrintf ("= %8.8X%8.8X\n",
0379                 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
0380             break;
0381 
0382 
0383         case ACPI_TYPE_PACKAGE:
0384 
0385             if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
0386             {
0387                 AcpiOsPrintf ("Elements %.2X\n",
0388                     ObjDesc->Package.Count);
0389             }
0390             else
0391             {
0392                 AcpiOsPrintf ("[Length not yet evaluated]\n");
0393             }
0394             break;
0395 
0396 
0397         case ACPI_TYPE_BUFFER:
0398 
0399             if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
0400             {
0401                 AcpiOsPrintf ("Len %.2X",
0402                             ObjDesc->Buffer.Length);
0403 
0404                 /* Dump some of the buffer */
0405 
0406                 if (ObjDesc->Buffer.Length > 0)
0407                 {
0408                     AcpiOsPrintf (" =");
0409                     for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
0410                     {
0411                         AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
0412                     }
0413                 }
0414                 AcpiOsPrintf ("\n");
0415             }
0416             else
0417             {
0418                 AcpiOsPrintf ("[Length not yet evaluated]\n");
0419             }
0420             break;
0421 
0422 
0423         case ACPI_TYPE_STRING:
0424 
0425             AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
0426             AcpiUtPrintString (ObjDesc->String.Pointer, 32);
0427             AcpiOsPrintf ("\n");
0428             break;
0429 
0430 
0431         case ACPI_TYPE_REGION:
0432 
0433             AcpiOsPrintf ("[%s]",
0434                 AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
0435             if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
0436             {
0437                 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
0438                     ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
0439                     ObjDesc->Region.Length);
0440             }
0441             else
0442             {
0443                 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
0444             }
0445             break;
0446 
0447 
0448         case ACPI_TYPE_LOCAL_REFERENCE:
0449 
0450             AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc));
0451             break;
0452 
0453 
0454         case ACPI_TYPE_BUFFER_FIELD:
0455 
0456             if (ObjDesc->BufferField.BufferObj &&
0457                 ObjDesc->BufferField.BufferObj->Buffer.Node)
0458             {
0459                 AcpiOsPrintf ("Buf [%4.4s]",
0460                     AcpiUtGetNodeName (
0461                         ObjDesc->BufferField.BufferObj->Buffer.Node));
0462             }
0463             break;
0464 
0465 
0466         case ACPI_TYPE_LOCAL_REGION_FIELD:
0467 
0468             AcpiOsPrintf ("Rgn [%4.4s]",
0469                 AcpiUtGetNodeName (
0470                     ObjDesc->CommonField.RegionObj->Region.Node));
0471             break;
0472 
0473 
0474         case ACPI_TYPE_LOCAL_BANK_FIELD:
0475 
0476             AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
0477                 AcpiUtGetNodeName (
0478                     ObjDesc->CommonField.RegionObj->Region.Node),
0479                 AcpiUtGetNodeName (
0480                     ObjDesc->BankField.BankObj->CommonField.Node));
0481             break;
0482 
0483 
0484         case ACPI_TYPE_LOCAL_INDEX_FIELD:
0485 
0486             AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
0487                 AcpiUtGetNodeName (
0488                     ObjDesc->IndexField.IndexObj->CommonField.Node),
0489                 AcpiUtGetNodeName (
0490                     ObjDesc->IndexField.DataObj->CommonField.Node));
0491             break;
0492 
0493 
0494         case ACPI_TYPE_LOCAL_ALIAS:
0495         case ACPI_TYPE_LOCAL_METHOD_ALIAS:
0496 
0497             AcpiOsPrintf ("Target %4.4s (%p)\n",
0498                 AcpiUtGetNodeName (ObjDesc), ObjDesc);
0499             break;
0500 
0501         default:
0502 
0503             AcpiOsPrintf ("Object %p\n", ObjDesc);
0504             break;
0505         }
0506 
0507         /* Common field handling */
0508 
0509         switch (Type)
0510         {
0511         case ACPI_TYPE_BUFFER_FIELD:
0512         case ACPI_TYPE_LOCAL_REGION_FIELD:
0513         case ACPI_TYPE_LOCAL_BANK_FIELD:
0514         case ACPI_TYPE_LOCAL_INDEX_FIELD:
0515 
0516             AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
0517                 (ObjDesc->CommonField.BaseByteOffset * 8)
0518                     + ObjDesc->CommonField.StartFieldBitOffset,
0519                 ObjDesc->CommonField.BitLength,
0520                 ObjDesc->CommonField.AccessByteWidth);
0521             break;
0522 
0523         default:
0524             break;
0525         }
0526         break;
0527 
0528 
0529     case ACPI_DISPLAY_OBJECTS:
0530 
0531         AcpiOsPrintf ("O:%p", ObjDesc);
0532         if (!ObjDesc)
0533         {
0534             /* No attached object, we are done */
0535 
0536             AcpiOsPrintf ("\n");
0537             return (AE_OK);
0538         }
0539 
0540         AcpiOsPrintf ("(R%d)", ObjDesc->Common.ReferenceCount);
0541 
0542         switch (Type)
0543         {
0544         case ACPI_TYPE_METHOD:
0545 
0546             /* Name is a Method and its AML offset/length are set */
0547 
0548             AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
0549                 ObjDesc->Method.AmlLength);
0550             break;
0551 
0552         case ACPI_TYPE_INTEGER:
0553 
0554             AcpiOsPrintf (" I:%8.8X8.8%X\n",
0555                 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
0556             break;
0557 
0558         case ACPI_TYPE_STRING:
0559 
0560             AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
0561                 ObjDesc->String.Length);
0562             break;
0563 
0564         case ACPI_TYPE_BUFFER:
0565 
0566             AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
0567                 ObjDesc->Buffer.Length);
0568             break;
0569 
0570         default:
0571 
0572             AcpiOsPrintf ("\n");
0573             break;
0574         }
0575         break;
0576 
0577 
0578     default:
0579         AcpiOsPrintf ("\n");
0580         break;
0581     }
0582 
0583     /* If debug turned off, done */
0584 
0585     if (!(AcpiDbgLevel & ACPI_LV_VALUES))
0586     {
0587         return (AE_OK);
0588     }
0589 
0590     /* If there is an attached object, display it */
0591 
0592     DbgLevel     = AcpiDbgLevel;
0593     AcpiDbgLevel = 0;
0594     ObjDesc      = AcpiNsGetAttachedObject (ThisNode);
0595     AcpiDbgLevel = DbgLevel;
0596 
0597     /* Dump attached objects */
0598 
0599     while (ObjDesc)
0600     {
0601         ObjType = ACPI_TYPE_INVALID;
0602         AcpiOsPrintf ("Attached Object %p: ", ObjDesc);
0603 
0604         /* Decode the type of attached object and dump the contents */
0605 
0606         switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
0607         {
0608         case ACPI_DESC_TYPE_NAMED:
0609 
0610             AcpiOsPrintf ("(Ptr to Node)\n");
0611             BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
0612             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
0613             break;
0614 
0615         case ACPI_DESC_TYPE_OPERAND:
0616 
0617             ObjType = ObjDesc->Common.Type;
0618 
0619             if (ObjType > ACPI_TYPE_LOCAL_MAX)
0620             {
0621                 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
0622                     ObjType);
0623                 BytesToDump = 32;
0624             }
0625             else
0626             {
0627                 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
0628                     ObjType, AcpiUtGetTypeName (ObjType));
0629                 BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
0630             }
0631 
0632             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
0633             break;
0634 
0635         default:
0636 
0637             break;
0638         }
0639 
0640         /* If value is NOT an internal object, we are done */
0641 
0642         if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
0643         {
0644             goto Cleanup;
0645         }
0646 
0647         /* Valid object, get the pointer to next level, if any */
0648 
0649         switch (ObjType)
0650         {
0651         case ACPI_TYPE_BUFFER:
0652         case ACPI_TYPE_STRING:
0653             /*
0654              * NOTE: takes advantage of common fields between string/buffer
0655              */
0656             BytesToDump = ObjDesc->String.Length;
0657             ObjDesc = (void *) ObjDesc->String.Pointer;
0658             AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
0659                 ObjDesc, BytesToDump);
0660             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
0661             goto Cleanup;
0662 
0663         case ACPI_TYPE_BUFFER_FIELD:
0664             ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
0665             break;
0666 
0667         case ACPI_TYPE_PACKAGE:
0668             ObjDesc = (void *) ObjDesc->Package.Elements;
0669             break;
0670 
0671         case ACPI_TYPE_METHOD:
0672             ObjDesc = (void *) ObjDesc->Method.AmlStart;
0673             break;
0674 
0675         case ACPI_TYPE_LOCAL_REGION_FIELD:
0676             ObjDesc = (void *) ObjDesc->Field.RegionObj;
0677             break;
0678 
0679         case ACPI_TYPE_LOCAL_BANK_FIELD:
0680             ObjDesc = (void *) ObjDesc->BankField.RegionObj;
0681             break;
0682 
0683         case ACPI_TYPE_LOCAL_INDEX_FIELD:
0684             ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
0685             break;
0686 
0687         default:
0688             goto Cleanup;
0689         }
0690 
0691         ObjType = ACPI_TYPE_INVALID;   /* Terminate loop after next pass */
0692     }
0693 
0694 Cleanup:
0695     AcpiOsPrintf ("\n");
0696     return (AE_OK);
0697 }
0698 
0699 
0700 /*******************************************************************************
0701  *
0702  * FUNCTION:    AcpiNsDumpObjects
0703  *
0704  * PARAMETERS:  Type                - Object type to be dumped
0705  *              DisplayType         - 0 or ACPI_DISPLAY_SUMMARY
0706  *              MaxDepth            - Maximum depth of dump. Use ACPI_UINT32_MAX
0707  *                                    for an effectively unlimited depth.
0708  *              OwnerId             - Dump only objects owned by this ID. Use
0709  *                                    ACPI_UINT32_MAX to match all owners.
0710  *              StartHandle         - Where in namespace to start/end search
0711  *
0712  * RETURN:      None
0713  *
0714  * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
0715  *              AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
0716  *
0717  ******************************************************************************/
0718 
0719 void
0720 AcpiNsDumpObjects (
0721     ACPI_OBJECT_TYPE        Type,
0722     UINT8                   DisplayType,
0723     UINT32                  MaxDepth,
0724     ACPI_OWNER_ID           OwnerId,
0725     ACPI_HANDLE             StartHandle)
0726 {
0727     ACPI_WALK_INFO          Info;
0728 
0729 
0730     ACPI_FUNCTION_ENTRY ();
0731 
0732 
0733     Info.DebugLevel = ACPI_LV_TABLES;
0734     Info.OwnerId = OwnerId;
0735     Info.DisplayType = DisplayType;
0736 
0737     (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
0738                 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
0739                 AcpiNsDumpOneObject, (void *) &Info, NULL);
0740 }
0741 
0742 
0743 /*******************************************************************************
0744  *
0745  * FUNCTION:    AcpiNsDumpEntry
0746  *
0747  * PARAMETERS:  Handle              - Node to be dumped
0748  *              DebugLevel          - Output level
0749  *
0750  * RETURN:      None
0751  *
0752  * DESCRIPTION: Dump a single Node
0753  *
0754  ******************************************************************************/
0755 
0756 void
0757 AcpiNsDumpEntry (
0758     ACPI_HANDLE             Handle,
0759     UINT32                  DebugLevel)
0760 {
0761     ACPI_WALK_INFO          Info;
0762 
0763 
0764     ACPI_FUNCTION_ENTRY ();
0765 
0766 
0767     Info.DebugLevel = DebugLevel;
0768     Info.OwnerId = ACPI_OWNER_ID_MAX;
0769     Info.DisplayType = ACPI_DISPLAY_SUMMARY;
0770 
0771     (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
0772 }
0773 
0774 
0775 #ifdef ACPI_ASL_COMPILER
0776 /*******************************************************************************
0777  *
0778  * FUNCTION:    AcpiNsDumpTables
0779  *
0780  * PARAMETERS:  SearchBase          - Root of subtree to be dumped, or
0781  *                                    NS_ALL to dump the entire namespace
0782  *              MaxDepth            - Maximum depth of dump.  Use INT_MAX
0783  *                                    for an effectively unlimited depth.
0784  *
0785  * RETURN:      None
0786  *
0787  * DESCRIPTION: Dump the name space, or a portion of it.
0788  *
0789  ******************************************************************************/
0790 
0791 void
0792 AcpiNsDumpTables (
0793     ACPI_HANDLE             SearchBase,
0794     UINT32                  MaxDepth)
0795 {
0796     ACPI_HANDLE             SearchHandle = SearchBase;
0797 
0798 
0799     ACPI_FUNCTION_TRACE (NsDumpTables);
0800 
0801 
0802     if (!AcpiGbl_RootNode)
0803     {
0804         /*
0805          * If the name space has not been initialized,
0806          * there is nothing to dump.
0807          */
0808         ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
0809         return_VOID;
0810     }
0811 
0812     if (ACPI_NS_ALL == SearchBase)
0813     {
0814         /* Entire namespace */
0815 
0816         SearchHandle = AcpiGbl_RootNode;
0817         ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
0818     }
0819 
0820     AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
0821             ACPI_OWNER_ID_MAX, SearchHandle);
0822     return_VOID;
0823 }
0824 #endif
0825 #endif
0826