1 /******************************************************************************
3 * Module Name: exdump - Interpreter debug output routines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
51 #define _COMPONENT ACPI_EXECUTER
52 ACPI_MODULE_NAME ("exdump")
55 * The following routines are used for debug output only
57 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
59 /* Local prototypes */
73 ACPI_OPERAND_OBJECT
*ObjDesc
,
74 ACPI_EXDUMP_INFO
*Info
);
77 AcpiExDumpReferenceObj (
78 ACPI_OPERAND_OBJECT
*ObjDesc
);
81 AcpiExDumpPackageObj (
82 ACPI_OPERAND_OBJECT
*ObjDesc
,
87 /*******************************************************************************
89 * Object Descriptor info tables
91 * Note: The first table entry must be an INIT opcode and must contain
92 * the table length (number of table entries)
94 ******************************************************************************/
96 static ACPI_EXDUMP_INFO AcpiExDumpInteger
[2] =
98 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpInteger
), NULL
},
99 {ACPI_EXD_UINT64
, ACPI_EXD_OFFSET (Integer
.Value
), "Value"}
102 static ACPI_EXDUMP_INFO AcpiExDumpString
[4] =
104 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpString
), NULL
},
105 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (String
.Length
), "Length"},
106 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (String
.Pointer
), "Pointer"},
107 {ACPI_EXD_STRING
, 0, NULL
}
110 static ACPI_EXDUMP_INFO AcpiExDumpBuffer
[5] =
112 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer
), NULL
},
113 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Buffer
.Length
), "Length"},
114 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Buffer
.Pointer
), "Pointer"},
115 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Buffer
.Node
), "Parent Node"},
116 {ACPI_EXD_BUFFER
, 0, NULL
}
119 static ACPI_EXDUMP_INFO AcpiExDumpPackage
[6] =
121 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage
), NULL
},
122 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Package
.Node
), "Parent Node"},
123 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Package
.Flags
), "Flags"},
124 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Package
.Count
), "Elements"},
125 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Package
.Elements
), "Element List"},
126 {ACPI_EXD_PACKAGE
, 0, NULL
}
129 static ACPI_EXDUMP_INFO AcpiExDumpDevice
[4] =
131 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice
), NULL
},
132 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[0]), "System Notify"},
133 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Device
.NotifyList
[1]), "Device Notify"},
134 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Device
.Handler
), "Handler"}
137 static ACPI_EXDUMP_INFO AcpiExDumpEvent
[2] =
139 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent
), NULL
},
140 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Event
.OsSemaphore
), "OsSemaphore"}
143 static ACPI_EXDUMP_INFO AcpiExDumpMethod
[9] =
145 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod
), NULL
},
146 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.InfoFlags
), "Info Flags"},
147 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ParamCount
), "Parameter Count"},
148 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.SyncLevel
), "Sync Level"},
149 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.Mutex
), "Mutex"},
150 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.OwnerId
), "Owner Id"},
151 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Method
.ThreadCount
), "Thread Count"},
152 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Method
.AmlLength
), "Aml Length"},
153 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Method
.AmlStart
), "Aml Start"}
156 static ACPI_EXDUMP_INFO AcpiExDumpMutex
[6] =
158 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex
), NULL
},
159 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.SyncLevel
), "Sync Level"},
160 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Mutex
.OriginalSyncLevel
), "Original Sync Level"},
161 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OwnerThread
), "Owner Thread"},
162 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Mutex
.AcquisitionDepth
), "Acquire Depth"},
163 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Mutex
.OsMutex
), "OsMutex"}
166 static ACPI_EXDUMP_INFO AcpiExDumpRegion
[8] =
168 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion
), NULL
},
169 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.SpaceId
), "Space Id"},
170 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Region
.Flags
), "Flags"},
171 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Region
.Node
), "Parent Node"},
172 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Region
.Address
), "Address"},
173 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Region
.Length
), "Length"},
174 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (Region
.Handler
), "Handler"},
175 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Region
.Next
), "Next"}
178 static ACPI_EXDUMP_INFO AcpiExDumpPower
[6] =
180 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower
), NULL
},
181 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.SystemLevel
), "System Level"},
182 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (PowerResource
.ResourceOrder
), "Resource Order"},
183 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[0]), "System Notify"},
184 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.NotifyList
[1]), "Device Notify"},
185 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (PowerResource
.Handler
), "Handler"}
188 static ACPI_EXDUMP_INFO AcpiExDumpProcessor
[7] =
190 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor
), NULL
},
191 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.ProcId
), "Processor ID"},
192 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Processor
.Length
), "Length"},
193 {ACPI_EXD_ADDRESS
, ACPI_EXD_OFFSET (Processor
.Address
), "Address"},
194 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[0]), "System Notify"},
195 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.NotifyList
[1]), "Device Notify"},
196 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Processor
.Handler
), "Handler"}
199 static ACPI_EXDUMP_INFO AcpiExDumpThermal
[4] =
201 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal
), NULL
},
202 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[0]), "System Notify"},
203 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.NotifyList
[1]), "Device Notify"},
204 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (ThermalZone
.Handler
), "Handler"}
207 static ACPI_EXDUMP_INFO AcpiExDumpBufferField
[3] =
209 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField
), NULL
},
210 {ACPI_EXD_FIELD
, 0, NULL
},
211 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BufferField
.BufferObj
), "Buffer Object"}
214 static ACPI_EXDUMP_INFO AcpiExDumpRegionField
[5] =
216 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField
), NULL
},
217 {ACPI_EXD_FIELD
, 0, NULL
},
218 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Field
.AccessLength
), "AccessLength"},
219 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.RegionObj
), "Region Object"},
220 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Field
.ResourceBuffer
), "ResourceBuffer"}
223 static ACPI_EXDUMP_INFO AcpiExDumpBankField
[5] =
225 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
226 {ACPI_EXD_FIELD
, 0, NULL
},
227 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (BankField
.Value
), "Value"},
228 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.RegionObj
), "Region Object"},
229 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (BankField
.BankObj
), "Bank Object"}
232 static ACPI_EXDUMP_INFO AcpiExDumpIndexField
[5] =
234 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField
), NULL
},
235 {ACPI_EXD_FIELD
, 0, NULL
},
236 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (IndexField
.Value
), "Value"},
237 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.IndexObj
), "Index Object"},
238 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (IndexField
.DataObj
), "Data Object"}
241 static ACPI_EXDUMP_INFO AcpiExDumpReference
[9] =
243 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference
), NULL
},
244 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.Class
), "Class"},
245 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Reference
.TargetType
), "Target Type"},
246 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Reference
.Value
), "Value"},
247 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Object
), "Object Desc"},
248 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Reference
.Node
), "Node"},
249 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.Where
), "Where"},
250 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Reference
.IndexPointer
), "Index Pointer"},
251 {ACPI_EXD_REFERENCE
,0, NULL
}
254 static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler
[6] =
256 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler
), NULL
},
257 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (AddressSpace
.SpaceId
), "Space Id"},
258 {ACPI_EXD_HDLR_LIST
,ACPI_EXD_OFFSET (AddressSpace
.Next
), "Next"},
259 {ACPI_EXD_RGN_LIST
, ACPI_EXD_OFFSET (AddressSpace
.RegionList
), "Region List"},
260 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (AddressSpace
.Node
), "Node"},
261 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (AddressSpace
.Context
), "Context"}
264 static ACPI_EXDUMP_INFO AcpiExDumpNotify
[7] =
266 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify
), NULL
},
267 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Notify
.Node
), "Node"},
268 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Notify
.HandlerType
), "Handler Type"},
269 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Handler
), "Handler"},
270 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Context
), "Context"},
271 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[0]), "Next System Notify"},
272 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Notify
.Next
[1]), "Next Device Notify"}
275 static ACPI_EXDUMP_INFO AcpiExDumpExtra
[6] =
277 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra
), NULL
},
278 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.Method_REG
), "_REG Method"},
279 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (Extra
.ScopeNode
), "Scope Node"},
280 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.RegionContext
), "Region Context"},
281 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Extra
.AmlStart
), "Aml Start"},
282 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (Extra
.AmlLength
), "Aml Length"}
285 static ACPI_EXDUMP_INFO AcpiExDumpData
[3] =
287 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpData
), NULL
},
288 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Handler
), "Handler"},
289 {ACPI_EXD_POINTER
, ACPI_EXD_OFFSET (Data
.Pointer
), "Raw Data"}
292 /* Miscellaneous tables */
294 static ACPI_EXDUMP_INFO AcpiExDumpCommon
[5] =
296 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon
), NULL
},
297 {ACPI_EXD_TYPE
, 0, NULL
},
298 {ACPI_EXD_UINT16
, ACPI_EXD_OFFSET (Common
.ReferenceCount
), "Reference Count"},
299 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (Common
.Flags
), "Flags"},
300 {ACPI_EXD_LIST
, ACPI_EXD_OFFSET (Common
.NextObject
), "Object List"}
303 static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon
[7] =
305 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpFieldCommon
), NULL
},
306 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.FieldFlags
), "Field Flags"},
307 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.AccessByteWidth
), "Access Byte Width"},
308 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BitLength
), "Bit Length"},
309 {ACPI_EXD_UINT8
, ACPI_EXD_OFFSET (CommonField
.StartFieldBitOffset
),"Field Bit Offset"},
310 {ACPI_EXD_UINT32
, ACPI_EXD_OFFSET (CommonField
.BaseByteOffset
), "Base Byte Offset"},
311 {ACPI_EXD_NODE
, ACPI_EXD_OFFSET (CommonField
.Node
), "Parent Node"}
314 static ACPI_EXDUMP_INFO AcpiExDumpNode
[7] =
316 {ACPI_EXD_INIT
, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode
), NULL
},
317 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (Flags
), "Flags"},
318 {ACPI_EXD_UINT8
, ACPI_EXD_NSOFFSET (OwnerId
), "Owner Id"},
319 {ACPI_EXD_LIST
, ACPI_EXD_NSOFFSET (Object
), "Object List"},
320 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Parent
), "Parent"},
321 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Child
), "Child"},
322 {ACPI_EXD_NODE
, ACPI_EXD_NSOFFSET (Peer
), "Peer"}
326 /* Dispatch table, indexed by object type */
328 static ACPI_EXDUMP_INFO
*AcpiExDumpInfo
[] =
344 AcpiExDumpBufferField
,
347 AcpiExDumpRegionField
,
349 AcpiExDumpIndexField
,
354 AcpiExDumpAddressHandler
,
363 /*******************************************************************************
365 * FUNCTION: AcpiExDumpObject
367 * PARAMETERS: ObjDesc - Descriptor to dump
368 * Info - Info table corresponding to this object
373 * DESCRIPTION: Walk the info table for this object
375 ******************************************************************************/
379 ACPI_OPERAND_OBJECT
*ObjDesc
,
380 ACPI_EXDUMP_INFO
*Info
)
385 ACPI_OPERAND_OBJECT
*Start
;
386 ACPI_OPERAND_OBJECT
*Data
= NULL
;
387 ACPI_OPERAND_OBJECT
*Next
;
388 ACPI_NAMESPACE_NODE
*Node
;
394 "ExDumpObject: Display not implemented for object type %s\n",
395 AcpiUtGetObjectTypeName (ObjDesc
));
399 /* First table entry must contain the table length (# of table entries) */
401 Count
= Info
->Offset
;
405 Target
= ACPI_ADD_PTR (UINT8
, ObjDesc
, Info
->Offset
);
408 switch (Info
->Opcode
)
416 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
417 ObjDesc
->Common
.Type
, AcpiUtGetObjectTypeName (ObjDesc
));
422 AcpiOsPrintf ("%20s : %2.2X\n", Name
, *Target
);
425 case ACPI_EXD_UINT16
:
427 AcpiOsPrintf ("%20s : %4.4X\n", Name
, ACPI_GET16 (Target
));
430 case ACPI_EXD_UINT32
:
432 AcpiOsPrintf ("%20s : %8.8X\n", Name
, ACPI_GET32 (Target
));
435 case ACPI_EXD_UINT64
:
437 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",
438 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target
)));
441 case ACPI_EXD_POINTER
:
442 case ACPI_EXD_ADDRESS
:
444 AcpiExOutPointer (Name
, *ACPI_CAST_PTR (void *, Target
));
447 case ACPI_EXD_STRING
:
449 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
453 case ACPI_EXD_BUFFER
:
456 ObjDesc
->Buffer
.Pointer
, ObjDesc
->Buffer
.Length
);
459 case ACPI_EXD_PACKAGE
:
461 /* Dump the package contents */
463 AcpiOsPrintf ("\nPackage Contents:\n");
464 AcpiExDumpPackageObj (ObjDesc
, 0, 0);
469 AcpiExDumpObject (ObjDesc
, AcpiExDumpFieldCommon
);
472 case ACPI_EXD_REFERENCE
:
474 AcpiExOutString ("Class Name", AcpiUtGetReferenceName (ObjDesc
));
475 AcpiExDumpReferenceObj (ObjDesc
);
480 Start
= *ACPI_CAST_PTR (void *, Target
);
483 AcpiOsPrintf ("%20s : %p", Name
, Next
);
486 AcpiOsPrintf ("(%s %2.2X)",
487 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
489 while (Next
->Common
.NextObject
)
491 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
497 Next
= Next
->Common
.NextObject
;
498 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
499 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
501 if ((Next
== Start
) || (Next
== Data
))
504 "\n**** Error: Object list appears to be circular linked");
513 case ACPI_EXD_HDLR_LIST
:
515 Start
= *ACPI_CAST_PTR (void *, Target
);
518 AcpiOsPrintf ("%20s : %p", Name
, Next
);
521 AcpiOsPrintf ("(%s %2.2X)",
522 AcpiUtGetObjectTypeName (Next
),
523 Next
->AddressSpace
.SpaceId
);
525 while (Next
->AddressSpace
.Next
)
527 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
533 Next
= Next
->AddressSpace
.Next
;
534 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
535 AcpiUtGetObjectTypeName (Next
),
536 Next
->AddressSpace
.SpaceId
);
538 if ((Next
== Start
) || (Next
== Data
))
541 "\n**** Error: Handler list appears to be circular linked");
550 case ACPI_EXD_RGN_LIST
:
552 Start
= *ACPI_CAST_PTR (void *, Target
);
555 AcpiOsPrintf ("%20s : %p", Name
, Next
);
558 AcpiOsPrintf ("(%s %2.2X)",
559 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
561 while (Next
->Region
.Next
)
563 if ((Next
->Common
.Type
== ACPI_TYPE_LOCAL_DATA
) &&
569 Next
= Next
->Region
.Next
;
570 AcpiOsPrintf ("->%p(%s %2.2X)", Next
,
571 AcpiUtGetObjectTypeName (Next
), Next
->Common
.Type
);
573 if ((Next
== Start
) || (Next
== Data
))
576 "\n**** Error: Region list appears to be circular linked");
587 Node
= *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE
*, Target
);
589 AcpiOsPrintf ("%20s : %p", Name
, Node
);
592 AcpiOsPrintf (" [%4.4s]", Node
->Name
.Ascii
);
599 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
610 /*******************************************************************************
612 * FUNCTION: AcpiExDumpOperand
614 * PARAMETERS: *ObjDesc - Pointer to entry to be dumped
615 * Depth - Current nesting depth
619 * DESCRIPTION: Dump an operand object
621 ******************************************************************************/
625 ACPI_OPERAND_OBJECT
*ObjDesc
,
632 ACPI_FUNCTION_NAME (ExDumpOperand
)
635 /* Check if debug output enabled */
637 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC
, _COMPONENT
))
644 /* This could be a null element of a package */
646 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Null Object Descriptor\n"));
650 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
652 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p Namespace Node: ", ObjDesc
));
653 ACPI_DUMP_ENTRY (ObjDesc
, ACPI_LV_EXEC
);
657 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
659 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
660 "%p is not a node or operand object: [%s]\n",
661 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
)));
662 ACPI_DUMP_BUFFER (ObjDesc
, sizeof (ACPI_OPERAND_OBJECT
));
666 /* ObjDesc is a valid object */
670 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%*s[%u] %p ",
671 Depth
, " ", Depth
, ObjDesc
));
675 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "%p ", ObjDesc
));
678 /* Decode object type */
680 switch (ObjDesc
->Common
.Type
)
682 case ACPI_TYPE_LOCAL_REFERENCE
:
684 AcpiOsPrintf ("Reference: [%s] ",
685 AcpiUtGetReferenceName (ObjDesc
));
687 switch (ObjDesc
->Reference
.Class
)
689 case ACPI_REFCLASS_DEBUG
:
694 case ACPI_REFCLASS_INDEX
:
696 AcpiOsPrintf ("%p\n", ObjDesc
->Reference
.Object
);
699 case ACPI_REFCLASS_TABLE
:
701 AcpiOsPrintf ("Table Index %X\n", ObjDesc
->Reference
.Value
);
704 case ACPI_REFCLASS_REFOF
:
706 AcpiOsPrintf ("%p [%s]\n", ObjDesc
->Reference
.Object
,
707 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
708 ObjDesc
->Reference
.Object
)->Common
.Type
));
711 case ACPI_REFCLASS_NAME
:
713 AcpiOsPrintf ("- [%4.4s]\n",
714 ObjDesc
->Reference
.Node
->Name
.Ascii
);
717 case ACPI_REFCLASS_ARG
:
718 case ACPI_REFCLASS_LOCAL
:
720 AcpiOsPrintf ("%X\n", ObjDesc
->Reference
.Value
);
723 default: /* Unknown reference class */
725 AcpiOsPrintf ("%2.2X\n", ObjDesc
->Reference
.Class
);
730 case ACPI_TYPE_BUFFER
:
732 AcpiOsPrintf ("Buffer length %.2X @ %p\n",
733 ObjDesc
->Buffer
.Length
, ObjDesc
->Buffer
.Pointer
);
735 /* Debug only -- dump the buffer contents */
737 if (ObjDesc
->Buffer
.Pointer
)
739 Length
= ObjDesc
->Buffer
.Length
;
746 "Buffer Contents: (displaying length 0x%.2X)\n", Length
);
747 ACPI_DUMP_BUFFER (ObjDesc
->Buffer
.Pointer
, Length
);
751 case ACPI_TYPE_INTEGER
:
753 AcpiOsPrintf ("Integer %8.8X%8.8X\n",
754 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
757 case ACPI_TYPE_PACKAGE
:
759 AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
760 ObjDesc
->Package
.Count
, ObjDesc
->Package
.Elements
);
763 * If elements exist, package element pointer is valid,
764 * and debug_level exceeds 1, dump package's elements.
766 if (ObjDesc
->Package
.Count
&&
767 ObjDesc
->Package
.Elements
&&
770 for (Index
= 0; Index
< ObjDesc
->Package
.Count
; Index
++)
773 ObjDesc
->Package
.Elements
[Index
], Depth
+ 1);
778 case ACPI_TYPE_REGION
:
780 AcpiOsPrintf ("Region %s (%X)",
781 AcpiUtGetRegionName (ObjDesc
->Region
.SpaceId
),
782 ObjDesc
->Region
.SpaceId
);
785 * If the address and length have not been evaluated,
788 if (!(ObjDesc
->Region
.Flags
& AOPOBJ_DATA_VALID
))
794 AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
795 ACPI_FORMAT_UINT64 (ObjDesc
->Region
.Address
),
796 ObjDesc
->Region
.Length
);
800 case ACPI_TYPE_STRING
:
802 AcpiOsPrintf ("String length %X @ %p ",
803 ObjDesc
->String
.Length
,
804 ObjDesc
->String
.Pointer
);
806 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
810 case ACPI_TYPE_LOCAL_BANK_FIELD
:
812 AcpiOsPrintf ("BankField\n");
815 case ACPI_TYPE_LOCAL_REGION_FIELD
:
817 AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
818 "byte=%X bit=%X of below:\n",
819 ObjDesc
->Field
.BitLength
,
820 ObjDesc
->Field
.AccessByteWidth
,
821 ObjDesc
->Field
.FieldFlags
& AML_FIELD_LOCK_RULE_MASK
,
822 ObjDesc
->Field
.FieldFlags
& AML_FIELD_UPDATE_RULE_MASK
,
823 ObjDesc
->Field
.BaseByteOffset
,
824 ObjDesc
->Field
.StartFieldBitOffset
);
826 AcpiExDumpOperand (ObjDesc
->Field
.RegionObj
, Depth
+ 1);
829 case ACPI_TYPE_LOCAL_INDEX_FIELD
:
831 AcpiOsPrintf ("IndexField\n");
834 case ACPI_TYPE_BUFFER_FIELD
:
836 AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
837 ObjDesc
->BufferField
.BitLength
,
838 ObjDesc
->BufferField
.BaseByteOffset
,
839 ObjDesc
->BufferField
.StartFieldBitOffset
);
841 if (!ObjDesc
->BufferField
.BufferObj
)
843 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "*NULL*\n"));
845 else if ((ObjDesc
->BufferField
.BufferObj
)->Common
.Type
!=
848 AcpiOsPrintf ("*not a Buffer*\n");
852 AcpiExDumpOperand (ObjDesc
->BufferField
.BufferObj
, Depth
+ 1);
856 case ACPI_TYPE_EVENT
:
858 AcpiOsPrintf ("Event\n");
861 case ACPI_TYPE_METHOD
:
863 AcpiOsPrintf ("Method(%X) @ %p:%X\n",
864 ObjDesc
->Method
.ParamCount
,
865 ObjDesc
->Method
.AmlStart
,
866 ObjDesc
->Method
.AmlLength
);
869 case ACPI_TYPE_MUTEX
:
871 AcpiOsPrintf ("Mutex\n");
874 case ACPI_TYPE_DEVICE
:
876 AcpiOsPrintf ("Device\n");
879 case ACPI_TYPE_POWER
:
881 AcpiOsPrintf ("Power\n");
884 case ACPI_TYPE_PROCESSOR
:
886 AcpiOsPrintf ("Processor\n");
889 case ACPI_TYPE_THERMAL
:
891 AcpiOsPrintf ("Thermal\n");
898 AcpiOsPrintf ("Unknown Type %X\n", ObjDesc
->Common
.Type
);
906 /*******************************************************************************
908 * FUNCTION: AcpiExDumpOperands
910 * PARAMETERS: Operands - A list of Operand objects
911 * OpcodeName - AML opcode name
912 * NumOperands - Operand count for this opcode
914 * DESCRIPTION: Dump the operands associated with the opcode
916 ******************************************************************************/
920 ACPI_OPERAND_OBJECT
**Operands
,
921 const char *OpcodeName
,
924 ACPI_FUNCTION_NAME (ExDumpOperands
);
929 OpcodeName
= "UNKNOWN";
932 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
933 "**** Start operand dump for opcode [%s], %u operands\n",
934 OpcodeName
, NumOperands
));
936 if (NumOperands
== 0)
941 /* Dump the individual operands */
945 AcpiExDumpOperand (*Operands
, 0);
950 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
,
951 "**** End operand dump for [%s]\n", OpcodeName
));
956 /*******************************************************************************
958 * FUNCTION: AcpiExOut* functions
960 * PARAMETERS: Title - Descriptive text
961 * Value - Value to be displayed
963 * DESCRIPTION: Object dump output formatting functions. These functions
964 * reduce the number of format strings required and keeps them
965 * all in one place for easy modification.
967 ******************************************************************************/
974 AcpiOsPrintf ("%20s : %s\n", Title
, Value
);
982 AcpiOsPrintf ("%20s : %p\n", Title
, Value
);
986 /*******************************************************************************
988 * FUNCTION: AcpiExDumpNamespaceNode
990 * PARAMETERS: Node - Descriptor to dump
991 * Flags - Force display if TRUE
993 * DESCRIPTION: Dumps the members of the given.Node
995 ******************************************************************************/
998 AcpiExDumpNamespaceNode (
999 ACPI_NAMESPACE_NODE
*Node
,
1003 ACPI_FUNCTION_ENTRY ();
1008 /* Check if debug output enabled */
1010 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1016 AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node
));
1017 AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
1018 Node
->Type
, AcpiUtGetTypeName (Node
->Type
));
1020 AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT
, Node
),
1025 /*******************************************************************************
1027 * FUNCTION: AcpiExDumpReferenceObj
1029 * PARAMETERS: Object - Descriptor to dump
1031 * DESCRIPTION: Dumps a reference object
1033 ******************************************************************************/
1036 AcpiExDumpReferenceObj (
1037 ACPI_OPERAND_OBJECT
*ObjDesc
)
1043 RetBuf
.Length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
1045 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_NAME
)
1047 AcpiOsPrintf (" %p ", ObjDesc
->Reference
.Node
);
1049 Status
= AcpiNsHandleToPathname (ObjDesc
->Reference
.Node
,
1051 if (ACPI_FAILURE (Status
))
1053 AcpiOsPrintf (" Could not convert name to pathname\n");
1057 AcpiOsPrintf ("%s\n", (char *) RetBuf
.Pointer
);
1058 ACPI_FREE (RetBuf
.Pointer
);
1061 else if (ObjDesc
->Reference
.Object
)
1063 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_OPERAND
)
1065 AcpiOsPrintf ("%22s %p", "Target :",
1066 ObjDesc
->Reference
.Object
);
1067 if (ObjDesc
->Reference
.Class
== ACPI_REFCLASS_TABLE
)
1069 AcpiOsPrintf (" Table Index: %X\n",
1070 ObjDesc
->Reference
.Value
);
1074 AcpiOsPrintf (" [%s]\n",
1075 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT
*)
1076 ObjDesc
->Reference
.Object
)->Common
.Type
));
1081 AcpiOsPrintf (" Target: %p\n", ObjDesc
->Reference
.Object
);
1087 /*******************************************************************************
1089 * FUNCTION: AcpiExDumpPackageObj
1091 * PARAMETERS: ObjDesc - Descriptor to dump
1092 * Level - Indentation Level
1093 * Index - Package index for this object
1095 * DESCRIPTION: Dumps the elements of the package
1097 ******************************************************************************/
1100 AcpiExDumpPackageObj (
1101 ACPI_OPERAND_OBJECT
*ObjDesc
,
1108 /* Indentation and index output */
1112 for (i
= 0; i
< Level
; i
++)
1117 AcpiOsPrintf ("[%.2d] ", Index
);
1120 AcpiOsPrintf ("%p ", ObjDesc
);
1122 /* Null package elements are allowed */
1126 AcpiOsPrintf ("[Null Object]\n");
1130 /* Packages may only contain a few object types */
1132 switch (ObjDesc
->Common
.Type
)
1134 case ACPI_TYPE_INTEGER
:
1136 AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
1137 ACPI_FORMAT_UINT64 (ObjDesc
->Integer
.Value
));
1140 case ACPI_TYPE_STRING
:
1142 AcpiOsPrintf ("[String] Value: ");
1143 AcpiUtPrintString (ObjDesc
->String
.Pointer
, ACPI_UINT8_MAX
);
1144 AcpiOsPrintf ("\n");
1147 case ACPI_TYPE_BUFFER
:
1149 AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc
->Buffer
.Length
);
1150 if (ObjDesc
->Buffer
.Length
)
1152 AcpiUtDebugDumpBuffer (
1153 ACPI_CAST_PTR (UINT8
, ObjDesc
->Buffer
.Pointer
),
1154 ObjDesc
->Buffer
.Length
, DB_DWORD_DISPLAY
, _COMPONENT
);
1158 AcpiOsPrintf ("\n");
1162 case ACPI_TYPE_PACKAGE
:
1164 AcpiOsPrintf ("[Package] Contains %u Elements:\n",
1165 ObjDesc
->Package
.Count
);
1167 for (i
= 0; i
< ObjDesc
->Package
.Count
; i
++)
1169 AcpiExDumpPackageObj (
1170 ObjDesc
->Package
.Elements
[i
], Level
+ 1, i
);
1174 case ACPI_TYPE_LOCAL_REFERENCE
:
1176 AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
1177 AcpiUtGetReferenceName (ObjDesc
),
1178 ObjDesc
->Reference
.Class
);
1179 AcpiExDumpReferenceObj (ObjDesc
);
1184 AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc
->Common
.Type
);
1190 /*******************************************************************************
1192 * FUNCTION: AcpiExDumpObjectDescriptor
1194 * PARAMETERS: ObjDesc - Descriptor to dump
1195 * Flags - Force display if TRUE
1197 * DESCRIPTION: Dumps the members of the object descriptor given.
1199 ******************************************************************************/
1202 AcpiExDumpObjectDescriptor (
1203 ACPI_OPERAND_OBJECT
*ObjDesc
,
1206 ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor
);
1216 /* Check if debug output enabled */
1218 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS
, _COMPONENT
))
1224 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) == ACPI_DESC_TYPE_NAMED
)
1226 AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE
*) ObjDesc
, Flags
);
1228 AcpiOsPrintf ("\nAttached Object (%p):\n",
1229 ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
);
1231 ObjDesc
= ((ACPI_NAMESPACE_NODE
*) ObjDesc
)->Object
;
1235 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc
) != ACPI_DESC_TYPE_OPERAND
)
1238 "%p is not an ACPI operand object: [%s]\n",
1239 ObjDesc
, AcpiUtGetDescriptorName (ObjDesc
));
1243 /* Validate the object type */
1245 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1247 AcpiOsPrintf ("Not a known object type: %2.2X\n",
1248 ObjDesc
->Common
.Type
);
1257 AcpiExDumpObject (ObjDesc
, AcpiExDumpCommon
);
1259 /* Object-specific fields */
1261 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);
1263 if (ObjDesc
->Common
.Type
== ACPI_TYPE_REGION
)
1265 ObjDesc
= ObjDesc
->Common
.NextObject
;
1266 if (ObjDesc
->Common
.Type
> ACPI_TYPE_LOCAL_MAX
)
1269 "Secondary object is not a known object type: %2.2X\n",
1270 ObjDesc
->Common
.Type
);
1275 AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc
);
1276 AcpiExDumpObject (ObjDesc
, AcpiExDumpInfo
[ObjDesc
->Common
.Type
]);