Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:03

0001 /******************************************************************************
0002  *
0003  * Module Name: utdecode - Utility decoding routines (value-to-string)
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights. You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code. No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision. In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change. Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee. Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution. In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government. In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************
0115  *
0116  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #include "acpi.h"
0153 #include "accommon.h"
0154 #include "acnamesp.h"
0155 #include "amlcode.h"
0156 
0157 #define _COMPONENT          ACPI_UTILITIES
0158         ACPI_MODULE_NAME    ("utdecode")
0159 
0160 
0161 /*
0162  * Properties of the ACPI Object Types, both internal and external.
0163  * The table is indexed by values of ACPI_OBJECT_TYPE
0164  */
0165 const UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
0166 {
0167     ACPI_NS_NORMAL,                     /* 00 Any              */
0168     ACPI_NS_NORMAL,                     /* 01 Number           */
0169     ACPI_NS_NORMAL,                     /* 02 String           */
0170     ACPI_NS_NORMAL,                     /* 03 Buffer           */
0171     ACPI_NS_NORMAL,                     /* 04 Package          */
0172     ACPI_NS_NORMAL,                     /* 05 FieldUnit        */
0173     ACPI_NS_NEWSCOPE,                   /* 06 Device           */
0174     ACPI_NS_NORMAL,                     /* 07 Event            */
0175     ACPI_NS_NEWSCOPE,                   /* 08 Method           */
0176     ACPI_NS_NORMAL,                     /* 09 Mutex            */
0177     ACPI_NS_NORMAL,                     /* 10 Region           */
0178     ACPI_NS_NEWSCOPE,                   /* 11 Power            */
0179     ACPI_NS_NEWSCOPE,                   /* 12 Processor        */
0180     ACPI_NS_NEWSCOPE,                   /* 13 Thermal          */
0181     ACPI_NS_NORMAL,                     /* 14 BufferField      */
0182     ACPI_NS_NORMAL,                     /* 15 DdbHandle        */
0183     ACPI_NS_NORMAL,                     /* 16 Debug Object     */
0184     ACPI_NS_NORMAL,                     /* 17 DefField         */
0185     ACPI_NS_NORMAL,                     /* 18 BankField        */
0186     ACPI_NS_NORMAL,                     /* 19 IndexField       */
0187     ACPI_NS_NORMAL,                     /* 20 Reference        */
0188     ACPI_NS_NORMAL,                     /* 21 Alias            */
0189     ACPI_NS_NORMAL,                     /* 22 MethodAlias      */
0190     ACPI_NS_NORMAL,                     /* 23 Notify           */
0191     ACPI_NS_NORMAL,                     /* 24 Address Handler  */
0192     ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 25 Resource Desc    */
0193     ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 26 Resource Field   */
0194     ACPI_NS_NEWSCOPE,                   /* 27 Scope            */
0195     ACPI_NS_NORMAL,                     /* 28 Extra            */
0196     ACPI_NS_NORMAL,                     /* 29 Data             */
0197     ACPI_NS_NORMAL                      /* 30 Invalid          */
0198 };
0199 
0200 
0201 /*******************************************************************************
0202  *
0203  * FUNCTION:    AcpiUtGetRegionName
0204  *
0205  * PARAMETERS:  Space ID            - ID for the region
0206  *
0207  * RETURN:      Decoded region SpaceId name
0208  *
0209  * DESCRIPTION: Translate a Space ID into a name string (Debug only)
0210  *
0211  ******************************************************************************/
0212 
0213 /* Region type decoding */
0214 
0215 const char        *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
0216 {
0217     "SystemMemory",       /* 0x00 */
0218     "SystemIO",           /* 0x01 */
0219     "PCI_Config",         /* 0x02 */
0220     "EmbeddedControl",    /* 0x03 */
0221     "SMBus",              /* 0x04 */
0222     "SystemCMOS",         /* 0x05 */
0223     "PCIBARTarget",       /* 0x06 */
0224     "IPMI",               /* 0x07 */
0225     "GeneralPurposeIo",   /* 0x08 */
0226     "GenericSerialBus",   /* 0x09 */
0227     "PCC",                /* 0x0A */
0228     "PlatformRtMechanism" /* 0x0B */
0229 };
0230 
0231 
0232 const char *
0233 AcpiUtGetRegionName (
0234     UINT8                   SpaceId)
0235 {
0236 
0237     if (SpaceId >= ACPI_USER_REGION_BEGIN)
0238     {
0239         return ("UserDefinedRegion");
0240     }
0241     else if (SpaceId == ACPI_ADR_SPACE_DATA_TABLE)
0242     {
0243         return ("DataTable");
0244     }
0245     else if (SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)
0246     {
0247         return ("FunctionalFixedHW");
0248     }
0249     else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
0250     {
0251         return ("InvalidSpaceId");
0252     }
0253 
0254     return (AcpiGbl_RegionTypes[SpaceId]);
0255 }
0256 
0257 
0258 /*******************************************************************************
0259  *
0260  * FUNCTION:    AcpiUtGetEventName
0261  *
0262  * PARAMETERS:  EventId             - Fixed event ID
0263  *
0264  * RETURN:      Decoded event ID name
0265  *
0266  * DESCRIPTION: Translate a Event ID into a name string (Debug only)
0267  *
0268  ******************************************************************************/
0269 
0270 /* Event type decoding */
0271 
0272 static const char        *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
0273 {
0274     "PM_Timer",
0275     "GlobalLock",
0276     "PowerButton",
0277     "SleepButton",
0278     "RealTimeClock",
0279 };
0280 
0281 
0282 const char *
0283 AcpiUtGetEventName (
0284     UINT32                  EventId)
0285 {
0286 
0287     if (EventId > ACPI_EVENT_MAX)
0288     {
0289         return ("InvalidEventID");
0290     }
0291 
0292     return (AcpiGbl_EventTypes[EventId]);
0293 }
0294 
0295 
0296 /*******************************************************************************
0297  *
0298  * FUNCTION:    AcpiUtGetTypeName
0299  *
0300  * PARAMETERS:  Type                - An ACPI object type
0301  *
0302  * RETURN:      Decoded ACPI object type name
0303  *
0304  * DESCRIPTION: Translate a Type ID into a name string (Debug only)
0305  *
0306  ******************************************************************************/
0307 
0308 /*
0309  * Elements of AcpiGbl_NsTypeNames below must match
0310  * one-to-one with values of ACPI_OBJECT_TYPE
0311  *
0312  * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
0313  * when stored in a table it really means that we have thus far seen no
0314  * evidence to indicate what type is actually going to be stored for this
0315  & entry.
0316  */
0317 static const char           AcpiGbl_BadType[] = "UNDEFINED";
0318 
0319 /* Printable names of the ACPI object types */
0320 
0321 static const char           *AcpiGbl_NsTypeNames[] =
0322 {
0323     /* 00 */ "Untyped",
0324     /* 01 */ "Integer",
0325     /* 02 */ "String",
0326     /* 03 */ "Buffer",
0327     /* 04 */ "Package",
0328     /* 05 */ "FieldUnit",
0329     /* 06 */ "Device",
0330     /* 07 */ "Event",
0331     /* 08 */ "Method",
0332     /* 09 */ "Mutex",
0333     /* 10 */ "Region",
0334     /* 11 */ "Power",
0335     /* 12 */ "Processor",
0336     /* 13 */ "Thermal",
0337     /* 14 */ "BufferField",
0338     /* 15 */ "DdbHandle",
0339     /* 16 */ "DebugObject",
0340     /* 17 */ "RegionField",
0341     /* 18 */ "BankField",
0342     /* 19 */ "IndexField",
0343     /* 20 */ "Reference",
0344     /* 21 */ "Alias",
0345     /* 22 */ "MethodAlias",
0346     /* 23 */ "Notify",
0347     /* 24 */ "AddrHandler",
0348     /* 25 */ "ResourceDesc",
0349     /* 26 */ "ResourceFld",
0350     /* 27 */ "Scope",
0351     /* 28 */ "Extra",
0352     /* 29 */ "Data",
0353     /* 30 */ "Invalid"
0354 };
0355 
0356 
0357 const char *
0358 AcpiUtGetTypeName (
0359     ACPI_OBJECT_TYPE        Type)
0360 {
0361 
0362     if (Type > ACPI_TYPE_INVALID)
0363     {
0364         return (AcpiGbl_BadType);
0365     }
0366 
0367     return (AcpiGbl_NsTypeNames[Type]);
0368 }
0369 
0370 
0371 const char *
0372 AcpiUtGetObjectTypeName (
0373     ACPI_OPERAND_OBJECT     *ObjDesc)
0374 {
0375     ACPI_FUNCTION_TRACE (UtGetObjectTypeName);
0376 
0377 
0378     if (!ObjDesc)
0379     {
0380         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
0381         return_STR ("[NULL Object Descriptor]");
0382     }
0383 
0384     /* These descriptor types share a common area */
0385 
0386     if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) &&
0387         (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_NAMED))
0388     {
0389         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0390             "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n",
0391             ACPI_GET_DESCRIPTOR_TYPE (ObjDesc),
0392             AcpiUtGetDescriptorName (ObjDesc), ObjDesc));
0393 
0394         return_STR ("Invalid object");
0395     }
0396 
0397     return_STR (AcpiUtGetTypeName (ObjDesc->Common.Type));
0398 }
0399 
0400 
0401 /*******************************************************************************
0402  *
0403  * FUNCTION:    AcpiUtGetNodeName
0404  *
0405  * PARAMETERS:  Object               - A namespace node
0406  *
0407  * RETURN:      ASCII name of the node
0408  *
0409  * DESCRIPTION: Validate the node and return the node's ACPI name.
0410  *
0411  ******************************************************************************/
0412 
0413 const char *
0414 AcpiUtGetNodeName (
0415     void                    *Object)
0416 {
0417     ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) Object;
0418 
0419 
0420     /* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */
0421 
0422     if (!Object)
0423     {
0424         return ("NULL");
0425     }
0426 
0427     /* Check for Root node */
0428 
0429     if ((Object == ACPI_ROOT_OBJECT) ||
0430         (Object == AcpiGbl_RootNode))
0431     {
0432         return ("\"\\\" ");
0433     }
0434 
0435     /* Descriptor must be a namespace node */
0436 
0437     if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
0438     {
0439         return ("####");
0440     }
0441 
0442     /*
0443      * Ensure name is valid. The name was validated/repaired when the node
0444      * was created, but make sure it has not been corrupted.
0445      */
0446     AcpiUtRepairName (Node->Name.Ascii);
0447 
0448     /* Return the name */
0449 
0450     return (Node->Name.Ascii);
0451 }
0452 
0453 
0454 /*******************************************************************************
0455  *
0456  * FUNCTION:    AcpiUtGetDescriptorName
0457  *
0458  * PARAMETERS:  Object               - An ACPI object
0459  *
0460  * RETURN:      Decoded name of the descriptor type
0461  *
0462  * DESCRIPTION: Validate object and return the descriptor type
0463  *
0464  ******************************************************************************/
0465 
0466 /* Printable names of object descriptor types */
0467 
0468 static const char           *AcpiGbl_DescTypeNames[] =
0469 {
0470     /* 00 */ "Not a Descriptor",
0471     /* 01 */ "Cached Object",
0472     /* 02 */ "State-Generic",
0473     /* 03 */ "State-Update",
0474     /* 04 */ "State-Package",
0475     /* 05 */ "State-Control",
0476     /* 06 */ "State-RootParseScope",
0477     /* 07 */ "State-ParseScope",
0478     /* 08 */ "State-WalkScope",
0479     /* 09 */ "State-Result",
0480     /* 10 */ "State-Notify",
0481     /* 11 */ "State-Thread",
0482     /* 12 */ "Tree Walk State",
0483     /* 13 */ "Parse Tree Op",
0484     /* 14 */ "Operand Object",
0485     /* 15 */ "Namespace Node"
0486 };
0487 
0488 
0489 const char *
0490 AcpiUtGetDescriptorName (
0491     void                    *Object)
0492 {
0493 
0494     if (!Object)
0495     {
0496         return ("NULL OBJECT");
0497     }
0498 
0499     if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
0500     {
0501         return ("Not a Descriptor");
0502     }
0503 
0504     return (AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]);
0505 }
0506 
0507 
0508 /*******************************************************************************
0509  *
0510  * FUNCTION:    AcpiUtGetReferenceName
0511  *
0512  * PARAMETERS:  Object               - An ACPI reference object
0513  *
0514  * RETURN:      Decoded name of the type of reference
0515  *
0516  * DESCRIPTION: Decode a reference object sub-type to a string.
0517  *
0518  ******************************************************************************/
0519 
0520 /* Printable names of reference object sub-types */
0521 
0522 static const char           *AcpiGbl_RefClassNames[] =
0523 {
0524     /* 00 */ "Local",
0525     /* 01 */ "Argument",
0526     /* 02 */ "RefOf",
0527     /* 03 */ "Index",
0528     /* 04 */ "DdbHandle",
0529     /* 05 */ "Named Object",
0530     /* 06 */ "Debug"
0531 };
0532 
0533 const char *
0534 AcpiUtGetReferenceName (
0535     ACPI_OPERAND_OBJECT     *Object)
0536 {
0537 
0538     if (!Object)
0539     {
0540         return ("NULL Object");
0541     }
0542 
0543     if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
0544     {
0545         return ("Not an Operand object");
0546     }
0547 
0548     if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
0549     {
0550         return ("Not a Reference object");
0551     }
0552 
0553     if (Object->Reference.Class > ACPI_REFCLASS_MAX)
0554     {
0555         return ("Unknown Reference class");
0556     }
0557 
0558     return (AcpiGbl_RefClassNames[Object->Reference.Class]);
0559 }
0560 
0561 
0562 /*******************************************************************************
0563  *
0564  * FUNCTION:    AcpiUtGetMutexName
0565  *
0566  * PARAMETERS:  MutexId         - The predefined ID for this mutex.
0567  *
0568  * RETURN:      Decoded name of the internal mutex
0569  *
0570  * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
0571  *
0572  ******************************************************************************/
0573 
0574 /* Names for internal mutex objects, used for debug output */
0575 
0576 static const char           *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
0577 {
0578     "ACPI_MTX_Interpreter",
0579     "ACPI_MTX_Namespace",
0580     "ACPI_MTX_Tables",
0581     "ACPI_MTX_Events",
0582     "ACPI_MTX_Caches",
0583     "ACPI_MTX_Memory",
0584 };
0585 
0586 const char *
0587 AcpiUtGetMutexName (
0588     UINT32                  MutexId)
0589 {
0590 
0591     if (MutexId > ACPI_MAX_MUTEX)
0592     {
0593         return ("Invalid Mutex ID");
0594     }
0595 
0596     return (AcpiGbl_MutexNames[MutexId]);
0597 }
0598 
0599 
0600 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0601 
0602 /*
0603  * Strings and procedures used for debug only
0604  */
0605 
0606 /*******************************************************************************
0607  *
0608  * FUNCTION:    AcpiUtGetNotifyName
0609  *
0610  * PARAMETERS:  NotifyValue     - Value from the Notify() request
0611  *
0612  * RETURN:      Decoded name for the notify value
0613  *
0614  * DESCRIPTION: Translate a Notify Value to a notify namestring.
0615  *
0616  ******************************************************************************/
0617 
0618 /* Names for Notify() values, used for debug output */
0619 
0620 static const char           *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] =
0621 {
0622     /* 00 */ "Bus Check",
0623     /* 01 */ "Device Check",
0624     /* 02 */ "Device Wake",
0625     /* 03 */ "Eject Request",
0626     /* 04 */ "Device Check Light",
0627     /* 05 */ "Frequency Mismatch",
0628     /* 06 */ "Bus Mode Mismatch",
0629     /* 07 */ "Power Fault",
0630     /* 08 */ "Capabilities Check",
0631     /* 09 */ "Device PLD Check",
0632     /* 0A */ "Reserved",
0633     /* 0B */ "System Locality Update",
0634     /* 0C */ "Reserved (was previously Shutdown Request)",  /* Reserved in ACPI 6.0 */
0635     /* 0D */ "System Resource Affinity Update",
0636     /* 0E */ "Heterogeneous Memory Attributes Update",      /* ACPI 6.2 */
0637     /* 0F */ "Error Disconnect Recover"                     /* ACPI 6.3 */
0638 };
0639 
0640 static const char           *AcpiGbl_DeviceNotify[5] =
0641 {
0642     /* 80 */ "Status Change",
0643     /* 81 */ "Information Change",
0644     /* 82 */ "Device-Specific Change",
0645     /* 83 */ "Device-Specific Change",
0646     /* 84 */ "Reserved"
0647 };
0648 
0649 static const char           *AcpiGbl_ProcessorNotify[5] =
0650 {
0651     /* 80 */ "Performance Capability Change",
0652     /* 81 */ "C-State Change",
0653     /* 82 */ "Throttling Capability Change",
0654     /* 83 */ "Guaranteed Change",
0655     /* 84 */ "Minimum Excursion"
0656 };
0657 
0658 static const char           *AcpiGbl_ThermalNotify[5] =
0659 {
0660     /* 80 */ "Thermal Status Change",
0661     /* 81 */ "Thermal Trip Point Change",
0662     /* 82 */ "Thermal Device List Change",
0663     /* 83 */ "Thermal Relationship Change",
0664     /* 84 */ "Reserved"
0665 };
0666 
0667 
0668 const char *
0669 AcpiUtGetNotifyName (
0670     UINT32                  NotifyValue,
0671     ACPI_OBJECT_TYPE        Type)
0672 {
0673 
0674     /* 00 - 0F are "common to all object types" (from ACPI Spec) */
0675 
0676     if (NotifyValue <= ACPI_GENERIC_NOTIFY_MAX)
0677     {
0678         return (AcpiGbl_GenericNotify[NotifyValue]);
0679     }
0680 
0681     /* 10 - 7F are reserved */
0682 
0683     if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
0684     {
0685         return ("Reserved");
0686     }
0687 
0688     /* 80 - 84 are per-object-type */
0689 
0690     if (NotifyValue <= ACPI_SPECIFIC_NOTIFY_MAX)
0691     {
0692         switch (Type)
0693         {
0694         case ACPI_TYPE_ANY:
0695         case ACPI_TYPE_DEVICE:
0696             return (AcpiGbl_DeviceNotify [NotifyValue - 0x80]);
0697 
0698         case ACPI_TYPE_PROCESSOR:
0699             return (AcpiGbl_ProcessorNotify [NotifyValue - 0x80]);
0700 
0701         case ACPI_TYPE_THERMAL:
0702             return (AcpiGbl_ThermalNotify [NotifyValue - 0x80]);
0703 
0704         default:
0705             return ("Target object type does not support notifies");
0706         }
0707     }
0708 
0709     /* 84 - BF are device-specific */
0710 
0711     if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
0712     {
0713         return ("Device-Specific");
0714     }
0715 
0716     /* C0 and above are hardware-specific */
0717 
0718     return ("Hardware-Specific");
0719 }
0720 
0721 
0722 /*******************************************************************************
0723  *
0724  * FUNCTION:    AcpiUtGetArgumentTypeName
0725  *
0726  * PARAMETERS:  ArgType             - an ARGP_* parser argument type
0727  *
0728  * RETURN:      Decoded ARGP_* type
0729  *
0730  * DESCRIPTION: Decode an ARGP_* parser type, as defined in the amlcode.h file,
0731  *              and used in the acopcode.h file. For example, ARGP_TERMARG.
0732  *              Used for debug only.
0733  *
0734  ******************************************************************************/
0735 
0736 static const char           *AcpiGbl_ArgumentType[20] =
0737 {
0738     /* 00 */ "Unknown ARGP",
0739     /* 01 */ "ByteData",
0740     /* 02 */ "ByteList",
0741     /* 03 */ "CharList",
0742     /* 04 */ "DataObject",
0743     /* 05 */ "DataObjectList",
0744     /* 06 */ "DWordData",
0745     /* 07 */ "FieldList",
0746     /* 08 */ "Name",
0747     /* 09 */ "NameString",
0748     /* 0A */ "ObjectList",
0749     /* 0B */ "PackageLength",
0750     /* 0C */ "SuperName",
0751     /* 0D */ "Target",
0752     /* 0E */ "TermArg",
0753     /* 0F */ "TermList",
0754     /* 10 */ "WordData",
0755     /* 11 */ "QWordData",
0756     /* 12 */ "SimpleName",
0757     /* 13 */ "NameOrRef"
0758 };
0759 
0760 const char *
0761 AcpiUtGetArgumentTypeName (
0762     UINT32                  ArgType)
0763 {
0764 
0765     if (ArgType > ARGP_MAX)
0766     {
0767         return ("Unknown ARGP");
0768     }
0769 
0770     return (AcpiGbl_ArgumentType[ArgType]);
0771 }
0772 
0773 #endif
0774 
0775 
0776 /*******************************************************************************
0777  *
0778  * FUNCTION:    AcpiUtValidObjectType
0779  *
0780  * PARAMETERS:  Type            - Object type to be validated
0781  *
0782  * RETURN:      TRUE if valid object type, FALSE otherwise
0783  *
0784  * DESCRIPTION: Validate an object type
0785  *
0786  ******************************************************************************/
0787 
0788 BOOLEAN
0789 AcpiUtValidObjectType (
0790     ACPI_OBJECT_TYPE        Type)
0791 {
0792 
0793     if (Type > ACPI_TYPE_LOCAL_MAX)
0794     {
0795         /* Note: Assumes all TYPEs are contiguous (external/local) */
0796 
0797         return (FALSE);
0798     }
0799 
0800     return (TRUE);
0801 }