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