Path: blob/main/sys/contrib/dev/acpica/components/executer/exdump.c
48521 views
/******************************************************************************1*2* Module Name: exdump - Interpreter debug output routines3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#include <contrib/dev/acpica/include/acpi.h>152#include <contrib/dev/acpica/include/accommon.h>153#include <contrib/dev/acpica/include/acinterp.h>154#include <contrib/dev/acpica/include/amlcode.h>155#include <contrib/dev/acpica/include/acnamesp.h>156157158#define _COMPONENT ACPI_EXECUTER159ACPI_MODULE_NAME ("exdump")160161/*162* The following routines are used for debug output only163*/164#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)165166/* Local prototypes */167168static void169AcpiExOutString (170const char *Title,171const char *Value);172173static void174AcpiExOutPointer (175const char *Title,176const void *Value);177178static void179AcpiExDumpObject (180ACPI_OPERAND_OBJECT *ObjDesc,181ACPI_EXDUMP_INFO *Info);182183static void184AcpiExDumpReferenceObj (185ACPI_OPERAND_OBJECT *ObjDesc);186187static void188AcpiExDumpPackageObj (189ACPI_OPERAND_OBJECT *ObjDesc,190UINT32 Level,191UINT32 Index);192193194/*******************************************************************************195*196* Object Descriptor info tables197*198* Note: The first table entry must be an INIT opcode and must contain199* the table length (number of table entries)200*201******************************************************************************/202203static ACPI_EXDUMP_INFO AcpiExDumpInteger[2] =204{205{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpInteger), NULL},206{ACPI_EXD_UINT64, ACPI_EXD_OFFSET (Integer.Value), "Value"}207};208209static ACPI_EXDUMP_INFO AcpiExDumpString[4] =210{211{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpString), NULL},212{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (String.Length), "Length"},213{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (String.Pointer), "Pointer"},214{ACPI_EXD_STRING, 0, NULL}215};216217static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] =218{219{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL},220{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"},221{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"},222{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},223{ACPI_EXD_BUFFER, 0, NULL}224};225226static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =227{228{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},229{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},230{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},231{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Element Count"},232{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},233{ACPI_EXD_PACKAGE, 0, NULL}234};235236static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =237{238{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},239{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},240{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"},241{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"}242};243244static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =245{246{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent), NULL},247{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Event.OsSemaphore), "OsSemaphore"}248};249250static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =251{252{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod), NULL},253{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.InfoFlags), "Info Flags"},254{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ParamCount), "Parameter Count"},255{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.SyncLevel), "Sync Level"},256{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.Mutex), "Mutex"},257{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Method.OwnerId), "Owner Id"},258{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ThreadCount), "Thread Count"},259{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Method.AmlLength), "Aml Length"},260{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}261};262263static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] =264{265{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL},266{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"},267{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"},268{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"},269{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"},270{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"}271};272273static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] =274{275{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL},276{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"},277{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"},278{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"},279{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"},280{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"},281{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"},282{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"}283};284285static ACPI_EXDUMP_INFO AcpiExDumpPower[6] =286{287{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},288{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},289{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},290{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},291{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"},292{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"}293};294295static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =296{297{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor), NULL},298{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Processor.ProcId), "Processor ID"},299{ACPI_EXD_UINT8 , ACPI_EXD_OFFSET (Processor.Length), "Length"},300{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Processor.Address), "Address"},301{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[0]), "System Notify"},302{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[1]), "Device Notify"},303{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.Handler), "Handler"}304};305306static ACPI_EXDUMP_INFO AcpiExDumpThermal[4] =307{308{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal), NULL},309{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]), "System Notify"},310{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]), "Device Notify"},311{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.Handler), "Handler"}312};313314static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] =315{316{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField), NULL},317{ACPI_EXD_FIELD, 0, NULL},318{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"}319};320321static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] =322{323{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL},324{ACPI_EXD_FIELD, 0, NULL},325{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"},326{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"},327{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"}328};329330static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] =331{332{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField), NULL},333{ACPI_EXD_FIELD, 0, NULL},334{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (BankField.Value), "Value"},335{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BankField.RegionObj), "Region Object"},336{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BankField.BankObj), "Bank Object"}337};338339static ACPI_EXDUMP_INFO AcpiExDumpIndexField[5] =340{341{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField), NULL},342{ACPI_EXD_FIELD, 0, NULL},343{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (IndexField.Value), "Value"},344{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (IndexField.IndexObj), "Index Object"},345{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (IndexField.DataObj), "Data Object"}346};347348static ACPI_EXDUMP_INFO AcpiExDumpReference[9] =349{350{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference), NULL},351{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.Class), "Class"},352{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"},353{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"},354{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},355{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},356{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},357{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.IndexPointer), "Index Pointer"},358{ACPI_EXD_REFERENCE,0, NULL}359};360361static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =362{363{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},364{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"},365{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},366{ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},367{ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},368{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}369};370371static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =372{373{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},374{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"},375{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},376{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},377{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},378{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[0]), "Next System Notify"},379{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}380};381382static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] =383{384{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL},385{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"},386{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"},387{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"},388{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"},389{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"}390};391392static ACPI_EXDUMP_INFO AcpiExDumpData[3] =393{394{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL},395{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"},396{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"}397};398399/* Miscellaneous tables */400401static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] =402{403{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL},404{ACPI_EXD_TYPE , 0, NULL},405{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"},406{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"},407{ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"}408};409410static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =411{412{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpFieldCommon), NULL},413{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.FieldFlags), "Field Flags"},414{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.AccessByteWidth), "Access Byte Width"},415{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"},416{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},417{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"},418{ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}419};420421static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =422{423{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},424{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (Flags), "Flags"},425{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},426{ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},427{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},428{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},429{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"}430};431432433/* Dispatch table, indexed by object type */434435static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] =436{437NULL,438AcpiExDumpInteger,439AcpiExDumpString,440AcpiExDumpBuffer,441AcpiExDumpPackage,442NULL,443AcpiExDumpDevice,444AcpiExDumpEvent,445AcpiExDumpMethod,446AcpiExDumpMutex,447AcpiExDumpRegion,448AcpiExDumpPower,449AcpiExDumpProcessor,450AcpiExDumpThermal,451AcpiExDumpBufferField,452NULL,453NULL,454AcpiExDumpRegionField,455AcpiExDumpBankField,456AcpiExDumpIndexField,457AcpiExDumpReference,458NULL,459NULL,460AcpiExDumpNotify,461AcpiExDumpAddressHandler,462NULL,463NULL,464NULL,465AcpiExDumpExtra,466AcpiExDumpData467};468469470/*******************************************************************************471*472* FUNCTION: AcpiExDumpObject473*474* PARAMETERS: ObjDesc - Descriptor to dump475* Info - Info table corresponding to this object476* type477*478* RETURN: None479*480* DESCRIPTION: Walk the info table for this object481*482******************************************************************************/483484static void485AcpiExDumpObject (486ACPI_OPERAND_OBJECT *ObjDesc,487ACPI_EXDUMP_INFO *Info)488{489UINT8 *Target;490const char *Name;491UINT8 Count;492ACPI_OPERAND_OBJECT *Start;493ACPI_OPERAND_OBJECT *Data = NULL;494ACPI_OPERAND_OBJECT *Next;495ACPI_NAMESPACE_NODE *Node;496497498if (!Info)499{500AcpiOsPrintf (501"ExDumpObject: Display not implemented for object type %s\n",502AcpiUtGetObjectTypeName (ObjDesc));503return;504}505506/* First table entry must contain the table length (# of table entries) */507508Count = Info->Offset;509510while (Count)511{512if (!ObjDesc)513{514return;515}516517Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);518Name = Info->Name;519520switch (Info->Opcode)521{522case ACPI_EXD_INIT:523524break;525526case ACPI_EXD_TYPE:527528AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",529ObjDesc->Common.Type,530AcpiUtGetObjectTypeName (ObjDesc));531break;532533case ACPI_EXD_UINT8:534535AcpiOsPrintf ("%20s : %2.2X\n", Name, *Target);536break;537538case ACPI_EXD_UINT16:539540AcpiOsPrintf ("%20s : %4.4X\n", Name, ACPI_GET16 (Target));541break;542543case ACPI_EXD_UINT32:544545AcpiOsPrintf ("%20s : %8.8X\n", Name, ACPI_GET32 (Target));546break;547548case ACPI_EXD_UINT64:549550AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",551ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));552break;553554case ACPI_EXD_POINTER:555case ACPI_EXD_ADDRESS:556557AcpiExOutPointer (Name, *ACPI_CAST_PTR (void *, Target));558break;559560case ACPI_EXD_STRING:561562AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);563AcpiOsPrintf ("\n");564break;565566case ACPI_EXD_BUFFER:567568ACPI_DUMP_BUFFER (569ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);570break;571572case ACPI_EXD_PACKAGE:573574/* Dump the package contents */575576AcpiOsPrintf ("\nPackage Contents:\n");577AcpiExDumpPackageObj (ObjDesc, 0, 0);578break;579580case ACPI_EXD_FIELD:581582AcpiExDumpObject (ObjDesc, AcpiExDumpFieldCommon);583break;584585case ACPI_EXD_REFERENCE:586587AcpiExOutString ("Class Name", AcpiUtGetReferenceName (ObjDesc));588AcpiExDumpReferenceObj (ObjDesc);589break;590591case ACPI_EXD_LIST:592593Start = *ACPI_CAST_PTR (void *, Target);594Next = Start;595596AcpiOsPrintf ("%20s : %p ", Name, Next);597if (Next)598{599AcpiOsPrintf ("%s (Type %2.2X)",600AcpiUtGetObjectTypeName (Next), Next->Common.Type);601602while (Next->Common.NextObject)603{604if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&605!Data)606{607Data = Next;608}609610Next = Next->Common.NextObject;611AcpiOsPrintf ("->%p(%s %2.2X)", Next,612AcpiUtGetObjectTypeName (Next), Next->Common.Type);613614if ((Next == Start) || (Next == Data))615{616AcpiOsPrintf (617"\n**** Error: Object list appears to be circular linked");618break;619}620}621}622else623{624AcpiOsPrintf ("- No attached objects");625}626627AcpiOsPrintf ("\n");628break;629630case ACPI_EXD_HDLR_LIST:631632Start = *ACPI_CAST_PTR (void *, Target);633Next = Start;634635AcpiOsPrintf ("%20s : %p", Name, Next);636if (Next)637{638AcpiOsPrintf ("(%s %2.2X)",639AcpiUtGetObjectTypeName (Next),640Next->AddressSpace.SpaceId);641642while (Next->AddressSpace.Next)643{644if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&645!Data)646{647Data = Next;648}649650Next = Next->AddressSpace.Next;651AcpiOsPrintf ("->%p(%s %2.2X)", Next,652AcpiUtGetObjectTypeName (Next),653Next->AddressSpace.SpaceId);654655if ((Next == Start) || (Next == Data))656{657AcpiOsPrintf (658"\n**** Error: Handler list appears to be circular linked");659break;660}661}662}663664AcpiOsPrintf ("\n");665break;666667case ACPI_EXD_RGN_LIST:668669Start = *ACPI_CAST_PTR (void *, Target);670Next = Start;671672AcpiOsPrintf ("%20s : %p", Name, Next);673if (Next)674{675AcpiOsPrintf ("(%s %2.2X)",676AcpiUtGetObjectTypeName (Next), Next->Common.Type);677678while (Next->Region.Next)679{680if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&681!Data)682{683Data = Next;684}685686Next = Next->Region.Next;687AcpiOsPrintf ("->%p(%s %2.2X)", Next,688AcpiUtGetObjectTypeName (Next), Next->Common.Type);689690if ((Next == Start) || (Next == Data))691{692AcpiOsPrintf (693"\n**** Error: Region list appears to be circular linked");694break;695}696}697}698699AcpiOsPrintf ("\n");700break;701702case ACPI_EXD_NODE:703704Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);705706AcpiOsPrintf ("%20s : %p", Name, Node);707if (Node)708{709AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);710}711AcpiOsPrintf ("\n");712break;713714default:715716AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",717Info->Opcode);718return;719}720721Info++;722Count--;723}724}725726727/*******************************************************************************728*729* FUNCTION: AcpiExDumpOperand730*731* PARAMETERS: *ObjDesc - Pointer to entry to be dumped732* Depth - Current nesting depth733*734* RETURN: None735*736* DESCRIPTION: Dump an operand object737*738******************************************************************************/739740void741AcpiExDumpOperand (742ACPI_OPERAND_OBJECT *ObjDesc,743UINT32 Depth)744{745UINT32 Length;746UINT32 Index;747748749ACPI_FUNCTION_NAME (ExDumpOperand);750751752/* Check if debug output enabled */753754if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT))755{756return;757}758759if (!ObjDesc)760{761/* This could be a null element of a package */762763ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));764return;765}766767if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)768{769ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Namespace Node: ", ObjDesc));770ACPI_DUMP_ENTRY (ObjDesc, ACPI_LV_EXEC);771return;772}773774if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)775{776ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,777"%p is not a node or operand object: [%s]\n",778ObjDesc, AcpiUtGetDescriptorName (ObjDesc)));779ACPI_DUMP_BUFFER (ObjDesc, sizeof (ACPI_OPERAND_OBJECT));780return;781}782783/* ObjDesc is a valid object */784785if (Depth > 0)786{787ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",788Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));789}790else791{792ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Refs=%u ",793ObjDesc, ObjDesc->Common.ReferenceCount));794}795796/* Decode object type */797798switch (ObjDesc->Common.Type)799{800case ACPI_TYPE_LOCAL_REFERENCE:801802AcpiOsPrintf ("Reference: [%s] ",803AcpiUtGetReferenceName (ObjDesc));804805switch (ObjDesc->Reference.Class)806{807case ACPI_REFCLASS_DEBUG:808809AcpiOsPrintf ("\n");810break;811812case ACPI_REFCLASS_INDEX:813814AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object);815break;816817case ACPI_REFCLASS_TABLE:818819AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value);820break;821822case ACPI_REFCLASS_REFOF:823824AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object,825AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)826ObjDesc->Reference.Object)->Common.Type));827break;828829case ACPI_REFCLASS_NAME:830831AcpiUtRepairName (ObjDesc->Reference.Node->Name.Ascii);832AcpiOsPrintf ("- [%4.4s] (Node %p)\n",833ObjDesc->Reference.Node->Name.Ascii,834ObjDesc->Reference.Node);835break;836837case ACPI_REFCLASS_ARG:838case ACPI_REFCLASS_LOCAL:839840AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value);841break;842843default: /* Unknown reference class */844845AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);846break;847}848break;849850case ACPI_TYPE_BUFFER:851852AcpiOsPrintf ("Buffer length %.2X @ %p\n",853ObjDesc->Buffer.Length, ObjDesc->Buffer.Pointer);854855/* Debug only -- dump the buffer contents */856857if (ObjDesc->Buffer.Pointer)858{859Length = ObjDesc->Buffer.Length;860if (Length > 128)861{862Length = 128;863}864865AcpiOsPrintf (866"Buffer Contents: (displaying length 0x%.2X)\n", Length);867ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);868}869break;870871case ACPI_TYPE_INTEGER:872873AcpiOsPrintf ("Integer %8.8X%8.8X\n",874ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));875break;876877case ACPI_TYPE_PACKAGE:878879AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",880ObjDesc->Package.Count, ObjDesc->Package.Elements);881882/*883* If elements exist, package element pointer is valid,884* and debug_level exceeds 1, dump package's elements.885*/886if (ObjDesc->Package.Count &&887ObjDesc->Package.Elements &&888AcpiDbgLevel > 1)889{890for (Index = 0; Index < ObjDesc->Package.Count; Index++)891{892AcpiExDumpOperand (893ObjDesc->Package.Elements[Index], Depth + 1);894}895}896break;897898case ACPI_TYPE_REGION:899900AcpiOsPrintf ("Region %s (%X)",901AcpiUtGetRegionName (ObjDesc->Region.SpaceId),902ObjDesc->Region.SpaceId);903904/*905* If the address and length have not been evaluated,906* don't print them.907*/908if (!(ObjDesc->Region.Flags & AOPOBJ_DATA_VALID))909{910AcpiOsPrintf ("\n");911}912else913{914AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",915ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),916ObjDesc->Region.Length);917}918break;919920case ACPI_TYPE_STRING:921922AcpiOsPrintf ("String length %X @ %p ",923ObjDesc->String.Length,924ObjDesc->String.Pointer);925926AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);927AcpiOsPrintf ("\n");928break;929930case ACPI_TYPE_LOCAL_BANK_FIELD:931932AcpiOsPrintf ("BankField\n");933break;934935case ACPI_TYPE_LOCAL_REGION_FIELD:936937AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "938"byte=%X bit=%X of below:\n",939ObjDesc->Field.BitLength,940ObjDesc->Field.AccessByteWidth,941ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK,942ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK,943ObjDesc->Field.BaseByteOffset,944ObjDesc->Field.StartFieldBitOffset);945946AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth + 1);947break;948949case ACPI_TYPE_LOCAL_INDEX_FIELD:950951AcpiOsPrintf ("IndexField\n");952break;953954case ACPI_TYPE_BUFFER_FIELD:955956AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",957ObjDesc->BufferField.BitLength,958ObjDesc->BufferField.BaseByteOffset,959ObjDesc->BufferField.StartFieldBitOffset);960961if (!ObjDesc->BufferField.BufferObj)962{963ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));964}965else if ((ObjDesc->BufferField.BufferObj)->Common.Type !=966ACPI_TYPE_BUFFER)967{968AcpiOsPrintf ("*not a Buffer*\n");969}970else971{972AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth + 1);973}974break;975976case ACPI_TYPE_EVENT:977978AcpiOsPrintf ("Event\n");979break;980981case ACPI_TYPE_METHOD:982983AcpiOsPrintf ("Method(%X) @ %p:%X\n",984ObjDesc->Method.ParamCount,985ObjDesc->Method.AmlStart,986ObjDesc->Method.AmlLength);987break;988989case ACPI_TYPE_MUTEX:990991AcpiOsPrintf ("Mutex\n");992break;993994case ACPI_TYPE_DEVICE:995996AcpiOsPrintf ("Device\n");997break;998999case ACPI_TYPE_POWER:10001001AcpiOsPrintf ("Power\n");1002break;10031004case ACPI_TYPE_PROCESSOR:10051006AcpiOsPrintf ("Processor\n");1007break;10081009case ACPI_TYPE_THERMAL:10101011AcpiOsPrintf ("Thermal\n");1012break;10131014default:10151016/* Unknown Type */10171018AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type);1019break;1020}10211022return;1023}102410251026/*******************************************************************************1027*1028* FUNCTION: AcpiExDumpOperands1029*1030* PARAMETERS: Operands - A list of Operand objects1031* OpcodeName - AML opcode name1032* NumOperands - Operand count for this opcode1033*1034* DESCRIPTION: Dump the operands associated with the opcode1035*1036******************************************************************************/10371038void1039AcpiExDumpOperands (1040ACPI_OPERAND_OBJECT **Operands,1041const char *OpcodeName,1042UINT32 NumOperands)1043{1044ACPI_FUNCTION_TRACE (ExDumpOperands);104510461047if (!OpcodeName)1048{1049OpcodeName = "UNKNOWN";1050}10511052ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,1053"**** Start operand dump for opcode [%s], %u operands\n",1054OpcodeName, NumOperands));10551056if (NumOperands == 0)1057{1058NumOperands = 1;1059}10601061/* Dump the individual operands */10621063while (NumOperands)1064{1065AcpiExDumpOperand (*Operands, 0);1066Operands++;1067NumOperands--;1068}10691070ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,1071"**** End operand dump for [%s]\n", OpcodeName));1072return_VOID;1073}107410751076/*******************************************************************************1077*1078* FUNCTION: AcpiExOut* functions1079*1080* PARAMETERS: Title - Descriptive text1081* Value - Value to be displayed1082*1083* DESCRIPTION: Object dump output formatting functions. These functions1084* reduce the number of format strings required and keeps them1085* all in one place for easy modification.1086*1087******************************************************************************/10881089static void1090AcpiExOutString (1091const char *Title,1092const char *Value)1093{1094AcpiOsPrintf ("%20s : %s\n", Title, Value);1095}10961097static void1098AcpiExOutPointer (1099const char *Title,1100const void *Value)1101{1102AcpiOsPrintf ("%20s : %p\n", Title, Value);1103}110411051106/*******************************************************************************1107*1108* FUNCTION: AcpiExDumpNamespaceNode1109*1110* PARAMETERS: Node - Descriptor to dump1111* Flags - Force display if TRUE1112*1113* DESCRIPTION: Dumps the members of the given.Node1114*1115******************************************************************************/11161117void1118AcpiExDumpNamespaceNode (1119ACPI_NAMESPACE_NODE *Node,1120UINT32 Flags)1121{11221123ACPI_FUNCTION_ENTRY ();112411251126if (!Flags)1127{1128/* Check if debug output enabled */11291130if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))1131{1132return;1133}1134}11351136AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));1137AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",1138Node->Type, AcpiUtGetTypeName (Node->Type));11391140AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),1141AcpiExDumpNode);1142}114311441145/*******************************************************************************1146*1147* FUNCTION: AcpiExDumpReferenceObj1148*1149* PARAMETERS: Object - Descriptor to dump1150*1151* DESCRIPTION: Dumps a reference object1152*1153******************************************************************************/11541155static void1156AcpiExDumpReferenceObj (1157ACPI_OPERAND_OBJECT *ObjDesc)1158{1159ACPI_BUFFER RetBuf;1160ACPI_STATUS Status;116111621163RetBuf.Length = ACPI_ALLOCATE_LOCAL_BUFFER;11641165if (ObjDesc->Reference.Class == ACPI_REFCLASS_NAME)1166{1167AcpiOsPrintf (" %p ", ObjDesc->Reference.Node);11681169Status = AcpiNsHandleToPathname (ObjDesc->Reference.Node,1170&RetBuf, TRUE);1171if (ACPI_FAILURE (Status))1172{1173AcpiOsPrintf (" Could not convert name to pathname: %s\n",1174AcpiFormatException (Status));1175}1176else1177{1178AcpiOsPrintf ("%s: %s\n",1179AcpiUtGetTypeName (ObjDesc->Reference.Node->Type),1180(char *) RetBuf.Pointer);1181ACPI_FREE (RetBuf.Pointer);1182}1183}1184else if (ObjDesc->Reference.Object)1185{1186if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)1187{1188AcpiOsPrintf ("%22s %p", "Target :",1189ObjDesc->Reference.Object);1190if (ObjDesc->Reference.Class == ACPI_REFCLASS_TABLE)1191{1192AcpiOsPrintf (" Table Index: %X\n",1193ObjDesc->Reference.Value);1194}1195else1196{1197AcpiOsPrintf (" [%s]\n",1198AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)1199ObjDesc->Reference.Object)->Common.Type));1200}1201}1202else1203{1204AcpiOsPrintf (" Target: %p\n", ObjDesc->Reference.Object);1205}1206}1207}120812091210/*******************************************************************************1211*1212* FUNCTION: AcpiExDumpPackageObj1213*1214* PARAMETERS: ObjDesc - Descriptor to dump1215* Level - Indentation Level1216* Index - Package index for this object1217*1218* DESCRIPTION: Dumps the elements of the package1219*1220******************************************************************************/12211222static void1223AcpiExDumpPackageObj (1224ACPI_OPERAND_OBJECT *ObjDesc,1225UINT32 Level,1226UINT32 Index)1227{1228UINT32 i;122912301231/* Indentation and index output */12321233if (Level > 0)1234{1235for (i = 0; i < Level; i++)1236{1237AcpiOsPrintf (" ");1238}12391240AcpiOsPrintf ("[%.2d] ", Index);1241}12421243AcpiOsPrintf ("%p ", ObjDesc);12441245/* Null package elements are allowed */12461247if (!ObjDesc)1248{1249AcpiOsPrintf ("[Null Object]\n");1250return;1251}12521253/* Packages may only contain a few object types */12541255switch (ObjDesc->Common.Type)1256{1257case ACPI_TYPE_INTEGER:12581259AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",1260ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));1261break;12621263case ACPI_TYPE_STRING:12641265AcpiOsPrintf ("[String] Value: ");1266AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);1267AcpiOsPrintf ("\n");1268break;12691270case ACPI_TYPE_BUFFER:12711272AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);1273if (ObjDesc->Buffer.Length)1274{1275AcpiUtDebugDumpBuffer (1276ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),1277ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);1278}1279else1280{1281AcpiOsPrintf ("\n");1282}1283break;12841285case ACPI_TYPE_PACKAGE:12861287AcpiOsPrintf ("[Package] Contains %u Elements:\n",1288ObjDesc->Package.Count);12891290for (i = 0; i < ObjDesc->Package.Count; i++)1291{1292AcpiExDumpPackageObj (1293ObjDesc->Package.Elements[i], Level + 1, i);1294}1295break;12961297case ACPI_TYPE_LOCAL_REFERENCE:12981299AcpiOsPrintf ("[Object Reference] Class [%s]",1300AcpiUtGetReferenceName (ObjDesc));1301AcpiExDumpReferenceObj (ObjDesc);1302break;13031304default:13051306AcpiOsPrintf ("[%s] Type: %2.2X\n",1307AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type);1308break;1309}1310}131113121313/*******************************************************************************1314*1315* FUNCTION: AcpiExDumpObjectDescriptor1316*1317* PARAMETERS: ObjDesc - Descriptor to dump1318* Flags - Force display if TRUE1319*1320* DESCRIPTION: Dumps the members of the object descriptor given.1321*1322******************************************************************************/13231324void1325AcpiExDumpObjectDescriptor (1326ACPI_OPERAND_OBJECT *ObjDesc,1327UINT32 Flags)1328{1329ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor);133013311332if (!ObjDesc)1333{1334return_VOID;1335}13361337if (!Flags)1338{1339/* Check if debug output enabled */13401341if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))1342{1343return_VOID;1344}1345}13461347if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)1348{1349AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);13501351ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;1352if (!ObjDesc)1353{1354return_VOID;1355}13561357AcpiOsPrintf ("\nAttached Object %p", ObjDesc);1358if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)1359{1360AcpiOsPrintf (" - Namespace Node");1361}13621363AcpiOsPrintf (":\n");1364goto DumpObject;1365}13661367if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)1368{1369AcpiOsPrintf (1370"%p is not an ACPI operand object: [%s]\n",1371ObjDesc, AcpiUtGetDescriptorName (ObjDesc));1372return_VOID;1373}13741375/* Validate the object type */13761377if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)1378{1379AcpiOsPrintf ("Not a known object type: %2.2X\n",1380ObjDesc->Common.Type);1381return_VOID;1382}138313841385DumpObject:13861387if (!ObjDesc)1388{1389return_VOID;1390}13911392/* Common Fields */13931394AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);13951396/* Object-specific fields */13971398AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);13991400if (ObjDesc->Common.Type == ACPI_TYPE_REGION)1401{1402ObjDesc = ObjDesc->Common.NextObject;1403if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)1404{1405AcpiOsPrintf (1406"Secondary object is not a known object type: %2.2X\n",1407ObjDesc->Common.Type);14081409return_VOID;1410}14111412AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);1413AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);1414}14151416return_VOID;1417}14181419#endif142014211422