xref: /minix3/minix/drivers/power/acpi/namespace/nsdump.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /******************************************************************************
2*433d6423SLionel Sambuc  *
3*433d6423SLionel Sambuc  * Module Name: nsdump - table dumping routines for debug
4*433d6423SLionel Sambuc  *
5*433d6423SLionel Sambuc  *****************************************************************************/
6*433d6423SLionel Sambuc 
7*433d6423SLionel Sambuc /******************************************************************************
8*433d6423SLionel Sambuc  *
9*433d6423SLionel Sambuc  * 1. Copyright Notice
10*433d6423SLionel Sambuc  *
11*433d6423SLionel Sambuc  * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
12*433d6423SLionel Sambuc  * All rights reserved.
13*433d6423SLionel Sambuc  *
14*433d6423SLionel Sambuc  * 2. License
15*433d6423SLionel Sambuc  *
16*433d6423SLionel Sambuc  * 2.1. This is your license from Intel Corp. under its intellectual property
17*433d6423SLionel Sambuc  * rights.  You may have additional license terms from the party that provided
18*433d6423SLionel Sambuc  * you this software, covering your right to use that party's intellectual
19*433d6423SLionel Sambuc  * property rights.
20*433d6423SLionel Sambuc  *
21*433d6423SLionel Sambuc  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22*433d6423SLionel Sambuc  * copy of the source code appearing in this file ("Covered Code") an
23*433d6423SLionel Sambuc  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24*433d6423SLionel Sambuc  * base code distributed originally by Intel ("Original Intel Code") to copy,
25*433d6423SLionel Sambuc 
26*433d6423SLionel Sambuc  * make derivatives, distribute, use and display any portion of the Covered
27*433d6423SLionel Sambuc  * Code in any form, with the right to sublicense such rights; and
28*433d6423SLionel Sambuc  *
29*433d6423SLionel Sambuc  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30*433d6423SLionel Sambuc  * license (with the right to sublicense), under only those claims of Intel
31*433d6423SLionel Sambuc  * patents that are infringed by the Original Intel Code, to make, use, sell,
32*433d6423SLionel Sambuc  * offer to sell, and import the Covered Code and derivative works thereof
33*433d6423SLionel Sambuc  * solely to the minimum extent necessary to exercise the above copyright
34*433d6423SLionel Sambuc  * license, and in no event shall the patent license extend to any additions
35*433d6423SLionel Sambuc  * to or modifications of the Original Intel Code.  No other license or right
36*433d6423SLionel Sambuc  * is granted directly or by implication, estoppel or otherwise;
37*433d6423SLionel Sambuc  *
38*433d6423SLionel Sambuc  * The above copyright and patent license is granted only if the following
39*433d6423SLionel Sambuc  * conditions are met:
40*433d6423SLionel Sambuc  *
41*433d6423SLionel Sambuc  * 3. Conditions
42*433d6423SLionel Sambuc  *
43*433d6423SLionel Sambuc  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44*433d6423SLionel Sambuc  * Redistribution of source code of any substantial portion of the Covered
45*433d6423SLionel Sambuc  * Code or modification with rights to further distribute source must include
46*433d6423SLionel Sambuc  * the above Copyright Notice, the above License, this list of Conditions,
47*433d6423SLionel Sambuc  * and the following Disclaimer and Export Compliance provision.  In addition,
48*433d6423SLionel Sambuc  * Licensee must cause all Covered Code to which Licensee contributes to
49*433d6423SLionel Sambuc  * contain a file documenting the changes Licensee made to create that Covered
50*433d6423SLionel Sambuc  * Code and the date of any change.  Licensee must include in that file the
51*433d6423SLionel Sambuc  * documentation of any changes made by any predecessor Licensee.  Licensee
52*433d6423SLionel Sambuc  * must include a prominent statement that the modification is derived,
53*433d6423SLionel Sambuc  * directly or indirectly, from Original Intel Code.
54*433d6423SLionel Sambuc  *
55*433d6423SLionel Sambuc  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56*433d6423SLionel Sambuc  * Redistribution of source code of any substantial portion of the Covered
57*433d6423SLionel Sambuc  * Code or modification without rights to further distribute source must
58*433d6423SLionel Sambuc  * include the following Disclaimer and Export Compliance provision in the
59*433d6423SLionel Sambuc  * documentation and/or other materials provided with distribution.  In
60*433d6423SLionel Sambuc  * addition, Licensee may not authorize further sublicense of source of any
61*433d6423SLionel Sambuc  * portion of the Covered Code, and must include terms to the effect that the
62*433d6423SLionel Sambuc  * license from Licensee to its licensee is limited to the intellectual
63*433d6423SLionel Sambuc  * property embodied in the software Licensee provides to its licensee, and
64*433d6423SLionel Sambuc  * not to intellectual property embodied in modifications its licensee may
65*433d6423SLionel Sambuc  * make.
66*433d6423SLionel Sambuc  *
67*433d6423SLionel Sambuc  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68*433d6423SLionel Sambuc  * substantial portion of the Covered Code or modification must reproduce the
69*433d6423SLionel Sambuc  * above Copyright Notice, and the following Disclaimer and Export Compliance
70*433d6423SLionel Sambuc  * provision in the documentation and/or other materials provided with the
71*433d6423SLionel Sambuc  * distribution.
72*433d6423SLionel Sambuc  *
73*433d6423SLionel Sambuc  * 3.4. Intel retains all right, title, and interest in and to the Original
74*433d6423SLionel Sambuc  * Intel Code.
75*433d6423SLionel Sambuc  *
76*433d6423SLionel Sambuc  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77*433d6423SLionel Sambuc  * Intel shall be used in advertising or otherwise to promote the sale, use or
78*433d6423SLionel Sambuc  * other dealings in products derived from or relating to the Covered Code
79*433d6423SLionel Sambuc  * without prior written authorization from Intel.
80*433d6423SLionel Sambuc  *
81*433d6423SLionel Sambuc  * 4. Disclaimer and Export Compliance
82*433d6423SLionel Sambuc  *
83*433d6423SLionel Sambuc  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84*433d6423SLionel Sambuc  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85*433d6423SLionel Sambuc  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86*433d6423SLionel Sambuc  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87*433d6423SLionel Sambuc  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88*433d6423SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89*433d6423SLionel Sambuc  * PARTICULAR PURPOSE.
90*433d6423SLionel Sambuc  *
91*433d6423SLionel Sambuc  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92*433d6423SLionel Sambuc  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93*433d6423SLionel Sambuc  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94*433d6423SLionel Sambuc  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95*433d6423SLionel Sambuc  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96*433d6423SLionel Sambuc  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97*433d6423SLionel Sambuc  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98*433d6423SLionel Sambuc  * LIMITED REMEDY.
99*433d6423SLionel Sambuc  *
100*433d6423SLionel Sambuc  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101*433d6423SLionel Sambuc  * software or system incorporating such software without first obtaining any
102*433d6423SLionel Sambuc  * required license or other approval from the U. S. Department of Commerce or
103*433d6423SLionel Sambuc  * any other agency or department of the United States Government.  In the
104*433d6423SLionel Sambuc  * event Licensee exports any such software from the United States or
105*433d6423SLionel Sambuc  * re-exports any such software from a foreign destination, Licensee shall
106*433d6423SLionel Sambuc  * ensure that the distribution and export/re-export of the software is in
107*433d6423SLionel Sambuc  * compliance with all laws, regulations, orders, or other restrictions of the
108*433d6423SLionel Sambuc  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109*433d6423SLionel Sambuc  * any of its subsidiaries will export/re-export any technical data, process,
110*433d6423SLionel Sambuc  * software, or service, directly or indirectly, to any country for which the
111*433d6423SLionel Sambuc  * United States government or any agency thereof requires an export license,
112*433d6423SLionel Sambuc  * other governmental approval, or letter of assurance, without first obtaining
113*433d6423SLionel Sambuc  * such license, approval or letter.
114*433d6423SLionel Sambuc  *
115*433d6423SLionel Sambuc  *****************************************************************************/
116*433d6423SLionel Sambuc 
117*433d6423SLionel Sambuc #define __NSDUMP_C__
118*433d6423SLionel Sambuc 
119*433d6423SLionel Sambuc #include "acpi.h"
120*433d6423SLionel Sambuc #include "accommon.h"
121*433d6423SLionel Sambuc #include "acnamesp.h"
122*433d6423SLionel Sambuc 
123*433d6423SLionel Sambuc 
124*433d6423SLionel Sambuc #define _COMPONENT          ACPI_NAMESPACE
125*433d6423SLionel Sambuc         ACPI_MODULE_NAME    ("nsdump")
126*433d6423SLionel Sambuc 
127*433d6423SLionel Sambuc /* Local prototypes */
128*433d6423SLionel Sambuc 
129*433d6423SLionel Sambuc #ifdef ACPI_OBSOLETE_FUNCTIONS
130*433d6423SLionel Sambuc void
131*433d6423SLionel Sambuc AcpiNsDumpRootDevices (
132*433d6423SLionel Sambuc     void);
133*433d6423SLionel Sambuc 
134*433d6423SLionel Sambuc static ACPI_STATUS
135*433d6423SLionel Sambuc AcpiNsDumpOneDevice (
136*433d6423SLionel Sambuc     ACPI_HANDLE             ObjHandle,
137*433d6423SLionel Sambuc     UINT32                  Level,
138*433d6423SLionel Sambuc     void                    *Context,
139*433d6423SLionel Sambuc     void                    **ReturnValue);
140*433d6423SLionel Sambuc #endif
141*433d6423SLionel Sambuc 
142*433d6423SLionel Sambuc 
143*433d6423SLionel Sambuc #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
144*433d6423SLionel Sambuc /*******************************************************************************
145*433d6423SLionel Sambuc  *
146*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsPrintPathname
147*433d6423SLionel Sambuc  *
148*433d6423SLionel Sambuc  * PARAMETERS:  NumSegments         - Number of ACPI name segments
149*433d6423SLionel Sambuc  *              Pathname            - The compressed (internal) path
150*433d6423SLionel Sambuc  *
151*433d6423SLionel Sambuc  * RETURN:      None
152*433d6423SLionel Sambuc  *
153*433d6423SLionel Sambuc  * DESCRIPTION: Print an object's full namespace pathname
154*433d6423SLionel Sambuc  *
155*433d6423SLionel Sambuc  ******************************************************************************/
156*433d6423SLionel Sambuc 
157*433d6423SLionel Sambuc void
158*433d6423SLionel Sambuc AcpiNsPrintPathname (
159*433d6423SLionel Sambuc     UINT32                  NumSegments,
160*433d6423SLionel Sambuc     char                    *Pathname)
161*433d6423SLionel Sambuc {
162*433d6423SLionel Sambuc     UINT32                  i;
163*433d6423SLionel Sambuc 
164*433d6423SLionel Sambuc 
165*433d6423SLionel Sambuc     ACPI_FUNCTION_NAME (NsPrintPathname);
166*433d6423SLionel Sambuc 
167*433d6423SLionel Sambuc 
168*433d6423SLionel Sambuc     if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE))
169*433d6423SLionel Sambuc     {
170*433d6423SLionel Sambuc         return;
171*433d6423SLionel Sambuc     }
172*433d6423SLionel Sambuc 
173*433d6423SLionel Sambuc     /* Print the entire name */
174*433d6423SLionel Sambuc 
175*433d6423SLionel Sambuc     ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
176*433d6423SLionel Sambuc 
177*433d6423SLionel Sambuc     while (NumSegments)
178*433d6423SLionel Sambuc     {
179*433d6423SLionel Sambuc         for (i = 0; i < 4; i++)
180*433d6423SLionel Sambuc         {
181*433d6423SLionel Sambuc             ACPI_IS_PRINT (Pathname[i]) ?
182*433d6423SLionel Sambuc                 AcpiOsPrintf ("%c", Pathname[i]) :
183*433d6423SLionel Sambuc                 AcpiOsPrintf ("?");
184*433d6423SLionel Sambuc         }
185*433d6423SLionel Sambuc 
186*433d6423SLionel Sambuc         Pathname += ACPI_NAME_SIZE;
187*433d6423SLionel Sambuc         NumSegments--;
188*433d6423SLionel Sambuc         if (NumSegments)
189*433d6423SLionel Sambuc         {
190*433d6423SLionel Sambuc             AcpiOsPrintf (".");
191*433d6423SLionel Sambuc         }
192*433d6423SLionel Sambuc     }
193*433d6423SLionel Sambuc 
194*433d6423SLionel Sambuc     AcpiOsPrintf ("]\n");
195*433d6423SLionel Sambuc }
196*433d6423SLionel Sambuc 
197*433d6423SLionel Sambuc 
198*433d6423SLionel Sambuc /*******************************************************************************
199*433d6423SLionel Sambuc  *
200*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsDumpPathname
201*433d6423SLionel Sambuc  *
202*433d6423SLionel Sambuc  * PARAMETERS:  Handle              - Object
203*433d6423SLionel Sambuc  *              Msg                 - Prefix message
204*433d6423SLionel Sambuc  *              Level               - Desired debug level
205*433d6423SLionel Sambuc  *              Component           - Caller's component ID
206*433d6423SLionel Sambuc  *
207*433d6423SLionel Sambuc  * RETURN:      None
208*433d6423SLionel Sambuc  *
209*433d6423SLionel Sambuc  * DESCRIPTION: Print an object's full namespace pathname
210*433d6423SLionel Sambuc  *              Manages allocation/freeing of a pathname buffer
211*433d6423SLionel Sambuc  *
212*433d6423SLionel Sambuc  ******************************************************************************/
213*433d6423SLionel Sambuc 
214*433d6423SLionel Sambuc void
215*433d6423SLionel Sambuc AcpiNsDumpPathname (
216*433d6423SLionel Sambuc     ACPI_HANDLE             Handle,
217*433d6423SLionel Sambuc     char                    *Msg,
218*433d6423SLionel Sambuc     UINT32                  Level,
219*433d6423SLionel Sambuc     UINT32                  Component)
220*433d6423SLionel Sambuc {
221*433d6423SLionel Sambuc 
222*433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (NsDumpPathname);
223*433d6423SLionel Sambuc 
224*433d6423SLionel Sambuc 
225*433d6423SLionel Sambuc     /* Do this only if the requested debug level and component are enabled */
226*433d6423SLionel Sambuc 
227*433d6423SLionel Sambuc     if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
228*433d6423SLionel Sambuc     {
229*433d6423SLionel Sambuc         return_VOID;
230*433d6423SLionel Sambuc     }
231*433d6423SLionel Sambuc 
232*433d6423SLionel Sambuc     /* Convert handle to a full pathname and print it (with supplied message) */
233*433d6423SLionel Sambuc 
234*433d6423SLionel Sambuc     AcpiNsPrintNodePathname (Handle, Msg);
235*433d6423SLionel Sambuc     AcpiOsPrintf ("\n");
236*433d6423SLionel Sambuc     return_VOID;
237*433d6423SLionel Sambuc }
238*433d6423SLionel Sambuc 
239*433d6423SLionel Sambuc 
240*433d6423SLionel Sambuc /*******************************************************************************
241*433d6423SLionel Sambuc  *
242*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsDumpOneObject
243*433d6423SLionel Sambuc  *
244*433d6423SLionel Sambuc  * PARAMETERS:  ObjHandle           - Node to be dumped
245*433d6423SLionel Sambuc  *              Level               - Nesting level of the handle
246*433d6423SLionel Sambuc  *              Context             - Passed into WalkNamespace
247*433d6423SLionel Sambuc  *              ReturnValue         - Not used
248*433d6423SLionel Sambuc  *
249*433d6423SLionel Sambuc  * RETURN:      Status
250*433d6423SLionel Sambuc  *
251*433d6423SLionel Sambuc  * DESCRIPTION: Dump a single Node
252*433d6423SLionel Sambuc  *              This procedure is a UserFunction called by AcpiNsWalkNamespace.
253*433d6423SLionel Sambuc  *
254*433d6423SLionel Sambuc  ******************************************************************************/
255*433d6423SLionel Sambuc 
256*433d6423SLionel Sambuc ACPI_STATUS
257*433d6423SLionel Sambuc AcpiNsDumpOneObject (
258*433d6423SLionel Sambuc     ACPI_HANDLE             ObjHandle,
259*433d6423SLionel Sambuc     UINT32                  Level,
260*433d6423SLionel Sambuc     void                    *Context,
261*433d6423SLionel Sambuc     void                    **ReturnValue)
262*433d6423SLionel Sambuc {
263*433d6423SLionel Sambuc     ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
264*433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE     *ThisNode;
265*433d6423SLionel Sambuc     ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
266*433d6423SLionel Sambuc     ACPI_OBJECT_TYPE        ObjType;
267*433d6423SLionel Sambuc     ACPI_OBJECT_TYPE        Type;
268*433d6423SLionel Sambuc     UINT32                  BytesToDump;
269*433d6423SLionel Sambuc     UINT32                  DbgLevel;
270*433d6423SLionel Sambuc     UINT32                  i;
271*433d6423SLionel Sambuc 
272*433d6423SLionel Sambuc 
273*433d6423SLionel Sambuc     ACPI_FUNCTION_NAME (NsDumpOneObject);
274*433d6423SLionel Sambuc 
275*433d6423SLionel Sambuc 
276*433d6423SLionel Sambuc     /* Is output enabled? */
277*433d6423SLionel Sambuc 
278*433d6423SLionel Sambuc     if (!(AcpiDbgLevel & Info->DebugLevel))
279*433d6423SLionel Sambuc     {
280*433d6423SLionel Sambuc         return (AE_OK);
281*433d6423SLionel Sambuc     }
282*433d6423SLionel Sambuc 
283*433d6423SLionel Sambuc     if (!ObjHandle)
284*433d6423SLionel Sambuc     {
285*433d6423SLionel Sambuc         ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
286*433d6423SLionel Sambuc         return (AE_OK);
287*433d6423SLionel Sambuc     }
288*433d6423SLionel Sambuc 
289*433d6423SLionel Sambuc     ThisNode = AcpiNsValidateHandle (ObjHandle);
290*433d6423SLionel Sambuc     if (!ThisNode)
291*433d6423SLionel Sambuc     {
292*433d6423SLionel Sambuc         ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n",
293*433d6423SLionel Sambuc             ObjHandle));
294*433d6423SLionel Sambuc         return (AE_OK);
295*433d6423SLionel Sambuc     }
296*433d6423SLionel Sambuc 
297*433d6423SLionel Sambuc     Type = ThisNode->Type;
298*433d6423SLionel Sambuc 
299*433d6423SLionel Sambuc     /* Check if the owner matches */
300*433d6423SLionel Sambuc 
301*433d6423SLionel Sambuc     if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&
302*433d6423SLionel Sambuc         (Info->OwnerId != ThisNode->OwnerId))
303*433d6423SLionel Sambuc     {
304*433d6423SLionel Sambuc         return (AE_OK);
305*433d6423SLionel Sambuc     }
306*433d6423SLionel Sambuc 
307*433d6423SLionel Sambuc     if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))
308*433d6423SLionel Sambuc     {
309*433d6423SLionel Sambuc         /* Indent the object according to the level */
310*433d6423SLionel Sambuc 
311*433d6423SLionel Sambuc         AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
312*433d6423SLionel Sambuc 
313*433d6423SLionel Sambuc         /* Check the node type and name */
314*433d6423SLionel Sambuc 
315*433d6423SLionel Sambuc         if (Type > ACPI_TYPE_LOCAL_MAX)
316*433d6423SLionel Sambuc         {
317*433d6423SLionel Sambuc             ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type));
318*433d6423SLionel Sambuc         }
319*433d6423SLionel Sambuc 
320*433d6423SLionel Sambuc         AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
321*433d6423SLionel Sambuc     }
322*433d6423SLionel Sambuc 
323*433d6423SLionel Sambuc     /* Now we can print out the pertinent information */
324*433d6423SLionel Sambuc 
325*433d6423SLionel Sambuc     AcpiOsPrintf (" %-12s %p %2.2X ",
326*433d6423SLionel Sambuc             AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
327*433d6423SLionel Sambuc 
328*433d6423SLionel Sambuc     DbgLevel = AcpiDbgLevel;
329*433d6423SLionel Sambuc     AcpiDbgLevel = 0;
330*433d6423SLionel Sambuc     ObjDesc = AcpiNsGetAttachedObject (ThisNode);
331*433d6423SLionel Sambuc     AcpiDbgLevel = DbgLevel;
332*433d6423SLionel Sambuc 
333*433d6423SLionel Sambuc     /* Temp nodes are those nodes created by a control method */
334*433d6423SLionel Sambuc 
335*433d6423SLionel Sambuc     if (ThisNode->Flags & ANOBJ_TEMPORARY)
336*433d6423SLionel Sambuc     {
337*433d6423SLionel Sambuc         AcpiOsPrintf ("(T) ");
338*433d6423SLionel Sambuc     }
339*433d6423SLionel Sambuc 
340*433d6423SLionel Sambuc     switch (Info->DisplayType & ACPI_DISPLAY_MASK)
341*433d6423SLionel Sambuc     {
342*433d6423SLionel Sambuc     case ACPI_DISPLAY_SUMMARY:
343*433d6423SLionel Sambuc 
344*433d6423SLionel Sambuc         if (!ObjDesc)
345*433d6423SLionel Sambuc         {
346*433d6423SLionel Sambuc             /* No attached object, we are done */
347*433d6423SLionel Sambuc 
348*433d6423SLionel Sambuc             AcpiOsPrintf ("\n");
349*433d6423SLionel Sambuc             return (AE_OK);
350*433d6423SLionel Sambuc         }
351*433d6423SLionel Sambuc 
352*433d6423SLionel Sambuc         switch (Type)
353*433d6423SLionel Sambuc         {
354*433d6423SLionel Sambuc         case ACPI_TYPE_PROCESSOR:
355*433d6423SLionel Sambuc 
356*433d6423SLionel Sambuc             AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
357*433d6423SLionel Sambuc                 ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
358*433d6423SLionel Sambuc                 ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
359*433d6423SLionel Sambuc             break;
360*433d6423SLionel Sambuc 
361*433d6423SLionel Sambuc 
362*433d6423SLionel Sambuc         case ACPI_TYPE_DEVICE:
363*433d6423SLionel Sambuc 
364*433d6423SLionel Sambuc             AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
365*433d6423SLionel Sambuc             break;
366*433d6423SLionel Sambuc 
367*433d6423SLionel Sambuc 
368*433d6423SLionel Sambuc         case ACPI_TYPE_METHOD:
369*433d6423SLionel Sambuc 
370*433d6423SLionel Sambuc             AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
371*433d6423SLionel Sambuc                 (UINT32) ObjDesc->Method.ParamCount,
372*433d6423SLionel Sambuc                 ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
373*433d6423SLionel Sambuc             break;
374*433d6423SLionel Sambuc 
375*433d6423SLionel Sambuc 
376*433d6423SLionel Sambuc         case ACPI_TYPE_INTEGER:
377*433d6423SLionel Sambuc 
378*433d6423SLionel Sambuc             AcpiOsPrintf ("= %8.8X%8.8X\n",
379*433d6423SLionel Sambuc                 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
380*433d6423SLionel Sambuc             break;
381*433d6423SLionel Sambuc 
382*433d6423SLionel Sambuc 
383*433d6423SLionel Sambuc         case ACPI_TYPE_PACKAGE:
384*433d6423SLionel Sambuc 
385*433d6423SLionel Sambuc             if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
386*433d6423SLionel Sambuc             {
387*433d6423SLionel Sambuc                 AcpiOsPrintf ("Elements %.2X\n",
388*433d6423SLionel Sambuc                     ObjDesc->Package.Count);
389*433d6423SLionel Sambuc             }
390*433d6423SLionel Sambuc             else
391*433d6423SLionel Sambuc             {
392*433d6423SLionel Sambuc                 AcpiOsPrintf ("[Length not yet evaluated]\n");
393*433d6423SLionel Sambuc             }
394*433d6423SLionel Sambuc             break;
395*433d6423SLionel Sambuc 
396*433d6423SLionel Sambuc 
397*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER:
398*433d6423SLionel Sambuc 
399*433d6423SLionel Sambuc             if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
400*433d6423SLionel Sambuc             {
401*433d6423SLionel Sambuc                 AcpiOsPrintf ("Len %.2X",
402*433d6423SLionel Sambuc                             ObjDesc->Buffer.Length);
403*433d6423SLionel Sambuc 
404*433d6423SLionel Sambuc                 /* Dump some of the buffer */
405*433d6423SLionel Sambuc 
406*433d6423SLionel Sambuc                 if (ObjDesc->Buffer.Length > 0)
407*433d6423SLionel Sambuc                 {
408*433d6423SLionel Sambuc                     AcpiOsPrintf (" =");
409*433d6423SLionel Sambuc                     for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
410*433d6423SLionel Sambuc                     {
411*433d6423SLionel Sambuc                         AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
412*433d6423SLionel Sambuc                     }
413*433d6423SLionel Sambuc                 }
414*433d6423SLionel Sambuc                 AcpiOsPrintf ("\n");
415*433d6423SLionel Sambuc             }
416*433d6423SLionel Sambuc             else
417*433d6423SLionel Sambuc             {
418*433d6423SLionel Sambuc                 AcpiOsPrintf ("[Length not yet evaluated]\n");
419*433d6423SLionel Sambuc             }
420*433d6423SLionel Sambuc             break;
421*433d6423SLionel Sambuc 
422*433d6423SLionel Sambuc 
423*433d6423SLionel Sambuc         case ACPI_TYPE_STRING:
424*433d6423SLionel Sambuc 
425*433d6423SLionel Sambuc             AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
426*433d6423SLionel Sambuc             AcpiUtPrintString (ObjDesc->String.Pointer, 32);
427*433d6423SLionel Sambuc             AcpiOsPrintf ("\n");
428*433d6423SLionel Sambuc             break;
429*433d6423SLionel Sambuc 
430*433d6423SLionel Sambuc 
431*433d6423SLionel Sambuc         case ACPI_TYPE_REGION:
432*433d6423SLionel Sambuc 
433*433d6423SLionel Sambuc             AcpiOsPrintf ("[%s]",
434*433d6423SLionel Sambuc                 AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
435*433d6423SLionel Sambuc             if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
436*433d6423SLionel Sambuc             {
437*433d6423SLionel Sambuc                 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
438*433d6423SLionel Sambuc                     ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
439*433d6423SLionel Sambuc                     ObjDesc->Region.Length);
440*433d6423SLionel Sambuc             }
441*433d6423SLionel Sambuc             else
442*433d6423SLionel Sambuc             {
443*433d6423SLionel Sambuc                 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
444*433d6423SLionel Sambuc             }
445*433d6423SLionel Sambuc             break;
446*433d6423SLionel Sambuc 
447*433d6423SLionel Sambuc 
448*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_REFERENCE:
449*433d6423SLionel Sambuc 
450*433d6423SLionel Sambuc             AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc));
451*433d6423SLionel Sambuc             break;
452*433d6423SLionel Sambuc 
453*433d6423SLionel Sambuc 
454*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER_FIELD:
455*433d6423SLionel Sambuc 
456*433d6423SLionel Sambuc             if (ObjDesc->BufferField.BufferObj &&
457*433d6423SLionel Sambuc                 ObjDesc->BufferField.BufferObj->Buffer.Node)
458*433d6423SLionel Sambuc             {
459*433d6423SLionel Sambuc                 AcpiOsPrintf ("Buf [%4.4s]",
460*433d6423SLionel Sambuc                     AcpiUtGetNodeName (
461*433d6423SLionel Sambuc                         ObjDesc->BufferField.BufferObj->Buffer.Node));
462*433d6423SLionel Sambuc             }
463*433d6423SLionel Sambuc             break;
464*433d6423SLionel Sambuc 
465*433d6423SLionel Sambuc 
466*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_REGION_FIELD:
467*433d6423SLionel Sambuc 
468*433d6423SLionel Sambuc             AcpiOsPrintf ("Rgn [%4.4s]",
469*433d6423SLionel Sambuc                 AcpiUtGetNodeName (
470*433d6423SLionel Sambuc                     ObjDesc->CommonField.RegionObj->Region.Node));
471*433d6423SLionel Sambuc             break;
472*433d6423SLionel Sambuc 
473*433d6423SLionel Sambuc 
474*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_BANK_FIELD:
475*433d6423SLionel Sambuc 
476*433d6423SLionel Sambuc             AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
477*433d6423SLionel Sambuc                 AcpiUtGetNodeName (
478*433d6423SLionel Sambuc                     ObjDesc->CommonField.RegionObj->Region.Node),
479*433d6423SLionel Sambuc                 AcpiUtGetNodeName (
480*433d6423SLionel Sambuc                     ObjDesc->BankField.BankObj->CommonField.Node));
481*433d6423SLionel Sambuc             break;
482*433d6423SLionel Sambuc 
483*433d6423SLionel Sambuc 
484*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_INDEX_FIELD:
485*433d6423SLionel Sambuc 
486*433d6423SLionel Sambuc             AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
487*433d6423SLionel Sambuc                 AcpiUtGetNodeName (
488*433d6423SLionel Sambuc                     ObjDesc->IndexField.IndexObj->CommonField.Node),
489*433d6423SLionel Sambuc                 AcpiUtGetNodeName (
490*433d6423SLionel Sambuc                     ObjDesc->IndexField.DataObj->CommonField.Node));
491*433d6423SLionel Sambuc             break;
492*433d6423SLionel Sambuc 
493*433d6423SLionel Sambuc 
494*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_ALIAS:
495*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_METHOD_ALIAS:
496*433d6423SLionel Sambuc 
497*433d6423SLionel Sambuc             AcpiOsPrintf ("Target %4.4s (%p)\n",
498*433d6423SLionel Sambuc                 AcpiUtGetNodeName (ObjDesc), ObjDesc);
499*433d6423SLionel Sambuc             break;
500*433d6423SLionel Sambuc 
501*433d6423SLionel Sambuc         default:
502*433d6423SLionel Sambuc 
503*433d6423SLionel Sambuc             AcpiOsPrintf ("Object %p\n", ObjDesc);
504*433d6423SLionel Sambuc             break;
505*433d6423SLionel Sambuc         }
506*433d6423SLionel Sambuc 
507*433d6423SLionel Sambuc         /* Common field handling */
508*433d6423SLionel Sambuc 
509*433d6423SLionel Sambuc         switch (Type)
510*433d6423SLionel Sambuc         {
511*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER_FIELD:
512*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_REGION_FIELD:
513*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_BANK_FIELD:
514*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_INDEX_FIELD:
515*433d6423SLionel Sambuc 
516*433d6423SLionel Sambuc             AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
517*433d6423SLionel Sambuc                 (ObjDesc->CommonField.BaseByteOffset * 8)
518*433d6423SLionel Sambuc                     + ObjDesc->CommonField.StartFieldBitOffset,
519*433d6423SLionel Sambuc                 ObjDesc->CommonField.BitLength,
520*433d6423SLionel Sambuc                 ObjDesc->CommonField.AccessByteWidth);
521*433d6423SLionel Sambuc             break;
522*433d6423SLionel Sambuc 
523*433d6423SLionel Sambuc         default:
524*433d6423SLionel Sambuc             break;
525*433d6423SLionel Sambuc         }
526*433d6423SLionel Sambuc         break;
527*433d6423SLionel Sambuc 
528*433d6423SLionel Sambuc 
529*433d6423SLionel Sambuc     case ACPI_DISPLAY_OBJECTS:
530*433d6423SLionel Sambuc 
531*433d6423SLionel Sambuc         AcpiOsPrintf ("O:%p", ObjDesc);
532*433d6423SLionel Sambuc         if (!ObjDesc)
533*433d6423SLionel Sambuc         {
534*433d6423SLionel Sambuc             /* No attached object, we are done */
535*433d6423SLionel Sambuc 
536*433d6423SLionel Sambuc             AcpiOsPrintf ("\n");
537*433d6423SLionel Sambuc             return (AE_OK);
538*433d6423SLionel Sambuc         }
539*433d6423SLionel Sambuc 
540*433d6423SLionel Sambuc         AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
541*433d6423SLionel Sambuc 
542*433d6423SLionel Sambuc         switch (Type)
543*433d6423SLionel Sambuc         {
544*433d6423SLionel Sambuc         case ACPI_TYPE_METHOD:
545*433d6423SLionel Sambuc 
546*433d6423SLionel Sambuc             /* Name is a Method and its AML offset/length are set */
547*433d6423SLionel Sambuc 
548*433d6423SLionel Sambuc             AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
549*433d6423SLionel Sambuc                 ObjDesc->Method.AmlLength);
550*433d6423SLionel Sambuc             break;
551*433d6423SLionel Sambuc 
552*433d6423SLionel Sambuc         case ACPI_TYPE_INTEGER:
553*433d6423SLionel Sambuc 
554*433d6423SLionel Sambuc             AcpiOsPrintf (" I:%8.8X8.8%X\n",
555*433d6423SLionel Sambuc                 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
556*433d6423SLionel Sambuc             break;
557*433d6423SLionel Sambuc 
558*433d6423SLionel Sambuc         case ACPI_TYPE_STRING:
559*433d6423SLionel Sambuc 
560*433d6423SLionel Sambuc             AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
561*433d6423SLionel Sambuc                 ObjDesc->String.Length);
562*433d6423SLionel Sambuc             break;
563*433d6423SLionel Sambuc 
564*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER:
565*433d6423SLionel Sambuc 
566*433d6423SLionel Sambuc             AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
567*433d6423SLionel Sambuc                 ObjDesc->Buffer.Length);
568*433d6423SLionel Sambuc             break;
569*433d6423SLionel Sambuc 
570*433d6423SLionel Sambuc         default:
571*433d6423SLionel Sambuc 
572*433d6423SLionel Sambuc             AcpiOsPrintf ("\n");
573*433d6423SLionel Sambuc             break;
574*433d6423SLionel Sambuc         }
575*433d6423SLionel Sambuc         break;
576*433d6423SLionel Sambuc 
577*433d6423SLionel Sambuc 
578*433d6423SLionel Sambuc     default:
579*433d6423SLionel Sambuc         AcpiOsPrintf ("\n");
580*433d6423SLionel Sambuc         break;
581*433d6423SLionel Sambuc     }
582*433d6423SLionel Sambuc 
583*433d6423SLionel Sambuc     /* If debug turned off, done */
584*433d6423SLionel Sambuc 
585*433d6423SLionel Sambuc     if (!(AcpiDbgLevel & ACPI_LV_VALUES))
586*433d6423SLionel Sambuc     {
587*433d6423SLionel Sambuc         return (AE_OK);
588*433d6423SLionel Sambuc     }
589*433d6423SLionel Sambuc 
590*433d6423SLionel Sambuc     /* If there is an attached object, display it */
591*433d6423SLionel Sambuc 
592*433d6423SLionel Sambuc     DbgLevel     = AcpiDbgLevel;
593*433d6423SLionel Sambuc     AcpiDbgLevel = 0;
594*433d6423SLionel Sambuc     ObjDesc      = AcpiNsGetAttachedObject (ThisNode);
595*433d6423SLionel Sambuc     AcpiDbgLevel = DbgLevel;
596*433d6423SLionel Sambuc 
597*433d6423SLionel Sambuc     /* Dump attached objects */
598*433d6423SLionel Sambuc 
599*433d6423SLionel Sambuc     while (ObjDesc)
600*433d6423SLionel Sambuc     {
601*433d6423SLionel Sambuc         ObjType = ACPI_TYPE_INVALID;
602*433d6423SLionel Sambuc         AcpiOsPrintf ("Attached Object %p: ", ObjDesc);
603*433d6423SLionel Sambuc 
604*433d6423SLionel Sambuc         /* Decode the type of attached object and dump the contents */
605*433d6423SLionel Sambuc 
606*433d6423SLionel Sambuc         switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
607*433d6423SLionel Sambuc         {
608*433d6423SLionel Sambuc         case ACPI_DESC_TYPE_NAMED:
609*433d6423SLionel Sambuc 
610*433d6423SLionel Sambuc             AcpiOsPrintf ("(Ptr to Node)\n");
611*433d6423SLionel Sambuc             BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
612*433d6423SLionel Sambuc             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
613*433d6423SLionel Sambuc             break;
614*433d6423SLionel Sambuc 
615*433d6423SLionel Sambuc         case ACPI_DESC_TYPE_OPERAND:
616*433d6423SLionel Sambuc 
617*433d6423SLionel Sambuc             ObjType = ObjDesc->Common.Type;
618*433d6423SLionel Sambuc 
619*433d6423SLionel Sambuc             if (ObjType > ACPI_TYPE_LOCAL_MAX)
620*433d6423SLionel Sambuc             {
621*433d6423SLionel Sambuc                 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
622*433d6423SLionel Sambuc                     ObjType);
623*433d6423SLionel Sambuc                 BytesToDump = 32;
624*433d6423SLionel Sambuc             }
625*433d6423SLionel Sambuc             else
626*433d6423SLionel Sambuc             {
627*433d6423SLionel Sambuc                 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
628*433d6423SLionel Sambuc                     ObjType, AcpiUtGetTypeName (ObjType));
629*433d6423SLionel Sambuc                 BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
630*433d6423SLionel Sambuc             }
631*433d6423SLionel Sambuc 
632*433d6423SLionel Sambuc             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
633*433d6423SLionel Sambuc             break;
634*433d6423SLionel Sambuc 
635*433d6423SLionel Sambuc         default:
636*433d6423SLionel Sambuc 
637*433d6423SLionel Sambuc             break;
638*433d6423SLionel Sambuc         }
639*433d6423SLionel Sambuc 
640*433d6423SLionel Sambuc         /* If value is NOT an internal object, we are done */
641*433d6423SLionel Sambuc 
642*433d6423SLionel Sambuc         if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
643*433d6423SLionel Sambuc         {
644*433d6423SLionel Sambuc             goto Cleanup;
645*433d6423SLionel Sambuc         }
646*433d6423SLionel Sambuc 
647*433d6423SLionel Sambuc         /* Valid object, get the pointer to next level, if any */
648*433d6423SLionel Sambuc 
649*433d6423SLionel Sambuc         switch (ObjType)
650*433d6423SLionel Sambuc         {
651*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER:
652*433d6423SLionel Sambuc         case ACPI_TYPE_STRING:
653*433d6423SLionel Sambuc             /*
654*433d6423SLionel Sambuc              * NOTE: takes advantage of common fields between string/buffer
655*433d6423SLionel Sambuc              */
656*433d6423SLionel Sambuc             BytesToDump = ObjDesc->String.Length;
657*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->String.Pointer;
658*433d6423SLionel Sambuc             AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
659*433d6423SLionel Sambuc                 ObjDesc, BytesToDump);
660*433d6423SLionel Sambuc             ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
661*433d6423SLionel Sambuc             goto Cleanup;
662*433d6423SLionel Sambuc 
663*433d6423SLionel Sambuc         case ACPI_TYPE_BUFFER_FIELD:
664*433d6423SLionel Sambuc             ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
665*433d6423SLionel Sambuc             break;
666*433d6423SLionel Sambuc 
667*433d6423SLionel Sambuc         case ACPI_TYPE_PACKAGE:
668*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->Package.Elements;
669*433d6423SLionel Sambuc             break;
670*433d6423SLionel Sambuc 
671*433d6423SLionel Sambuc         case ACPI_TYPE_METHOD:
672*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->Method.AmlStart;
673*433d6423SLionel Sambuc             break;
674*433d6423SLionel Sambuc 
675*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_REGION_FIELD:
676*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->Field.RegionObj;
677*433d6423SLionel Sambuc             break;
678*433d6423SLionel Sambuc 
679*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_BANK_FIELD:
680*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->BankField.RegionObj;
681*433d6423SLionel Sambuc             break;
682*433d6423SLionel Sambuc 
683*433d6423SLionel Sambuc         case ACPI_TYPE_LOCAL_INDEX_FIELD:
684*433d6423SLionel Sambuc             ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
685*433d6423SLionel Sambuc             break;
686*433d6423SLionel Sambuc 
687*433d6423SLionel Sambuc         default:
688*433d6423SLionel Sambuc             goto Cleanup;
689*433d6423SLionel Sambuc         }
690*433d6423SLionel Sambuc 
691*433d6423SLionel Sambuc         ObjType = ACPI_TYPE_INVALID;   /* Terminate loop after next pass */
692*433d6423SLionel Sambuc     }
693*433d6423SLionel Sambuc 
694*433d6423SLionel Sambuc Cleanup:
695*433d6423SLionel Sambuc     AcpiOsPrintf ("\n");
696*433d6423SLionel Sambuc     return (AE_OK);
697*433d6423SLionel Sambuc }
698*433d6423SLionel Sambuc 
699*433d6423SLionel Sambuc 
700*433d6423SLionel Sambuc /*******************************************************************************
701*433d6423SLionel Sambuc  *
702*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsDumpObjects
703*433d6423SLionel Sambuc  *
704*433d6423SLionel Sambuc  * PARAMETERS:  Type                - Object type to be dumped
705*433d6423SLionel Sambuc  *              DisplayType         - 0 or ACPI_DISPLAY_SUMMARY
706*433d6423SLionel Sambuc  *              MaxDepth            - Maximum depth of dump. Use ACPI_UINT32_MAX
707*433d6423SLionel Sambuc  *                                    for an effectively unlimited depth.
708*433d6423SLionel Sambuc  *              OwnerId             - Dump only objects owned by this ID. Use
709*433d6423SLionel Sambuc  *                                    ACPI_UINT32_MAX to match all owners.
710*433d6423SLionel Sambuc  *              StartHandle         - Where in namespace to start/end search
711*433d6423SLionel Sambuc  *
712*433d6423SLionel Sambuc  * RETURN:      None
713*433d6423SLionel Sambuc  *
714*433d6423SLionel Sambuc  * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
715*433d6423SLionel Sambuc  *              AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
716*433d6423SLionel Sambuc  *
717*433d6423SLionel Sambuc  ******************************************************************************/
718*433d6423SLionel Sambuc 
719*433d6423SLionel Sambuc void
720*433d6423SLionel Sambuc AcpiNsDumpObjects (
721*433d6423SLionel Sambuc     ACPI_OBJECT_TYPE        Type,
722*433d6423SLionel Sambuc     UINT8                   DisplayType,
723*433d6423SLionel Sambuc     UINT32                  MaxDepth,
724*433d6423SLionel Sambuc     ACPI_OWNER_ID           OwnerId,
725*433d6423SLionel Sambuc     ACPI_HANDLE             StartHandle)
726*433d6423SLionel Sambuc {
727*433d6423SLionel Sambuc     ACPI_WALK_INFO          Info;
728*433d6423SLionel Sambuc 
729*433d6423SLionel Sambuc 
730*433d6423SLionel Sambuc     ACPI_FUNCTION_ENTRY ();
731*433d6423SLionel Sambuc 
732*433d6423SLionel Sambuc 
733*433d6423SLionel Sambuc     Info.DebugLevel = ACPI_LV_TABLES;
734*433d6423SLionel Sambuc     Info.OwnerId = OwnerId;
735*433d6423SLionel Sambuc     Info.DisplayType = DisplayType;
736*433d6423SLionel Sambuc 
737*433d6423SLionel Sambuc     (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
738*433d6423SLionel Sambuc                 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
739*433d6423SLionel Sambuc                 AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
740*433d6423SLionel Sambuc }
741*433d6423SLionel Sambuc 
742*433d6423SLionel Sambuc 
743*433d6423SLionel Sambuc /*******************************************************************************
744*433d6423SLionel Sambuc  *
745*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsDumpEntry
746*433d6423SLionel Sambuc  *
747*433d6423SLionel Sambuc  * PARAMETERS:  Handle              - Node to be dumped
748*433d6423SLionel Sambuc  *              DebugLevel          - Output level
749*433d6423SLionel Sambuc  *
750*433d6423SLionel Sambuc  * RETURN:      None
751*433d6423SLionel Sambuc  *
752*433d6423SLionel Sambuc  * DESCRIPTION: Dump a single Node
753*433d6423SLionel Sambuc  *
754*433d6423SLionel Sambuc  ******************************************************************************/
755*433d6423SLionel Sambuc 
756*433d6423SLionel Sambuc void
757*433d6423SLionel Sambuc AcpiNsDumpEntry (
758*433d6423SLionel Sambuc     ACPI_HANDLE             Handle,
759*433d6423SLionel Sambuc     UINT32                  DebugLevel)
760*433d6423SLionel Sambuc {
761*433d6423SLionel Sambuc     ACPI_WALK_INFO          Info;
762*433d6423SLionel Sambuc 
763*433d6423SLionel Sambuc 
764*433d6423SLionel Sambuc     ACPI_FUNCTION_ENTRY ();
765*433d6423SLionel Sambuc 
766*433d6423SLionel Sambuc 
767*433d6423SLionel Sambuc     Info.DebugLevel = DebugLevel;
768*433d6423SLionel Sambuc     Info.OwnerId = ACPI_OWNER_ID_MAX;
769*433d6423SLionel Sambuc     Info.DisplayType = ACPI_DISPLAY_SUMMARY;
770*433d6423SLionel Sambuc 
771*433d6423SLionel Sambuc     (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
772*433d6423SLionel Sambuc }
773*433d6423SLionel Sambuc 
774*433d6423SLionel Sambuc 
775*433d6423SLionel Sambuc #ifdef ACPI_ASL_COMPILER
776*433d6423SLionel Sambuc /*******************************************************************************
777*433d6423SLionel Sambuc  *
778*433d6423SLionel Sambuc  * FUNCTION:    AcpiNsDumpTables
779*433d6423SLionel Sambuc  *
780*433d6423SLionel Sambuc  * PARAMETERS:  SearchBase          - Root of subtree to be dumped, or
781*433d6423SLionel Sambuc  *                                    NS_ALL to dump the entire namespace
782*433d6423SLionel Sambuc  *              MaxDepth            - Maximum depth of dump.  Use INT_MAX
783*433d6423SLionel Sambuc  *                                    for an effectively unlimited depth.
784*433d6423SLionel Sambuc  *
785*433d6423SLionel Sambuc  * RETURN:      None
786*433d6423SLionel Sambuc  *
787*433d6423SLionel Sambuc  * DESCRIPTION: Dump the name space, or a portion of it.
788*433d6423SLionel Sambuc  *
789*433d6423SLionel Sambuc  ******************************************************************************/
790*433d6423SLionel Sambuc 
791*433d6423SLionel Sambuc void
792*433d6423SLionel Sambuc AcpiNsDumpTables (
793*433d6423SLionel Sambuc     ACPI_HANDLE             SearchBase,
794*433d6423SLionel Sambuc     UINT32                  MaxDepth)
795*433d6423SLionel Sambuc {
796*433d6423SLionel Sambuc     ACPI_HANDLE             SearchHandle = SearchBase;
797*433d6423SLionel Sambuc 
798*433d6423SLionel Sambuc 
799*433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (NsDumpTables);
800*433d6423SLionel Sambuc 
801*433d6423SLionel Sambuc 
802*433d6423SLionel Sambuc     if (!AcpiGbl_RootNode)
803*433d6423SLionel Sambuc     {
804*433d6423SLionel Sambuc         /*
805*433d6423SLionel Sambuc          * If the name space has not been initialized,
806*433d6423SLionel Sambuc          * there is nothing to dump.
807*433d6423SLionel Sambuc          */
808*433d6423SLionel Sambuc         ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
809*433d6423SLionel Sambuc         return_VOID;
810*433d6423SLionel Sambuc     }
811*433d6423SLionel Sambuc 
812*433d6423SLionel Sambuc     if (ACPI_NS_ALL == SearchBase)
813*433d6423SLionel Sambuc     {
814*433d6423SLionel Sambuc         /* Entire namespace */
815*433d6423SLionel Sambuc 
816*433d6423SLionel Sambuc         SearchHandle = AcpiGbl_RootNode;
817*433d6423SLionel Sambuc         ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
818*433d6423SLionel Sambuc     }
819*433d6423SLionel Sambuc 
820*433d6423SLionel Sambuc     AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
821*433d6423SLionel Sambuc             ACPI_OWNER_ID_MAX, SearchHandle);
822*433d6423SLionel Sambuc     return_VOID;
823*433d6423SLionel Sambuc }
824*433d6423SLionel Sambuc #endif
825*433d6423SLionel Sambuc #endif
826*433d6423SLionel Sambuc 
827