1 /******************************************************************************
3 * Module Name: exdump - Interpreter debug output routines
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2015, 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 *****************************************************************************/
117 #include "accommon.h"
118 #include "acinterp.h"
120 #include "acnamesp.h"
123 #define _COMPONENT ACPI_EXECUTER
124 ACPI_MODULE_NAME ("exdump")
127 * The following routines are used for debug output only
129 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
131 /* Local prototypes */
145 ACPI_OPERAND_OBJECT
*ObjDesc
,
146 ACPI_EXDUMP_INFO
*Info
);
149 AcpiExDumpReferenceObj (
150 ACPI_OPERAND_OBJECT
*ObjDesc
);
153 AcpiExDumpPackageObj (
154 ACPI_OPERAND_OBJECT
*ObjDesc
,
159 /*******************************************************************************
161 * Object Descriptor info tables
163 * Note: The first table entry must be an INIT opcode and must contain
164 * the table length (number of table entries)
166 ******************************************************************************/
168 static ACPI_EXDUMP_INFO AcpiExDumpInteger
[2] =
170 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpInteger
), NULL
},
171 {ACPI_EXD_UINT64
, ACPI_EXD_OFFSET (Integer
.Value
), "Value"}
174 static ACPI_EXDUMP_INFO AcpiExDumpString
[4] =
176 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpString
), NULL
},
177 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (String
.Length
), "Length"},
178 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (String
.Pointer
), "Pointer"},
179 {ACPI_EXD_STRING
, 0, NULL
}
182 static ACPI_EXDUMP_INFO AcpiExDumpBuffer
[5] =
184 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer
), NULL
},
185 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Buffer
.Length
), "Length"},
186 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Buffer
.Pointer
), "Pointer"},
187 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Buffer
.Node
), "Parent Node"},
188 {ACPI_EXD_BUFFER
, 0, NULL
}
191 static ACPI_EXDUMP_INFO AcpiExDumpPackage
[6] =
193 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage
), NULL
},
194 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Package
.Node
), "Parent Node"},
195 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Package
.Flags
), "Flags"},
196 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Package
.Count
), "Elements"},
197 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Package
.Elements
), "Element List"},
198 {ACPI_EXD_PACKAGE
, 0, NULL
}
201 static ACPI_EXDUMP_INFO AcpiExDumpDevice
[4] =
203 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice
), NULL
},
204 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[0]), "System Notify"},
205 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[1]), "Device Notify"},
206 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Device
.Handler
), "Handler"}
209 static ACPI_EXDUMP_INFO AcpiExDumpEvent
[2] =
211 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent
), NULL
},
212 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Event
.OsSemaphore
), "OsSemaphore"}
215 static ACPI_EXDUMP_INFO AcpiExDumpMethod
[9] =
217 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod
), NULL
},
218 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.InfoFlags
), "Info Flags"},
219 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ParamCount
), "Parameter Count"},
220 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.SyncLevel
), "Sync Level"},
221 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.Mutex
), "Mutex"},
222 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.OwnerId
), "Owner Id"},
223 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ThreadCount
), "Thread Count"},
224 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Method
.AmlLength
), "Aml Length"},
225 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.AmlStart
), "Aml Start"}
228 static ACPI_EXDUMP_INFO AcpiExDumpMutex
[6] =
230 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex
), NULL
},
231 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.SyncLevel
), "Sync Level"},
232 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.OriginalSyncLevel
), "Original Sync Level"},
233 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OwnerThread
), "Owner Thread"},
234 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Mutex
.AcquisitionDepth
), "Acquire Depth"},
235 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OsMutex
), "OsMutex"}
238 static ACPI_EXDUMP_INFO AcpiExDumpRegion
[8] =
240 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion
), NULL
},
241 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.SpaceId
), "Space Id"},
242 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.Flags
), "Flags"},
243 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Region
.Node
), "Parent Node"},
244 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Region
.Address
), "Address"},
245 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Region
.Length
), "Length"},
246 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Region
.Handler
), "Handler"},
247 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Region
.Next
), "Next"}
250 static ACPI_EXDUMP_INFO AcpiExDumpPower
[6] =
252 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower
), NULL
},
253 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.SystemLevel
), "System Level"},
254 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.ResourceOrder
), "Resource Order"},
255 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[0]), "System Notify"},
256 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[1]), "Device Notify"},
257 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.Handler
), "Handler"}
260 static ACPI_EXDUMP_INFO AcpiExDumpProcessor
[7] =
262 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor
), NULL
},
263 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.ProcId
), "Processor ID"},
264 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.Length
), "Length"},
265 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Processor
.Address
), "Address"},
266 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[0]), "System Notify"},
267 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[1]), "Device Notify"},
268 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.Handler
), "Handler"}
271 static ACPI_EXDUMP_INFO AcpiExDumpThermal
[4] =
273 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal
), NULL
},
274 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[0]), "System Notify"},
275 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[1]), "Device Notify"},
276 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.Handler
), "Handler"}
279 static ACPI_EXDUMP_INFO AcpiExDumpBufferField
[3] =
281 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField
), NULL
},
282 {ACPI_EXD_FIELD
, 0, NULL
},
283 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BufferField
.BufferObj
), "Buffer Object"}
286 static ACPI_EXDUMP_INFO AcpiExDumpRegionField
[5] =
288 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField
), NULL
},
289 {ACPI_EXD_FIELD
, 0, NULL
},
290 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Field
.AccessLength
), "AccessLength"},
291 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.RegionObj
), "Region Object"},
292 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.ResourceBuffer
), "ResourceBuffer"}
295 static ACPI_EXDUMP_INFO AcpiExDumpBankField
[5] =
297 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
298 {ACPI_EXD_FIELD
, 0, NULL
},
299 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (BankField
.Value
), "Value"},
300 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.RegionObj
), "Region Object"},
301 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.BankObj
), "Bank Object"}
304 static ACPI_EXDUMP_INFO AcpiExDumpIndexField
[5] =
306 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
307 {ACPI_EXD_FIELD
, 0, NULL
},
308 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (IndexField
.Value
), "Value"},
309 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.IndexObj
), "Index Object"},
310 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.DataObj
), "Data Object"}
313 static ACPI_EXDUMP_INFO AcpiExDumpReference
[9] =
315 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference
), NULL
},
316 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.Class
), "Class"},
317 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.TargetType
), "Target Type"},
318 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Reference
.Value
), "Value"},
319 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Object
), "Object Desc"},
320 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Reference
.Node
), "Node"},
321 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Where
), "Where"},
322 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.IndexPointer
), "Index Pointer"},
323 {ACPI_EXD_REFERENCE
,0, NULL
}
326 static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler
[6] =
328 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler
), NULL
},
329 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (AddressSpace
.SpaceId
), "Space Id"},
330 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (AddressSpace
.Next
), "Next"},
331 {ACPI_EXD_RGN_LIST
, ACPI_EXD_OFFSET (AddressSpace
.RegionList
), "Region List"},
332 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (AddressSpace
.Node
), "Node"},
333 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (AddressSpace
.Context
), "Context"}
336 static ACPI_EXDUMP_INFO AcpiExDumpNotify
[7] =
338 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify
), NULL
},
339 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Notify
.Node
), "Node"},
340 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Notify
.HandlerType
), "Handler Type"},
341 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Handler
), "Handler"},
342 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Context
), "Context"},
343 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[0]), "Next System Notify"},
344 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[1]), "Next Device Notify"}
347 static ACPI_EXDUMP_INFO AcpiExDumpExtra
[6] =
349 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra
), NULL
},
350 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.Method_REG
), "_REG Method"},
351 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Extra
.ScopeNode
), "Scope Node"},
352 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.RegionContext
), "Region Context"},
353 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.AmlStart
), "Aml Start"},
354 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Extra
.AmlLength
), "Aml Length"}
357 static ACPI_EXDUMP_INFO AcpiExDumpData
[3] =
359 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpData
), NULL
},
360 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Handler
), "Handler"},
361 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Pointer
), "Raw Data"}
364 /* Miscellaneous tables */
366 static ACPI_EXDUMP_INFO AcpiExDumpCommon
[5] =
368 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon
), NULL
},
369 {ACPI_EXD_TYPE
, 0, NULL
},
370 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Common
.ReferenceCount
), "Reference Count"},
371 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Common
.Flags
), "Flags"},
372 {ACPI_EXD_LIST
, ACPI_EXD_OFFSET (Common
.NextObject
), "Object List"}
375 static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon
[7] =
377 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpFieldCommon
), NULL
},
378 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.FieldFlags
), "Field Flags"},
379 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.AccessByteWidth
), "Access Byte Width"},
380 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BitLength
), "Bit Length"},
381 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.StartFieldBitOffset
),"Field Bit Offset"},
382 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BaseByteOffset
), "Base Byte Offset"},
383 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (CommonField
.Node
), "Parent Node"}
386 static ACPI_EXDUMP_INFO AcpiExDumpNode
[7] =
388 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode
), NULL
},
389 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (Flags
), "Flags"},
390 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (OwnerId
), "Owner Id"},
391 {ACPI_EXD_LIST
, ACPI_EXD_NSOFFSET (Object
), "Object List"},
392 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Parent
), "Parent"},
393 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Child
), "Child"},
394 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Peer
), "Peer"}
398 /* Dispatch table, indexed by object type */
400 static ACPI_EXDUMP_INFO
*AcpiExDumpInfo
[] =
416 AcpiExDumpBufferField
,
419 AcpiExDumpRegionField
,
421 AcpiExDumpIndexField
,
426 AcpiExDumpAddressHandler
,
435 /*******************************************************************************
437 * FUNCTION: AcpiExDumpObject
439 * PARAMETERS: ObjDesc - Descriptor to dump
440 * Info - Info table corresponding to this object
445 * DESCRIPTION: Walk the info table for this object
447 ******************************************************************************/
451 ACPI_OPERAND_OBJECT
*ObjDesc
,
452 ACPI_EXDUMP_INFO
*Info
)
456 const char *ReferenceName
;
458 ACPI_OPERAND_OBJECT
*Start
;
459 ACPI_OPERAND_OBJECT
*Data
= NULL
;
460 ACPI_OPERAND_OBJECT
*Next
;
461 ACPI_NAMESPACE_NODE
*Node
;
467 "ExDumpObject: Display not implemented for object type %s\n",
468 AcpiUtGetObjectTypeName (ObjDesc
));
472 /* First table entry must contain the table length (# of table entries) */
474 Count
= Info
->Offset
;
478 Target
= ACPI_ADD_PTR (UINT8
, ObjDesc
, Info
->Offset
);
481 switch (Info
->Opcode
)
489 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
490 ObjDesc
->Common
.Type
, AcpiUtGetObjectTypeName (ObjDesc
));
495 AcpiOsPrintf ("%20s : %2.2X\n", Name
, *Target
);
498 case ACPI_EXD_UINT16
:
500 AcpiOsPrintf ("%20s : %4.4X\n", Name
, ACPI_GET16 (Target
));
503 case ACPI_EXD_UINT32
:
505 AcpiOsPrintf ("%20s : %8.8X\n", Name
, ACPI_GET32 (Target
));
508 case ACPI_EXD_UINT64
:
510 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",
511 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target
)));
514 case ACPI_EXD_POINTER
:
515 case ACPI_EXD_ADDRESS
:
517 AcpiExOutPointer (Name
, *ACPI_CAST_PTR (void *, Target
));
520 case ACPI_EXD_STRING
:
522 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
526 case ACPI_EXD_BUFFER
:
529 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
);
549 "Class Name", ACPI_CAST_PTR (char, ReferenceName
));
550 AcpiExDumpReferenceObj (ObjDesc
);
555 Start
= *ACPI_CAST_PTR (void *, Target
);
558 AcpiOsPrintf ("%20s : %p", Name
, Next
);
561 AcpiOsPrintf ("(%s %2.2X)",
562 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
564 while (Next
->Common
.NextObject
)
566 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
572 Next
= Next
->Common
.NextObject
;
573 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
574 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
576 if ((Next
== Start
) || (Next
== Data
))
579 "\n**** Error: Object list appears to be circular linked");
588 case ACPI_EXD_HDLR_LIST
:
590 Start
= *ACPI_CAST_PTR (void *, Target
);
593 AcpiOsPrintf ("%20s : %p", Name
, Next
);
596 AcpiOsPrintf ("(%s %2.2X)",
597 AcpiUtGetObjectTypeName (Next
),
598 Next
->AddressSpace
.SpaceId
);
600 while (Next
->AddressSpace
.Next
)
602 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
608 Next
= Next
->AddressSpace
.Next
;
609 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
610 AcpiUtGetObjectTypeName (Next
),
611 Next
->AddressSpace
.SpaceId
);
613 if ((Next
== Start
) || (Next
== Data
))
616 "\n**** Error: Handler list appears to be circular linked");
625 case ACPI_EXD_RGN_LIST
:
627 Start
= *ACPI_CAST_PTR (void *, Target
);
630 AcpiOsPrintf ("%20s : %p", Name
, Next
);
633 AcpiOsPrintf ("(%s %2.2X)",
634 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
636 while (Next
->Region
.Next
)
638 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
644 Next
= Next
->Region
.Next
;
645 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
646 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
648 if ((Next
== Start
) || (Next
== Data
))
651 "\n**** Error: Region list appears to be circular linked");
662 Node
= *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE
*, Target
);
664 AcpiOsPrintf ("%20s : %p", Name
, Node
);
667 AcpiOsPrintf (" [%4.4s]", Node
->Name
.Ascii
);
674 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
685 /*******************************************************************************
687 * FUNCTION: AcpiExDumpOperand
689 * PARAMETERS: *ObjDesc - Pointer to entry to be dumped
690 * Depth - Current nesting depth
694 * DESCRIPTION: Dump an operand object
696 ******************************************************************************/
700 ACPI_OPERAND_OBJECT
*ObjDesc
,
707 ACPI_FUNCTION_NAME (ExDumpOperand
)
710 /* Check if debug output enabled */
712 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC
, _COMPONENT
))
719 /* This could be a null element of a package */
721 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Null Object Descriptor\n"));
725 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
727 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p Namespace Node: ", ObjDesc
));
728 ACPI_DUMP_ENTRY (ObjDesc
, ACPI_LV_EXEC
);
732 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
734 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
735 "%p is not a node or operand object: [%s]\n",
736 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
)));
737 ACPI_DUMP_BUFFER (ObjDesc
, sizeof (ACPI_OPERAND_OBJECT
));
741 /* ObjDesc is a valid object */
745 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%*s[%u] %p ",
746 Depth
, " ", Depth
, ObjDesc
));
750 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p ", ObjDesc
));
753 /* Decode object type */
755 switch (ObjDesc
->Common
.Type
)
757 case ACPI_TYPE_LOCAL_REFERENCE
:
759 AcpiOsPrintf ("Reference: [%s] ",
760 AcpiUtGetReferenceName (ObjDesc
));
762 switch (ObjDesc
->Reference
.Class
)
764 case ACPI_REFCLASS_DEBUG
:
769 case ACPI_REFCLASS_INDEX
:
771 AcpiOsPrintf ("%p\n", ObjDesc
->Reference
.Object
);
774 case ACPI_REFCLASS_TABLE
:
776 AcpiOsPrintf ("Table Index %X\n", ObjDesc
->Reference
.Value
);
779 case ACPI_REFCLASS_REFOF
:
781 AcpiOsPrintf ("%p [%s]\n", ObjDesc
->Reference
.Object
,
782 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
783 ObjDesc
->Reference
.Object
)->Common
.Type
));
786 case ACPI_REFCLASS_NAME
:
788 AcpiOsPrintf ("- [%4.4s]\n",
789 ObjDesc
->Reference
.Node
->Name
.Ascii
);
792 case ACPI_REFCLASS_ARG
:
793 case ACPI_REFCLASS_LOCAL
:
795 AcpiOsPrintf ("%X\n", ObjDesc
->Reference
.Value
);
798 default: /* Unknown reference class */
800 AcpiOsPrintf ("%2.2X\n", ObjDesc
->Reference
.Class
);
805 case ACPI_TYPE_BUFFER
:
807 AcpiOsPrintf ("Buffer length %.2X @ %p\n",
808 ObjDesc
->Buffer
.Length
, ObjDesc
->Buffer
.Pointer
);
810 /* Debug only -- dump the buffer contents */
812 if (ObjDesc
->Buffer
.Pointer
)
814 Length
= ObjDesc
->Buffer
.Length
;
821 "Buffer Contents: (displaying length 0x%.2X)\n", Length
);
822 ACPI_DUMP_BUFFER (ObjDesc
->Buffer
.Pointer
, Length
);
826 case ACPI_TYPE_INTEGER
:
828 AcpiOsPrintf ("Integer %8.8X%8.8X\n",
829 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
832 case ACPI_TYPE_PACKAGE
:
834 AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
835 ObjDesc
->Package
.Count
, ObjDesc
->Package
.Elements
);
838 * If elements exist, package element pointer is valid,
839 * and debug_level exceeds 1, dump package's elements.
841 if (ObjDesc
->Package
.Count
&&
842 ObjDesc
->Package
.Elements
&&
845 for (Index
= 0; Index
< ObjDesc
->Package
.Count
; Index
++)
848 ObjDesc
->Package
.Elements
[Index
], Depth
+ 1);
853 case ACPI_TYPE_REGION
:
855 AcpiOsPrintf ("Region %s (%X)",
856 AcpiUtGetRegionName (ObjDesc
->Region
.SpaceId
),
857 ObjDesc
->Region
.SpaceId
);
860 * If the address and length have not been evaluated,
863 if (!(ObjDesc
->Region
.Flags
& AOPOBJ_DATA_VALID
))
869 AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
870 ACPI_FORMAT_UINT64 (ObjDesc
->Region
.Address
),
871 ObjDesc
->Region
.Length
);
875 case ACPI_TYPE_STRING
:
877 AcpiOsPrintf ("String length %X @ %p ",
878 ObjDesc
->String
.Length
,
879 ObjDesc
->String
.Pointer
);
881 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
885 case ACPI_TYPE_LOCAL_BANK_FIELD
:
887 AcpiOsPrintf ("BankField\n");
890 case ACPI_TYPE_LOCAL_REGION_FIELD
:
892 AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
893 "byte=%X bit=%X of below:\n",
894 ObjDesc
->Field
.BitLength
,
895 ObjDesc
->Field
.AccessByteWidth
,
896 ObjDesc
->Field
.FieldFlags
& AML_FIELD_LOCK_RULE_MASK
,
897 ObjDesc
->Field
.FieldFlags
& AML_FIELD_UPDATE_RULE_MASK
,
898 ObjDesc
->Field
.BaseByteOffset
,
899 ObjDesc
->Field
.StartFieldBitOffset
);
901 AcpiExDumpOperand (ObjDesc
->Field
.RegionObj
, Depth
+ 1);
904 case ACPI_TYPE_LOCAL_INDEX_FIELD
:
906 AcpiOsPrintf ("IndexField\n");
909 case ACPI_TYPE_BUFFER_FIELD
:
911 AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
912 ObjDesc
->BufferField
.BitLength
,
913 ObjDesc
->BufferField
.BaseByteOffset
,
914 ObjDesc
->BufferField
.StartFieldBitOffset
);
916 if (!ObjDesc
->BufferField
.BufferObj
)
918 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "*NULL*\n"));
920 else if ((ObjDesc
->BufferField
.BufferObj
)->Common
.Type
!=
923 AcpiOsPrintf ("*not a Buffer*\n");
927 AcpiExDumpOperand (ObjDesc
->BufferField
.BufferObj
, Depth
+ 1);
931 case ACPI_TYPE_EVENT
:
933 AcpiOsPrintf ("Event\n");
936 case ACPI_TYPE_METHOD
:
938 AcpiOsPrintf ("Method(%X) @ %p:%X\n",
939 ObjDesc
->Method
.ParamCount
,
940 ObjDesc
->Method
.AmlStart
,
941 ObjDesc
->Method
.AmlLength
);
944 case ACPI_TYPE_MUTEX
:
946 AcpiOsPrintf ("Mutex\n");
949 case ACPI_TYPE_DEVICE
:
951 AcpiOsPrintf ("Device\n");
954 case ACPI_TYPE_POWER
:
956 AcpiOsPrintf ("Power\n");
959 case ACPI_TYPE_PROCESSOR
:
961 AcpiOsPrintf ("Processor\n");
964 case ACPI_TYPE_THERMAL
:
966 AcpiOsPrintf ("Thermal\n");
973 AcpiOsPrintf ("Unknown Type %X\n", ObjDesc
->Common
.Type
);
981 /*******************************************************************************
983 * FUNCTION: AcpiExDumpOperands
985 * PARAMETERS: Operands - A list of Operand objects
986 * OpcodeName - AML opcode name
987 * NumOperands - Operand count for this opcode
989 * DESCRIPTION: Dump the operands associated with the opcode
991 ******************************************************************************/
995 ACPI_OPERAND_OBJECT
**Operands
,
996 const char *OpcodeName
,
999 ACPI_FUNCTION_NAME (ExDumpOperands
);
1004 OpcodeName
= "UNKNOWN";
1007 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
1008 "**** Start operand dump for opcode [%s], %u operands\n",
1009 OpcodeName
, NumOperands
));
1011 if (NumOperands
== 0)
1016 /* Dump the individual operands */
1020 AcpiExDumpOperand (*Operands
, 0);
1025 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
1026 "**** End operand dump for [%s]\n", OpcodeName
));
1031 /*******************************************************************************
1033 * FUNCTION: AcpiExOut* functions
1035 * PARAMETERS: Title - Descriptive text
1036 * Value - Value to be displayed
1038 * DESCRIPTION: Object dump output formatting functions. These functions
1039 * reduce the number of format strings required and keeps them
1040 * all in one place for easy modification.
1042 ******************************************************************************/
1049 AcpiOsPrintf ("%20s : %s\n", Title
, Value
);
1057 AcpiOsPrintf ("%20s : %p\n", Title
, Value
);
1061 /*******************************************************************************
1063 * FUNCTION: AcpiExDumpNamespaceNode
1065 * PARAMETERS: Node - Descriptor to dump
1066 * Flags - Force display if TRUE
1068 * DESCRIPTION: Dumps the members of the given.Node
1070 ******************************************************************************/
1073 AcpiExDumpNamespaceNode (
1074 ACPI_NAMESPACE_NODE
*Node
,
1078 ACPI_FUNCTION_ENTRY ();
1083 /* Check if debug output enabled */
1085 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1091 AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node
));
1092 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
1093 Node
->Type
, AcpiUtGetTypeName (Node
->Type
));
1095 AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Node
),
1100 /*******************************************************************************
1102 * FUNCTION: AcpiExDumpReferenceObj
1104 * PARAMETERS: Object - Descriptor to dump
1106 * DESCRIPTION: Dumps a reference object
1108 ******************************************************************************/
1111 AcpiExDumpReferenceObj (
1112 ACPI_OPERAND_OBJECT
*ObjDesc
)
1118 RetBuf
.Length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
1120 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_NAME
)
1122 AcpiOsPrintf (" %p ", ObjDesc
->Reference
.Node
);
1124 Status
= AcpiNsHandleToPathname (ObjDesc
->Reference
.Node
,
1126 if (ACPI_FAILURE (Status
))
1128 AcpiOsPrintf (" Could not convert name to pathname\n");
1132 AcpiOsPrintf ("%s\n", (char *) RetBuf
.Pointer
);
1133 ACPI_FREE (RetBuf
.Pointer
);
1136 else if (ObjDesc
->Reference
.Object
)
1138 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_OPERAND
)
1140 AcpiOsPrintf ("%22s %p", "Target :",
1141 ObjDesc
->Reference
.Object
);
1142 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_TABLE
)
1144 AcpiOsPrintf (" Table Index: %X\n",
1145 ObjDesc
->Reference
.Value
);
1149 AcpiOsPrintf (" [%s]\n",
1150 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
1151 ObjDesc
->Reference
.Object
)->Common
.Type
));
1156 AcpiOsPrintf (" Target: %p\n", ObjDesc
->Reference
.Object
);
1162 /*******************************************************************************
1164 * FUNCTION: AcpiExDumpPackageObj
1166 * PARAMETERS: ObjDesc - Descriptor to dump
1167 * Level - Indentation Level
1168 * Index - Package index for this object
1170 * DESCRIPTION: Dumps the elements of the package
1172 ******************************************************************************/
1175 AcpiExDumpPackageObj (
1176 ACPI_OPERAND_OBJECT
*ObjDesc
,
1183 /* Indentation and index output */
1187 for (i
= 0; i
< Level
; i
++)
1192 AcpiOsPrintf ("[%.2d] ", Index
);
1195 AcpiOsPrintf ("%p ", ObjDesc
);
1197 /* Null package elements are allowed */
1201 AcpiOsPrintf ("[Null Object]\n");
1205 /* Packages may only contain a few object types */
1207 switch (ObjDesc
->Common
.Type
)
1209 case ACPI_TYPE_INTEGER
:
1211 AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
1212 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
1215 case ACPI_TYPE_STRING
:
1217 AcpiOsPrintf ("[String] Value: ");
1218 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
1219 AcpiOsPrintf ("\n");
1222 case ACPI_TYPE_BUFFER
:
1224 AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc
->Buffer
.Length
);
1225 if (ObjDesc
->Buffer
.Length
)
1227 AcpiUtDebugDumpBuffer (
1228 ACPI_CAST_PTR (UINT8
, ObjDesc
->Buffer
.Pointer
),
1229 ObjDesc
->Buffer
.Length
, DB_DWORD_DISPLAY
, _COMPONENT
);
1233 AcpiOsPrintf ("\n");
1237 case ACPI_TYPE_PACKAGE
:
1239 AcpiOsPrintf ("[Package] Contains %u Elements:\n",
1240 ObjDesc
->Package
.Count
);
1242 for (i
= 0; i
< ObjDesc
->Package
.Count
; i
++)
1244 AcpiExDumpPackageObj (
1245 ObjDesc
->Package
.Elements
[i
], Level
+ 1, i
);
1249 case ACPI_TYPE_LOCAL_REFERENCE
:
1251 AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
1252 AcpiUtGetReferenceName (ObjDesc
),
1253 ObjDesc
->Reference
.Class
);
1254 AcpiExDumpReferenceObj (ObjDesc
);
1259 AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc
->Common
.Type
);
1265 /*******************************************************************************
1267 * FUNCTION: AcpiExDumpObjectDescriptor
1269 * PARAMETERS: ObjDesc - Descriptor to dump
1270 * Flags - Force display if TRUE
1272 * DESCRIPTION: Dumps the members of the object descriptor given.
1274 ******************************************************************************/
1277 AcpiExDumpObjectDescriptor (
1278 ACPI_OPERAND_OBJECT
*ObjDesc
,
1281 ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor
);
1291 /* Check if debug output enabled */
1293 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1299 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
1301 AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE
*) ObjDesc
, Flags
);
1303 AcpiOsPrintf ("\nAttached Object (%p):\n",
1304 ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
);
1306 ObjDesc
= ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
;
1310 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
1313 "%p is not an ACPI operand object: [%s]\n",
1314 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
));
1318 /* Validate the object type */
1320 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1322 AcpiOsPrintf ("Not a known object type: %2.2X\n",
1323 ObjDesc
->Common
.Type
);
1332 AcpiExDumpObject (ObjDesc
, AcpiExDumpCommon
);
1334 /* Object-specific fields */
1336 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);
1338 if (ObjDesc
->Common
.Type
== ACPI_TYPE_REGION
)
1340 ObjDesc
= ObjDesc
->Common
.NextObject
;
1341 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1344 "Secondary object is not a known object type: %2.2X\n",
1345 ObjDesc
->Common
.Type
);
1350 AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc
);
1351 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);