ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

utdecode.c
Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * Module Name: utdecode - Utility decoding routines (value-to-string)
00004  *
00005  *****************************************************************************/
00006 
00007 /******************************************************************************
00008  *
00009  * 1. Copyright Notice
00010  *
00011  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00012  * All rights reserved.
00013  *
00014  * 2. License
00015  *
00016  * 2.1. This is your license from Intel Corp. under its intellectual property
00017  * rights.  You may have additional license terms from the party that provided
00018  * you this software, covering your right to use that party's intellectual
00019  * property rights.
00020  *
00021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00022  * copy of the source code appearing in this file ("Covered Code") an
00023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00024  * base code distributed originally by Intel ("Original Intel Code") to copy,
00025  * make derivatives, distribute, use and display any portion of the Covered
00026  * Code in any form, with the right to sublicense such rights; and
00027  *
00028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00029  * license (with the right to sublicense), under only those claims of Intel
00030  * patents that are infringed by the Original Intel Code, to make, use, sell,
00031  * offer to sell, and import the Covered Code and derivative works thereof
00032  * solely to the minimum extent necessary to exercise the above copyright
00033  * license, and in no event shall the patent license extend to any additions
00034  * to or modifications of the Original Intel Code.  No other license or right
00035  * is granted directly or by implication, estoppel or otherwise;
00036  *
00037  * The above copyright and patent license is granted only if the following
00038  * conditions are met:
00039  *
00040  * 3. Conditions
00041  *
00042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00043  * Redistribution of source code of any substantial portion of the Covered
00044  * Code or modification with rights to further distribute source must include
00045  * the above Copyright Notice, the above License, this list of Conditions,
00046  * and the following Disclaimer and Export Compliance provision.  In addition,
00047  * Licensee must cause all Covered Code to which Licensee contributes to
00048  * contain a file documenting the changes Licensee made to create that Covered
00049  * Code and the date of any change.  Licensee must include in that file the
00050  * documentation of any changes made by any predecessor Licensee.  Licensee
00051  * must include a prominent statement that the modification is derived,
00052  * directly or indirectly, from Original Intel Code.
00053  *
00054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00055  * Redistribution of source code of any substantial portion of the Covered
00056  * Code or modification without rights to further distribute source must
00057  * include the following Disclaimer and Export Compliance provision in the
00058  * documentation and/or other materials provided with distribution.  In
00059  * addition, Licensee may not authorize further sublicense of source of any
00060  * portion of the Covered Code, and must include terms to the effect that the
00061  * license from Licensee to its licensee is limited to the intellectual
00062  * property embodied in the software Licensee provides to its licensee, and
00063  * not to intellectual property embodied in modifications its licensee may
00064  * make.
00065  *
00066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00067  * substantial portion of the Covered Code or modification must reproduce the
00068  * above Copyright Notice, and the following Disclaimer and Export Compliance
00069  * provision in the documentation and/or other materials provided with the
00070  * distribution.
00071  *
00072  * 3.4. Intel retains all right, title, and interest in and to the Original
00073  * Intel Code.
00074  *
00075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00076  * Intel shall be used in advertising or otherwise to promote the sale, use or
00077  * other dealings in products derived from or relating to the Covered Code
00078  * without prior written authorization from Intel.
00079  *
00080  * 4. Disclaimer and Export Compliance
00081  *
00082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00088  * PARTICULAR PURPOSE.
00089  *
00090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00097  * LIMITED REMEDY.
00098  *
00099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00100  * software or system incorporating such software without first obtaining any
00101  * required license or other approval from the U. S. Department of Commerce or
00102  * any other agency or department of the United States Government.  In the
00103  * event Licensee exports any such software from the United States or
00104  * re-exports any such software from a foreign destination, Licensee shall
00105  * ensure that the distribution and export/re-export of the software is in
00106  * compliance with all laws, regulations, orders, or other restrictions of the
00107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00108  * any of its subsidiaries will export/re-export any technical data, process,
00109  * software, or service, directly or indirectly, to any country for which the
00110  * United States government or any agency thereof requires an export license,
00111  * other governmental approval, or letter of assurance, without first obtaining
00112  * such license, approval or letter.
00113  *
00114  *****************************************************************************/
00115 
00116 #define __UTDECODE_C__
00117 
00118 #include "acpi.h"
00119 #include "accommon.h"
00120 #include "acnamesp.h"
00121 
00122 #define _COMPONENT          ACPI_UTILITIES
00123         ACPI_MODULE_NAME    ("utdecode")
00124 
00125 
00126 /*******************************************************************************
00127  *
00128  * FUNCTION:    AcpiFormatException
00129  *
00130  * PARAMETERS:  Status       - The ACPI_STATUS code to be formatted
00131  *
00132  * RETURN:      A string containing the exception text. A valid pointer is
00133  *              always returned.
00134  *
00135  * DESCRIPTION: This function translates an ACPI exception into an ASCII string
00136  *              It is here instead of utxface.c so it is always present.
00137  *
00138  ******************************************************************************/
00139 
00140 const char *
00141 AcpiFormatException (
00142     ACPI_STATUS             Status)
00143 {
00144     const char              *Exception = NULL;
00145 
00146 
00147     ACPI_FUNCTION_ENTRY ();
00148 
00149 
00150     Exception = AcpiUtValidateException (Status);
00151     if (!Exception)
00152     {
00153         /* Exception code was not recognized */
00154 
00155         ACPI_ERROR ((AE_INFO,
00156             "Unknown exception code: 0x%8.8X", Status));
00157 
00158         Exception = "UNKNOWN_STATUS_CODE";
00159     }
00160 
00161     return (ACPI_CAST_PTR (const char, Exception));
00162 }
00163 
00164 ACPI_EXPORT_SYMBOL (AcpiFormatException)
00165 
00166 
00167 /*
00168  * Properties of the ACPI Object Types, both internal and external.
00169  * The table is indexed by values of ACPI_OBJECT_TYPE
00170  */
00171 const UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
00172 {
00173     ACPI_NS_NORMAL,                     /* 00 Any              */
00174     ACPI_NS_NORMAL,                     /* 01 Number           */
00175     ACPI_NS_NORMAL,                     /* 02 String           */
00176     ACPI_NS_NORMAL,                     /* 03 Buffer           */
00177     ACPI_NS_NORMAL,                     /* 04 Package          */
00178     ACPI_NS_NORMAL,                     /* 05 FieldUnit        */
00179     ACPI_NS_NEWSCOPE,                   /* 06 Device           */
00180     ACPI_NS_NORMAL,                     /* 07 Event            */
00181     ACPI_NS_NEWSCOPE,                   /* 08 Method           */
00182     ACPI_NS_NORMAL,                     /* 09 Mutex            */
00183     ACPI_NS_NORMAL,                     /* 10 Region           */
00184     ACPI_NS_NEWSCOPE,                   /* 11 Power            */
00185     ACPI_NS_NEWSCOPE,                   /* 12 Processor        */
00186     ACPI_NS_NEWSCOPE,                   /* 13 Thermal          */
00187     ACPI_NS_NORMAL,                     /* 14 BufferField      */
00188     ACPI_NS_NORMAL,                     /* 15 DdbHandle        */
00189     ACPI_NS_NORMAL,                     /* 16 Debug Object     */
00190     ACPI_NS_NORMAL,                     /* 17 DefField         */
00191     ACPI_NS_NORMAL,                     /* 18 BankField        */
00192     ACPI_NS_NORMAL,                     /* 19 IndexField       */
00193     ACPI_NS_NORMAL,                     /* 20 Reference        */
00194     ACPI_NS_NORMAL,                     /* 21 Alias            */
00195     ACPI_NS_NORMAL,                     /* 22 MethodAlias      */
00196     ACPI_NS_NORMAL,                     /* 23 Notify           */
00197     ACPI_NS_NORMAL,                     /* 24 Address Handler  */
00198     ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 25 Resource Desc    */
00199     ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 26 Resource Field   */
00200     ACPI_NS_NEWSCOPE,                   /* 27 Scope            */
00201     ACPI_NS_NORMAL,                     /* 28 Extra            */
00202     ACPI_NS_NORMAL,                     /* 29 Data             */
00203     ACPI_NS_NORMAL                      /* 30 Invalid          */
00204 };
00205 
00206 
00207 /*******************************************************************************
00208  *
00209  * FUNCTION:    AcpiUtHexToAsciiChar
00210  *
00211  * PARAMETERS:  Integer             - Contains the hex digit
00212  *              Position            - bit position of the digit within the
00213  *                                    integer (multiple of 4)
00214  *
00215  * RETURN:      The converted Ascii character
00216  *
00217  * DESCRIPTION: Convert a hex digit to an Ascii character
00218  *
00219  ******************************************************************************/
00220 
00221 /* Hex to ASCII conversion table */
00222 
00223 static const char           AcpiGbl_HexToAscii[] =
00224 {
00225     '0','1','2','3','4','5','6','7',
00226     '8','9','A','B','C','D','E','F'
00227 };
00228 
00229 char
00230 AcpiUtHexToAsciiChar (
00231     UINT64                  Integer,
00232     UINT32                  Position)
00233 {
00234 
00235     return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
00236 }
00237 
00238 
00239 /*******************************************************************************
00240  *
00241  * FUNCTION:    AcpiUtGetRegionName
00242  *
00243  * PARAMETERS:  Space ID            - ID for the region
00244  *
00245  * RETURN:      Decoded region SpaceId name
00246  *
00247  * DESCRIPTION: Translate a Space ID into a name string (Debug only)
00248  *
00249  ******************************************************************************/
00250 
00251 /* Region type decoding */
00252 
00253 const char        *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
00254 {
00255     "SystemMemory",
00256     "SystemIO",
00257     "PCI_Config",
00258     "EmbeddedControl",
00259     "SMBus",
00260     "SystemCMOS",
00261     "PCIBARTarget",
00262     "IPMI"
00263 };
00264 
00265 
00266 char *
00267 AcpiUtGetRegionName (
00268     UINT8                   SpaceId)
00269 {
00270 
00271     if (SpaceId >= ACPI_USER_REGION_BEGIN)
00272     {
00273         return ("UserDefinedRegion");
00274     }
00275     else if (SpaceId == ACPI_ADR_SPACE_DATA_TABLE)
00276     {
00277         return ("DataTable");
00278     }
00279     else if (SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)
00280     {
00281         return ("FunctionalFixedHW");
00282     }
00283     else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
00284     {
00285         return ("InvalidSpaceId");
00286     }
00287 
00288     return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
00289 }
00290 
00291 
00292 /*******************************************************************************
00293  *
00294  * FUNCTION:    AcpiUtGetEventName
00295  *
00296  * PARAMETERS:  EventId             - Fixed event ID
00297  *
00298  * RETURN:      Decoded event ID name
00299  *
00300  * DESCRIPTION: Translate a Event ID into a name string (Debug only)
00301  *
00302  ******************************************************************************/
00303 
00304 /* Event type decoding */
00305 
00306 static const char        *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
00307 {
00308     "PM_Timer",
00309     "GlobalLock",
00310     "PowerButton",
00311     "SleepButton",
00312     "RealTimeClock",
00313 };
00314 
00315 
00316 char *
00317 AcpiUtGetEventName (
00318     UINT32                  EventId)
00319 {
00320 
00321     if (EventId > ACPI_EVENT_MAX)
00322     {
00323         return ("InvalidEventID");
00324     }
00325 
00326     return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
00327 }
00328 
00329 
00330 /*******************************************************************************
00331  *
00332  * FUNCTION:    AcpiUtGetTypeName
00333  *
00334  * PARAMETERS:  Type                - An ACPI object type
00335  *
00336  * RETURN:      Decoded ACPI object type name
00337  *
00338  * DESCRIPTION: Translate a Type ID into a name string (Debug only)
00339  *
00340  ******************************************************************************/
00341 
00342 /*
00343  * Elements of AcpiGbl_NsTypeNames below must match
00344  * one-to-one with values of ACPI_OBJECT_TYPE
00345  *
00346  * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
00347  * when stored in a table it really means that we have thus far seen no
00348  * evidence to indicate what type is actually going to be stored for this entry.
00349  */
00350 static const char           AcpiGbl_BadType[] = "UNDEFINED";
00351 
00352 /* Printable names of the ACPI object types */
00353 
00354 static const char           *AcpiGbl_NsTypeNames[] =
00355 {
00356     /* 00 */ "Untyped",
00357     /* 01 */ "Integer",
00358     /* 02 */ "String",
00359     /* 03 */ "Buffer",
00360     /* 04 */ "Package",
00361     /* 05 */ "FieldUnit",
00362     /* 06 */ "Device",
00363     /* 07 */ "Event",
00364     /* 08 */ "Method",
00365     /* 09 */ "Mutex",
00366     /* 10 */ "Region",
00367     /* 11 */ "Power",
00368     /* 12 */ "Processor",
00369     /* 13 */ "Thermal",
00370     /* 14 */ "BufferField",
00371     /* 15 */ "DdbHandle",
00372     /* 16 */ "DebugObject",
00373     /* 17 */ "RegionField",
00374     /* 18 */ "BankField",
00375     /* 19 */ "IndexField",
00376     /* 20 */ "Reference",
00377     /* 21 */ "Alias",
00378     /* 22 */ "MethodAlias",
00379     /* 23 */ "Notify",
00380     /* 24 */ "AddrHandler",
00381     /* 25 */ "ResourceDesc",
00382     /* 26 */ "ResourceFld",
00383     /* 27 */ "Scope",
00384     /* 28 */ "Extra",
00385     /* 29 */ "Data",
00386     /* 30 */ "Invalid"
00387 };
00388 
00389 
00390 char *
00391 AcpiUtGetTypeName (
00392     ACPI_OBJECT_TYPE        Type)
00393 {
00394 
00395     if (Type > ACPI_TYPE_INVALID)
00396     {
00397         return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
00398     }
00399 
00400     return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
00401 }
00402 
00403 
00404 char *
00405 AcpiUtGetObjectTypeName (
00406     ACPI_OPERAND_OBJECT     *ObjDesc)
00407 {
00408 
00409     if (!ObjDesc)
00410     {
00411         return ("[NULL Object Descriptor]");
00412     }
00413 
00414     return (AcpiUtGetTypeName (ObjDesc->Common.Type));
00415 }
00416 
00417 
00418 /*******************************************************************************
00419  *
00420  * FUNCTION:    AcpiUtGetNodeName
00421  *
00422  * PARAMETERS:  Object               - A namespace node
00423  *
00424  * RETURN:      ASCII name of the node
00425  *
00426  * DESCRIPTION: Validate the node and return the node's ACPI name.
00427  *
00428  ******************************************************************************/
00429 
00430 char *
00431 AcpiUtGetNodeName (
00432     void                    *Object)
00433 {
00434     ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) Object;
00435 
00436 
00437     /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
00438 
00439     if (!Object)
00440     {
00441         return ("NULL");
00442     }
00443 
00444     /* Check for Root node */
00445 
00446     if ((Object == ACPI_ROOT_OBJECT) ||
00447         (Object == AcpiGbl_RootNode))
00448     {
00449         return ("\"\\\" ");
00450     }
00451 
00452     /* Descriptor must be a namespace node */
00453 
00454     if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
00455     {
00456         return ("####");
00457     }
00458 
00459     /*
00460      * Ensure name is valid. The name was validated/repaired when the node
00461      * was created, but make sure it has not been corrupted.
00462      */
00463     AcpiUtRepairName (Node->Name.Ascii);
00464 
00465     /* Return the name */
00466 
00467     return (Node->Name.Ascii);
00468 }
00469 
00470 
00471 /*******************************************************************************
00472  *
00473  * FUNCTION:    AcpiUtGetDescriptorName
00474  *
00475  * PARAMETERS:  Object               - An ACPI object
00476  *
00477  * RETURN:      Decoded name of the descriptor type
00478  *
00479  * DESCRIPTION: Validate object and return the descriptor type
00480  *
00481  ******************************************************************************/
00482 
00483 /* Printable names of object descriptor types */
00484 
00485 static const char           *AcpiGbl_DescTypeNames[] =
00486 {
00487     /* 00 */ "Not a Descriptor",
00488     /* 01 */ "Cached",
00489     /* 02 */ "State-Generic",
00490     /* 03 */ "State-Update",
00491     /* 04 */ "State-Package",
00492     /* 05 */ "State-Control",
00493     /* 06 */ "State-RootParseScope",
00494     /* 07 */ "State-ParseScope",
00495     /* 08 */ "State-WalkScope",
00496     /* 09 */ "State-Result",
00497     /* 10 */ "State-Notify",
00498     /* 11 */ "State-Thread",
00499     /* 12 */ "Walk",
00500     /* 13 */ "Parser",
00501     /* 14 */ "Operand",
00502     /* 15 */ "Node"
00503 };
00504 
00505 
00506 char *
00507 AcpiUtGetDescriptorName (
00508     void                    *Object)
00509 {
00510 
00511     if (!Object)
00512     {
00513         return ("NULL OBJECT");
00514     }
00515 
00516     if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
00517     {
00518         return ("Not a Descriptor");
00519     }
00520 
00521     return (ACPI_CAST_PTR (char,
00522         AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
00523 
00524 }
00525 
00526 
00527 /*******************************************************************************
00528  *
00529  * FUNCTION:    AcpiUtGetReferenceName
00530  *
00531  * PARAMETERS:  Object               - An ACPI reference object
00532  *
00533  * RETURN:      Decoded name of the type of reference
00534  *
00535  * DESCRIPTION: Decode a reference object sub-type to a string.
00536  *
00537  ******************************************************************************/
00538 
00539 /* Printable names of reference object sub-types */
00540 
00541 static const char           *AcpiGbl_RefClassNames[] =
00542 {
00543     /* 00 */ "Local",
00544     /* 01 */ "Argument",
00545     /* 02 */ "RefOf",
00546     /* 03 */ "Index",
00547     /* 04 */ "DdbHandle",
00548     /* 05 */ "Named Object",
00549     /* 06 */ "Debug"
00550 };
00551 
00552 const char *
00553 AcpiUtGetReferenceName (
00554     ACPI_OPERAND_OBJECT     *Object)
00555 {
00556 
00557     if (!Object)
00558     {
00559         return ("NULL Object");
00560     }
00561 
00562     if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
00563     {
00564         return ("Not an Operand object");
00565     }
00566 
00567     if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
00568     {
00569         return ("Not a Reference object");
00570     }
00571 
00572     if (Object->Reference.Class > ACPI_REFCLASS_MAX)
00573     {
00574         return ("Unknown Reference class");
00575     }
00576 
00577     return (AcpiGbl_RefClassNames[Object->Reference.Class]);
00578 }
00579 
00580 
00581 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
00582 /*
00583  * Strings and procedures used for debug only
00584  */
00585 
00586 /*******************************************************************************
00587  *
00588  * FUNCTION:    AcpiUtGetMutexName
00589  *
00590  * PARAMETERS:  MutexId         - The predefined ID for this mutex.
00591  *
00592  * RETURN:      Decoded name of the internal mutex
00593  *
00594  * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
00595  *
00596  ******************************************************************************/
00597 
00598 /* Names for internal mutex objects, used for debug output */
00599 
00600 static char                 *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
00601 {
00602     "ACPI_MTX_Interpreter",
00603     "ACPI_MTX_Namespace",
00604     "ACPI_MTX_Tables",
00605     "ACPI_MTX_Events",
00606     "ACPI_MTX_Caches",
00607     "ACPI_MTX_Memory",
00608     "ACPI_MTX_CommandComplete",
00609     "ACPI_MTX_CommandReady"
00610 };
00611 
00612 char *
00613 AcpiUtGetMutexName (
00614     UINT32                  MutexId)
00615 {
00616 
00617     if (MutexId > ACPI_MAX_MUTEX)
00618     {
00619         return ("Invalid Mutex ID");
00620     }
00621 
00622     return (AcpiGbl_MutexNames[MutexId]);
00623 }
00624 
00625 
00626 /*******************************************************************************
00627  *
00628  * FUNCTION:    AcpiUtGetNotifyName
00629  *
00630  * PARAMETERS:  NotifyValue     - Value from the Notify() request
00631  *
00632  * RETURN:      Decoded name for the notify value
00633  *
00634  * DESCRIPTION: Translate a Notify Value to a notify namestring.
00635  *
00636  ******************************************************************************/
00637 
00638 /* Names for Notify() values, used for debug output */
00639 
00640 static const char           *AcpiGbl_NotifyValueNames[] =
00641 {
00642     "Bus Check",
00643     "Device Check",
00644     "Device Wake",
00645     "Eject Request",
00646     "Device Check Light",
00647     "Frequency Mismatch",
00648     "Bus Mode Mismatch",
00649     "Power Fault",
00650     "Capabilities Check",
00651     "Device PLD Check",
00652     "Reserved",
00653     "System Locality Update"
00654 };
00655 
00656 const char *
00657 AcpiUtGetNotifyName (
00658     UINT32                  NotifyValue)
00659 {
00660 
00661     if (NotifyValue <= ACPI_NOTIFY_MAX)
00662     {
00663         return (AcpiGbl_NotifyValueNames[NotifyValue]);
00664     }
00665     else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
00666     {
00667         return ("Reserved");
00668     }
00669     else /* Greater or equal to 0x80 */
00670     {
00671         return ("**Device Specific**");
00672     }
00673 }
00674 #endif
00675 
00676 
00677 /*******************************************************************************
00678  *
00679  * FUNCTION:    AcpiUtValidObjectType
00680  *
00681  * PARAMETERS:  Type            - Object type to be validated
00682  *
00683  * RETURN:      TRUE if valid object type, FALSE otherwise
00684  *
00685  * DESCRIPTION: Validate an object type
00686  *
00687  ******************************************************************************/
00688 
00689 BOOLEAN
00690 AcpiUtValidObjectType (
00691     ACPI_OBJECT_TYPE        Type)
00692 {
00693 
00694     if (Type > ACPI_TYPE_LOCAL_MAX)
00695     {
00696         /* Note: Assumes all TYPEs are contiguous (external/local) */
00697 
00698         return (FALSE);
00699     }
00700 
00701     return (TRUE);
00702 }

Generated on Sun May 27 2012 04:27:23 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.