1 /******************************************************************************
3 * Module Name: exdump - Interpreter debug output routines
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
119 #include "accommon.h"
120 #include "acinterp.h"
122 #include "acnamesp.h"
125 #define _COMPONENT ACPI_EXECUTER
126 ACPI_MODULE_NAME ("exdump")
129 * The following routines are used for debug output only
131 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
133 /* Local prototypes */
147 ACPI_OPERAND_OBJECT
*ObjDesc
,
148 ACPI_EXDUMP_INFO
*Info
);
151 AcpiExDumpReferenceObj (
152 ACPI_OPERAND_OBJECT
*ObjDesc
);
155 AcpiExDumpPackageObj (
156 ACPI_OPERAND_OBJECT
*ObjDesc
,
161 /*******************************************************************************
163 * Object Descriptor info tables
165 * Note: The first table entry must be an INIT opcode and must contain
166 * the table length (number of table entries)
168 ******************************************************************************/
170 static ACPI_EXDUMP_INFO AcpiExDumpInteger
[2] =
172 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpInteger
), NULL
},
173 {ACPI_EXD_UINT64
, ACPI_EXD_OFFSET (Integer
.Value
), "Value"}
176 static ACPI_EXDUMP_INFO AcpiExDumpString
[4] =
178 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpString
), NULL
},
179 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (String
.Length
), "Length"},
180 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (String
.Pointer
), "Pointer"},
181 {ACPI_EXD_STRING
, 0, NULL
}
184 static ACPI_EXDUMP_INFO AcpiExDumpBuffer
[5] =
186 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer
), NULL
},
187 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Buffer
.Length
), "Length"},
188 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Buffer
.Pointer
), "Pointer"},
189 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Buffer
.Node
), "Parent Node"},
190 {ACPI_EXD_BUFFER
, 0, NULL
}
193 static ACPI_EXDUMP_INFO AcpiExDumpPackage
[6] =
195 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage
), NULL
},
196 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Package
.Node
), "Parent Node"},
197 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Package
.Flags
), "Flags"},
198 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Package
.Count
), "Elements"},
199 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Package
.Elements
), "Element List"},
200 {ACPI_EXD_PACKAGE
, 0, NULL
}
203 static ACPI_EXDUMP_INFO AcpiExDumpDevice
[4] =
205 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice
), NULL
},
206 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[0]), "System Notify"},
207 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[1]), "Device Notify"},
208 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Device
.Handler
), "Handler"}
211 static ACPI_EXDUMP_INFO AcpiExDumpEvent
[2] =
213 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent
), NULL
},
214 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Event
.OsSemaphore
), "OsSemaphore"}
217 static ACPI_EXDUMP_INFO AcpiExDumpMethod
[9] =
219 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod
), NULL
},
220 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.InfoFlags
), "Info Flags"},
221 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ParamCount
), "Parameter Count"},
222 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.SyncLevel
), "Sync Level"},
223 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.Mutex
), "Mutex"},
224 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.OwnerId
), "Owner Id"},
225 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ThreadCount
), "Thread Count"},
226 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Method
.AmlLength
), "Aml Length"},
227 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.AmlStart
), "Aml Start"}
230 static ACPI_EXDUMP_INFO AcpiExDumpMutex
[6] =
232 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex
), NULL
},
233 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.SyncLevel
), "Sync Level"},
234 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.OriginalSyncLevel
), "Original Sync Level"},
235 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OwnerThread
), "Owner Thread"},
236 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Mutex
.AcquisitionDepth
), "Acquire Depth"},
237 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OsMutex
), "OsMutex"}
240 static ACPI_EXDUMP_INFO AcpiExDumpRegion
[8] =
242 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion
), NULL
},
243 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.SpaceId
), "Space Id"},
244 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.Flags
), "Flags"},
245 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Region
.Node
), "Parent Node"},
246 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Region
.Address
), "Address"},
247 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Region
.Length
), "Length"},
248 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Region
.Handler
), "Handler"},
249 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Region
.Next
), "Next"}
252 static ACPI_EXDUMP_INFO AcpiExDumpPower
[6] =
254 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower
), NULL
},
255 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.SystemLevel
), "System Level"},
256 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.ResourceOrder
), "Resource Order"},
257 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[0]), "System Notify"},
258 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[1]), "Device Notify"},
259 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.Handler
), "Handler"}
262 static ACPI_EXDUMP_INFO AcpiExDumpProcessor
[7] =
264 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor
), NULL
},
265 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.ProcId
), "Processor ID"},
266 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.Length
), "Length"},
267 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Processor
.Address
), "Address"},
268 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[0]), "System Notify"},
269 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[1]), "Device Notify"},
270 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.Handler
), "Handler"}
273 static ACPI_EXDUMP_INFO AcpiExDumpThermal
[4] =
275 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal
), NULL
},
276 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[0]), "System Notify"},
277 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[1]), "Device Notify"},
278 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.Handler
), "Handler"}
281 static ACPI_EXDUMP_INFO AcpiExDumpBufferField
[3] =
283 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField
), NULL
},
284 {ACPI_EXD_FIELD
, 0, NULL
},
285 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BufferField
.BufferObj
), "Buffer Object"}
288 static ACPI_EXDUMP_INFO AcpiExDumpRegionField
[5] =
290 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField
), NULL
},
291 {ACPI_EXD_FIELD
, 0, NULL
},
292 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Field
.AccessLength
), "AccessLength"},
293 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.RegionObj
), "Region Object"},
294 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.ResourceBuffer
), "ResourceBuffer"}
297 static ACPI_EXDUMP_INFO AcpiExDumpBankField
[5] =
299 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
300 {ACPI_EXD_FIELD
, 0, NULL
},
301 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (BankField
.Value
), "Value"},
302 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.RegionObj
), "Region Object"},
303 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.BankObj
), "Bank Object"}
306 static ACPI_EXDUMP_INFO AcpiExDumpIndexField
[5] =
308 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
309 {ACPI_EXD_FIELD
, 0, NULL
},
310 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (IndexField
.Value
), "Value"},
311 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.IndexObj
), "Index Object"},
312 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.DataObj
), "Data Object"}
315 static ACPI_EXDUMP_INFO AcpiExDumpReference
[8] =
317 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference
), NULL
},
318 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.Class
), "Class"},
319 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.TargetType
), "Target Type"},
320 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Reference
.Value
), "Value"},
321 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Object
), "Object Desc"},
322 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Reference
.Node
), "Node"},
323 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Where
), "Where"},
324 {ACPI_EXD_REFERENCE
,0, NULL
}
327 static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler
[6] =
329 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler
), NULL
},
330 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (AddressSpace
.SpaceId
), "Space Id"},
331 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (AddressSpace
.Next
), "Next"},
332 {ACPI_EXD_RGN_LIST
, ACPI_EXD_OFFSET (AddressSpace
.RegionList
), "Region List"},
333 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (AddressSpace
.Node
), "Node"},
334 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (AddressSpace
.Context
), "Context"}
337 static ACPI_EXDUMP_INFO AcpiExDumpNotify
[7] =
339 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify
), NULL
},
340 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Notify
.Node
), "Node"},
341 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Notify
.HandlerType
), "Handler Type"},
342 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Handler
), "Handler"},
343 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Context
), "Context"},
344 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[0]), "Next System Notify"},
345 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[1]), "Next Device Notify"}
348 static ACPI_EXDUMP_INFO AcpiExDumpExtra
[6] =
350 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra
), NULL
},
351 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.Method_REG
), "_REG Method"},
352 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Extra
.ScopeNode
), "Scope Node"},
353 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.RegionContext
), "Region Context"},
354 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.AmlStart
), "Aml Start"},
355 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Extra
.AmlLength
), "Aml Length"}
358 static ACPI_EXDUMP_INFO AcpiExDumpData
[3] =
360 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpData
), NULL
},
361 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Handler
), "Handler"},
362 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Pointer
), "Raw Data"}
365 /* Miscellaneous tables */
367 static ACPI_EXDUMP_INFO AcpiExDumpCommon
[5] =
369 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon
), NULL
},
370 {ACPI_EXD_TYPE
, 0, NULL
},
371 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Common
.ReferenceCount
), "Reference Count"},
372 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Common
.Flags
), "Flags"},
373 {ACPI_EXD_LIST
, ACPI_EXD_OFFSET (Common
.NextObject
), "Object List"}
376 static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon
[7] =
378 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpFieldCommon
), NULL
},
379 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.FieldFlags
), "Field Flags"},
380 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.AccessByteWidth
), "Access Byte Width"},
381 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BitLength
), "Bit Length"},
382 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.StartFieldBitOffset
),"Field Bit Offset"},
383 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BaseByteOffset
), "Base Byte Offset"},
384 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (CommonField
.Node
), "Parent Node"}
387 static ACPI_EXDUMP_INFO AcpiExDumpNode
[7] =
389 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode
), NULL
},
390 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (Flags
), "Flags"},
391 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (OwnerId
), "Owner Id"},
392 {ACPI_EXD_LIST
, ACPI_EXD_NSOFFSET (Object
), "Object List"},
393 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Parent
), "Parent"},
394 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Child
), "Child"},
395 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Peer
), "Peer"}
399 /* Dispatch table, indexed by object type */
401 static ACPI_EXDUMP_INFO
*AcpiExDumpInfo
[] =
417 AcpiExDumpBufferField
,
420 AcpiExDumpRegionField
,
422 AcpiExDumpIndexField
,
427 AcpiExDumpAddressHandler
,
436 /*******************************************************************************
438 * FUNCTION: AcpiExDumpObject
440 * PARAMETERS: ObjDesc - Descriptor to dump
441 * Info - Info table corresponding to this object
446 * DESCRIPTION: Walk the info table for this object
448 ******************************************************************************/
452 ACPI_OPERAND_OBJECT
*ObjDesc
,
453 ACPI_EXDUMP_INFO
*Info
)
457 const char *ReferenceName
;
459 ACPI_OPERAND_OBJECT
*Start
;
460 ACPI_OPERAND_OBJECT
*Data
= NULL
;
461 ACPI_OPERAND_OBJECT
*Next
;
462 ACPI_NAMESPACE_NODE
*Node
;
468 "ExDumpObject: Display not implemented for object type %s\n",
469 AcpiUtGetObjectTypeName (ObjDesc
));
473 /* First table entry must contain the table length (# of table entries) */
475 Count
= Info
->Offset
;
479 Target
= ACPI_ADD_PTR (UINT8
, ObjDesc
, Info
->Offset
);
482 switch (Info
->Opcode
)
490 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
491 ObjDesc
->Common
.Type
, AcpiUtGetObjectTypeName (ObjDesc
));
496 AcpiOsPrintf ("%20s : %2.2X\n", Name
, *Target
);
499 case ACPI_EXD_UINT16
:
501 AcpiOsPrintf ("%20s : %4.4X\n", Name
, ACPI_GET16 (Target
));
504 case ACPI_EXD_UINT32
:
506 AcpiOsPrintf ("%20s : %8.8X\n", Name
, ACPI_GET32 (Target
));
509 case ACPI_EXD_UINT64
:
511 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",
512 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target
)));
515 case ACPI_EXD_POINTER
:
516 case ACPI_EXD_ADDRESS
:
518 AcpiExOutPointer (Name
, *ACPI_CAST_PTR (void *, Target
));
521 case ACPI_EXD_STRING
:
523 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
527 case ACPI_EXD_BUFFER
:
529 ACPI_DUMP_BUFFER (ObjDesc
->Buffer
.Pointer
, ObjDesc
->Buffer
.Length
);
532 case ACPI_EXD_PACKAGE
:
534 /* Dump the package contents */
536 AcpiOsPrintf ("\nPackage Contents:\n");
537 AcpiExDumpPackageObj (ObjDesc
, 0, 0);
542 AcpiExDumpObject (ObjDesc
, AcpiExDumpFieldCommon
);
545 case ACPI_EXD_REFERENCE
:
547 ReferenceName
= AcpiUtGetReferenceName (ObjDesc
);
548 AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName
));
549 AcpiExDumpReferenceObj (ObjDesc
);
554 Start
= *ACPI_CAST_PTR (void *, Target
);
557 AcpiOsPrintf ("%20s : %p", Name
, Next
);
560 AcpiOsPrintf ("(%s %2.2X)",
561 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
563 while (Next
->Common
.NextObject
)
565 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
571 Next
= Next
->Common
.NextObject
;
572 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
573 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
575 if ((Next
== Start
) || (Next
== Data
))
577 AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
583 AcpiOsPrintf ("\n", Next
);
586 case ACPI_EXD_HDLR_LIST
:
588 Start
= *ACPI_CAST_PTR (void *, Target
);
591 AcpiOsPrintf ("%20s : %p", Name
, Next
);
594 AcpiOsPrintf ("(%s %2.2X)",
595 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
597 while (Next
->AddressSpace
.Next
)
599 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
605 Next
= Next
->AddressSpace
.Next
;
606 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
607 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
609 if ((Next
== Start
) || (Next
== Data
))
611 AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
617 AcpiOsPrintf ("\n", Next
);
620 case ACPI_EXD_RGN_LIST
:
622 Start
= *ACPI_CAST_PTR (void *, Target
);
625 AcpiOsPrintf ("%20s : %p", Name
, Next
);
628 AcpiOsPrintf ("(%s %2.2X)",
629 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
631 while (Next
->Region
.Next
)
633 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
639 Next
= Next
->Region
.Next
;
640 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
641 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
643 if ((Next
== Start
) || (Next
== Data
))
645 AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
651 AcpiOsPrintf ("\n", Next
);
656 Node
= *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE
*, Target
);
658 AcpiOsPrintf ("%20s : %p", Name
, Node
);
661 AcpiOsPrintf (" [%4.4s]", Node
->Name
.Ascii
);
668 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
679 /*******************************************************************************
681 * FUNCTION: AcpiExDumpOperand
683 * PARAMETERS: *ObjDesc - Pointer to entry to be dumped
684 * Depth - Current nesting depth
688 * DESCRIPTION: Dump an operand object
690 ******************************************************************************/
694 ACPI_OPERAND_OBJECT
*ObjDesc
,
701 ACPI_FUNCTION_NAME (ExDumpOperand
)
704 /* Check if debug output enabled */
706 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC
, _COMPONENT
))
713 /* This could be a null element of a package */
715 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Null Object Descriptor\n"));
719 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
721 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p Namespace Node: ", ObjDesc
));
722 ACPI_DUMP_ENTRY (ObjDesc
, ACPI_LV_EXEC
);
726 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
728 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
729 "%p is not a node or operand object: [%s]\n",
730 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
)));
731 ACPI_DUMP_BUFFER (ObjDesc
, sizeof (ACPI_OPERAND_OBJECT
));
735 /* ObjDesc is a valid object */
739 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%*s[%u] %p ",
740 Depth
, " ", Depth
, ObjDesc
));
744 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p ", ObjDesc
));
747 /* Decode object type */
749 switch (ObjDesc
->Common
.Type
)
751 case ACPI_TYPE_LOCAL_REFERENCE
:
753 AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc
));
755 switch (ObjDesc
->Reference
.Class
)
757 case ACPI_REFCLASS_DEBUG
:
762 case ACPI_REFCLASS_INDEX
:
764 AcpiOsPrintf ("%p\n", ObjDesc
->Reference
.Object
);
767 case ACPI_REFCLASS_TABLE
:
769 AcpiOsPrintf ("Table Index %X\n", ObjDesc
->Reference
.Value
);
772 case ACPI_REFCLASS_REFOF
:
774 AcpiOsPrintf ("%p [%s]\n", ObjDesc
->Reference
.Object
,
775 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
776 ObjDesc
->Reference
.Object
)->Common
.Type
));
779 case ACPI_REFCLASS_NAME
:
781 AcpiOsPrintf ("- [%4.4s]\n", ObjDesc
->Reference
.Node
->Name
.Ascii
);
784 case ACPI_REFCLASS_ARG
:
785 case ACPI_REFCLASS_LOCAL
:
787 AcpiOsPrintf ("%X\n", ObjDesc
->Reference
.Value
);
790 default: /* Unknown reference class */
792 AcpiOsPrintf ("%2.2X\n", ObjDesc
->Reference
.Class
);
797 case ACPI_TYPE_BUFFER
:
799 AcpiOsPrintf ("Buffer length %.2X @ %p\n",
800 ObjDesc
->Buffer
.Length
, ObjDesc
->Buffer
.Pointer
);
802 /* Debug only -- dump the buffer contents */
804 if (ObjDesc
->Buffer
.Pointer
)
806 Length
= ObjDesc
->Buffer
.Length
;
812 AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
814 ACPI_DUMP_BUFFER (ObjDesc
->Buffer
.Pointer
, Length
);
818 case ACPI_TYPE_INTEGER
:
820 AcpiOsPrintf ("Integer %8.8X%8.8X\n",
821 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
824 case ACPI_TYPE_PACKAGE
:
826 AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
827 ObjDesc
->Package
.Count
, ObjDesc
->Package
.Elements
);
830 * If elements exist, package element pointer is valid,
831 * and debug_level exceeds 1, dump package's elements.
833 if (ObjDesc
->Package
.Count
&&
834 ObjDesc
->Package
.Elements
&&
837 for (Index
= 0; Index
< ObjDesc
->Package
.Count
; Index
++)
839 AcpiExDumpOperand (ObjDesc
->Package
.Elements
[Index
], Depth
+1);
844 case ACPI_TYPE_REGION
:
846 AcpiOsPrintf ("Region %s (%X)",
847 AcpiUtGetRegionName (ObjDesc
->Region
.SpaceId
),
848 ObjDesc
->Region
.SpaceId
);
851 * If the address and length have not been evaluated,
854 if (!(ObjDesc
->Region
.Flags
& AOPOBJ_DATA_VALID
))
860 AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
861 ACPI_FORMAT_NATIVE_UINT (ObjDesc
->Region
.Address
),
862 ObjDesc
->Region
.Length
);
866 case ACPI_TYPE_STRING
:
868 AcpiOsPrintf ("String length %X @ %p ",
869 ObjDesc
->String
.Length
,
870 ObjDesc
->String
.Pointer
);
872 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
876 case ACPI_TYPE_LOCAL_BANK_FIELD
:
878 AcpiOsPrintf ("BankField\n");
881 case ACPI_TYPE_LOCAL_REGION_FIELD
:
883 AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
884 "byte=%X bit=%X of below:\n",
885 ObjDesc
->Field
.BitLength
,
886 ObjDesc
->Field
.AccessByteWidth
,
887 ObjDesc
->Field
.FieldFlags
& AML_FIELD_LOCK_RULE_MASK
,
888 ObjDesc
->Field
.FieldFlags
& AML_FIELD_UPDATE_RULE_MASK
,
889 ObjDesc
->Field
.BaseByteOffset
,
890 ObjDesc
->Field
.StartFieldBitOffset
);
892 AcpiExDumpOperand (ObjDesc
->Field
.RegionObj
, Depth
+1);
895 case ACPI_TYPE_LOCAL_INDEX_FIELD
:
897 AcpiOsPrintf ("IndexField\n");
900 case ACPI_TYPE_BUFFER_FIELD
:
902 AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
903 ObjDesc
->BufferField
.BitLength
,
904 ObjDesc
->BufferField
.BaseByteOffset
,
905 ObjDesc
->BufferField
.StartFieldBitOffset
);
907 if (!ObjDesc
->BufferField
.BufferObj
)
909 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "*NULL*\n"));
911 else if ((ObjDesc
->BufferField
.BufferObj
)->Common
.Type
!=
914 AcpiOsPrintf ("*not a Buffer*\n");
918 AcpiExDumpOperand (ObjDesc
->BufferField
.BufferObj
, Depth
+1);
922 case ACPI_TYPE_EVENT
:
924 AcpiOsPrintf ("Event\n");
927 case ACPI_TYPE_METHOD
:
929 AcpiOsPrintf ("Method(%X) @ %p:%X\n",
930 ObjDesc
->Method
.ParamCount
,
931 ObjDesc
->Method
.AmlStart
,
932 ObjDesc
->Method
.AmlLength
);
935 case ACPI_TYPE_MUTEX
:
937 AcpiOsPrintf ("Mutex\n");
940 case ACPI_TYPE_DEVICE
:
942 AcpiOsPrintf ("Device\n");
945 case ACPI_TYPE_POWER
:
947 AcpiOsPrintf ("Power\n");
950 case ACPI_TYPE_PROCESSOR
:
952 AcpiOsPrintf ("Processor\n");
955 case ACPI_TYPE_THERMAL
:
957 AcpiOsPrintf ("Thermal\n");
964 AcpiOsPrintf ("Unknown Type %X\n", ObjDesc
->Common
.Type
);
972 /*******************************************************************************
974 * FUNCTION: AcpiExDumpOperands
976 * PARAMETERS: Operands - A list of Operand objects
977 * OpcodeName - AML opcode name
978 * NumOperands - Operand count for this opcode
980 * DESCRIPTION: Dump the operands associated with the opcode
982 ******************************************************************************/
986 ACPI_OPERAND_OBJECT
**Operands
,
987 const char *OpcodeName
,
990 ACPI_FUNCTION_NAME (ExDumpOperands
);
995 OpcodeName
= "UNKNOWN";
998 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
999 "**** Start operand dump for opcode [%s], %u operands\n",
1000 OpcodeName
, NumOperands
));
1002 if (NumOperands
== 0)
1007 /* Dump the individual operands */
1011 AcpiExDumpOperand (*Operands
, 0);
1016 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
1017 "**** End operand dump for [%s]\n", OpcodeName
));
1022 /*******************************************************************************
1024 * FUNCTION: AcpiExOut* functions
1026 * PARAMETERS: Title - Descriptive text
1027 * Value - Value to be displayed
1029 * DESCRIPTION: Object dump output formatting functions. These functions
1030 * reduce the number of format strings required and keeps them
1031 * all in one place for easy modification.
1033 ******************************************************************************/
1040 AcpiOsPrintf ("%20s : %s\n", Title
, Value
);
1048 AcpiOsPrintf ("%20s : %p\n", Title
, Value
);
1052 /*******************************************************************************
1054 * FUNCTION: AcpiExDumpNamespaceNode
1056 * PARAMETERS: Node - Descriptor to dump
1057 * Flags - Force display if TRUE
1059 * DESCRIPTION: Dumps the members of the given.Node
1061 ******************************************************************************/
1064 AcpiExDumpNamespaceNode (
1065 ACPI_NAMESPACE_NODE
*Node
,
1069 ACPI_FUNCTION_ENTRY ();
1074 /* Check if debug output enabled */
1076 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1082 AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node
));
1083 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
1084 Node
->Type
, AcpiUtGetTypeName (Node
->Type
));
1086 AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Node
),
1091 /*******************************************************************************
1093 * FUNCTION: AcpiExDumpReferenceObj
1095 * PARAMETERS: Object - Descriptor to dump
1097 * DESCRIPTION: Dumps a reference object
1099 ******************************************************************************/
1102 AcpiExDumpReferenceObj (
1103 ACPI_OPERAND_OBJECT
*ObjDesc
)
1109 RetBuf
.Length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
1111 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_NAME
)
1113 AcpiOsPrintf (" %p ", ObjDesc
->Reference
.Node
);
1115 Status
= AcpiNsHandleToPathname (ObjDesc
->Reference
.Node
, &RetBuf
);
1116 if (ACPI_FAILURE (Status
))
1118 AcpiOsPrintf (" Could not convert name to pathname\n");
1122 AcpiOsPrintf ("%s\n", (char *) RetBuf
.Pointer
);
1123 ACPI_FREE (RetBuf
.Pointer
);
1126 else if (ObjDesc
->Reference
.Object
)
1128 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_OPERAND
)
1130 AcpiOsPrintf (" Target: %p", ObjDesc
->Reference
.Object
);
1131 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_TABLE
)
1133 AcpiOsPrintf (" Table Index: %X\n", ObjDesc
->Reference
.Value
);
1137 AcpiOsPrintf (" Target: %p [%s]\n", ObjDesc
->Reference
.Object
,
1138 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
1139 ObjDesc
->Reference
.Object
)->Common
.Type
));
1144 AcpiOsPrintf (" Target: %p\n", ObjDesc
->Reference
.Object
);
1150 /*******************************************************************************
1152 * FUNCTION: AcpiExDumpPackageObj
1154 * PARAMETERS: ObjDesc - Descriptor to dump
1155 * Level - Indentation Level
1156 * Index - Package index for this object
1158 * DESCRIPTION: Dumps the elements of the package
1160 ******************************************************************************/
1163 AcpiExDumpPackageObj (
1164 ACPI_OPERAND_OBJECT
*ObjDesc
,
1171 /* Indentation and index output */
1175 for (i
= 0; i
< Level
; i
++)
1180 AcpiOsPrintf ("[%.2d] ", Index
);
1183 AcpiOsPrintf ("%p ", ObjDesc
);
1185 /* Null package elements are allowed */
1189 AcpiOsPrintf ("[Null Object]\n");
1193 /* Packages may only contain a few object types */
1195 switch (ObjDesc
->Common
.Type
)
1197 case ACPI_TYPE_INTEGER
:
1199 AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
1200 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
1203 case ACPI_TYPE_STRING
:
1205 AcpiOsPrintf ("[String] Value: ");
1206 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
1207 AcpiOsPrintf ("\n");
1210 case ACPI_TYPE_BUFFER
:
1212 AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc
->Buffer
.Length
);
1213 if (ObjDesc
->Buffer
.Length
)
1215 AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8
, ObjDesc
->Buffer
.Pointer
),
1216 ObjDesc
->Buffer
.Length
, DB_DWORD_DISPLAY
, _COMPONENT
);
1220 AcpiOsPrintf ("\n");
1224 case ACPI_TYPE_PACKAGE
:
1226 AcpiOsPrintf ("[Package] Contains %u Elements:\n",
1227 ObjDesc
->Package
.Count
);
1229 for (i
= 0; i
< ObjDesc
->Package
.Count
; i
++)
1231 AcpiExDumpPackageObj (ObjDesc
->Package
.Elements
[i
], Level
+1, i
);
1235 case ACPI_TYPE_LOCAL_REFERENCE
:
1237 AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
1238 AcpiUtGetReferenceName (ObjDesc
),
1239 ObjDesc
->Reference
.Class
);
1240 AcpiExDumpReferenceObj (ObjDesc
);
1245 AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc
->Common
.Type
);
1251 /*******************************************************************************
1253 * FUNCTION: AcpiExDumpObjectDescriptor
1255 * PARAMETERS: ObjDesc - Descriptor to dump
1256 * Flags - Force display if TRUE
1258 * DESCRIPTION: Dumps the members of the object descriptor given.
1260 ******************************************************************************/
1263 AcpiExDumpObjectDescriptor (
1264 ACPI_OPERAND_OBJECT
*ObjDesc
,
1267 ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor
);
1277 /* Check if debug output enabled */
1279 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1285 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
1287 AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE
*) ObjDesc
, Flags
);
1289 AcpiOsPrintf ("\nAttached Object (%p):\n",
1290 ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
);
1292 ObjDesc
= ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
;
1296 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
1299 "%p is not an ACPI operand object: [%s]\n",
1300 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
));
1304 /* Validate the object type */
1306 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1308 AcpiOsPrintf ("Not a known object type: %2.2X\n",
1309 ObjDesc
->Common
.Type
);
1318 AcpiExDumpObject (ObjDesc
, AcpiExDumpCommon
);
1320 /* Object-specific fields */
1322 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);
1324 if (ObjDesc
->Common
.Type
== ACPI_TYPE_REGION
)
1326 ObjDesc
= ObjDesc
->Common
.NextObject
;
1327 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1329 AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
1330 ObjDesc
->Common
.Type
);
1335 AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc
);
1336 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);