acutils.h revision 73561
167754Smsmith/****************************************************************************** 267754Smsmith * 367754Smsmith * Name: accommon.h -- prototypes for the common (subsystem-wide) procedures 473561Smsmith * $Revision: 90 $ 567754Smsmith * 667754Smsmith *****************************************************************************/ 767754Smsmith 867754Smsmith/****************************************************************************** 967754Smsmith * 1067754Smsmith * 1. Copyright Notice 1167754Smsmith * 1271867Smsmith * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. 1370243Smsmith * All rights reserved. 1467754Smsmith * 1567754Smsmith * 2. License 1667754Smsmith * 1767754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property 1867754Smsmith * rights. You may have additional license terms from the party that provided 1967754Smsmith * you this software, covering your right to use that party's intellectual 2067754Smsmith * property rights. 2167754Smsmith * 2267754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2367754Smsmith * copy of the source code appearing in this file ("Covered Code") an 2467754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2567754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy, 2667754Smsmith * make derivatives, distribute, use and display any portion of the Covered 2767754Smsmith * Code in any form, with the right to sublicense such rights; and 2867754Smsmith * 2967754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 3067754Smsmith * license (with the right to sublicense), under only those claims of Intel 3167754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell, 3267754Smsmith * offer to sell, and import the Covered Code and derivative works thereof 3367754Smsmith * solely to the minimum extent necessary to exercise the above copyright 3467754Smsmith * license, and in no event shall the patent license extend to any additions 3567754Smsmith * to or modifications of the Original Intel Code. No other license or right 3667754Smsmith * is granted directly or by implication, estoppel or otherwise; 3767754Smsmith * 3867754Smsmith * The above copyright and patent license is granted only if the following 3967754Smsmith * conditions are met: 4067754Smsmith * 4167754Smsmith * 3. Conditions 4267754Smsmith * 4367754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4467754Smsmith * Redistribution of source code of any substantial portion of the Covered 4567754Smsmith * Code or modification with rights to further distribute source must include 4667754Smsmith * the above Copyright Notice, the above License, this list of Conditions, 4767754Smsmith * and the following Disclaimer and Export Compliance provision. In addition, 4867754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to 4967754Smsmith * contain a file documenting the changes Licensee made to create that Covered 5067754Smsmith * Code and the date of any change. Licensee must include in that file the 5167754Smsmith * documentation of any changes made by any predecessor Licensee. Licensee 5267754Smsmith * must include a prominent statement that the modification is derived, 5367754Smsmith * directly or indirectly, from Original Intel Code. 5467754Smsmith * 5567754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5667754Smsmith * Redistribution of source code of any substantial portion of the Covered 5767754Smsmith * Code or modification without rights to further distribute source must 5867754Smsmith * include the following Disclaimer and Export Compliance provision in the 5967754Smsmith * documentation and/or other materials provided with distribution. In 6067754Smsmith * addition, Licensee may not authorize further sublicense of source of any 6167754Smsmith * portion of the Covered Code, and must include terms to the effect that the 6267754Smsmith * license from Licensee to its licensee is limited to the intellectual 6367754Smsmith * property embodied in the software Licensee provides to its licensee, and 6467754Smsmith * not to intellectual property embodied in modifications its licensee may 6567754Smsmith * make. 6667754Smsmith * 6767754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any 6867754Smsmith * substantial portion of the Covered Code or modification must reproduce the 6967754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance 7067754Smsmith * provision in the documentation and/or other materials provided with the 7167754Smsmith * distribution. 7267754Smsmith * 7367754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original 7467754Smsmith * Intel Code. 7567754Smsmith * 7667754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7767754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or 7867754Smsmith * other dealings in products derived from or relating to the Covered Code 7967754Smsmith * without prior written authorization from Intel. 8067754Smsmith * 8167754Smsmith * 4. Disclaimer and Export Compliance 8267754Smsmith * 8367754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8467754Smsmith * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8567754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8667754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8767754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8867754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8967754Smsmith * PARTICULAR PURPOSE. 9067754Smsmith * 9167754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9267754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9367754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9467754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9567754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9667754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9767754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9867754Smsmith * LIMITED REMEDY. 9967754Smsmith * 10067754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this 10167754Smsmith * software or system incorporating such software without first obtaining any 10267754Smsmith * required license or other approval from the U. S. Department of Commerce or 10367754Smsmith * any other agency or department of the United States Government. In the 10467754Smsmith * event Licensee exports any such software from the United States or 10567754Smsmith * re-exports any such software from a foreign destination, Licensee shall 10667754Smsmith * ensure that the distribution and export/re-export of the software is in 10767754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the 10867754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10967754Smsmith * any of its subsidiaries will export/re-export any technical data, process, 11067754Smsmith * software, or service, directly or indirectly, to any country for which the 11167754Smsmith * United States government or any agency thereof requires an export license, 11267754Smsmith * other governmental approval, or letter of assurance, without first obtaining 11367754Smsmith * such license, approval or letter. 11467754Smsmith * 11567754Smsmith *****************************************************************************/ 11667754Smsmith 11767754Smsmith#ifndef _ACCOMMON_H 11867754Smsmith#define _ACCOMMON_H 11967754Smsmith 12067754Smsmith 12173561Smsmith 12273561Smsmithtypedef 12373561SmsmithACPI_STATUS (*ACPI_PKG_CALLBACK) ( 12473561Smsmith UINT8 ObjectType, 12573561Smsmith ACPI_OPERAND_OBJECT *SourceObject, 12673561Smsmith ACPI_GENERIC_STATE *State, 12773561Smsmith void *Context); 12873561Smsmith 12973561Smsmith 13073561Smsmith 13173561SmsmithACPI_STATUS 13273561SmsmithAcpiCmWalkPackageTree ( 13373561Smsmith ACPI_OPERAND_OBJECT *SourceObject, 13473561Smsmith void *TargetObject, 13573561Smsmith ACPI_PKG_CALLBACK WalkCallback, 13673561Smsmith void *Context); 13773561Smsmith 13873561Smsmith 13973561Smsmithtypedef struct acpi_pkg_info 14073561Smsmith{ 14173561Smsmith UINT8 *FreeSpace; 14273561Smsmith UINT32 Length; 14373561Smsmith UINT32 ObjectSpace; 14473561Smsmith UINT32 NumPackages; 14573561Smsmith} ACPI_PKG_INFO; 14673561Smsmith 14767754Smsmith#define REF_INCREMENT (UINT16) 0 14867754Smsmith#define REF_DECREMENT (UINT16) 1 14967754Smsmith#define REF_FORCE_DELETE (UINT16) 2 15067754Smsmith 15167754Smsmith/* AcpiCmDumpBuffer */ 15267754Smsmith 15367754Smsmith#define DB_BYTE_DISPLAY 1 15467754Smsmith#define DB_WORD_DISPLAY 2 15567754Smsmith#define DB_DWORD_DISPLAY 4 15667754Smsmith#define DB_QWORD_DISPLAY 8 15767754Smsmith 15867754Smsmith 15967754Smsmith/* Global initialization interfaces */ 16067754Smsmith 16167754Smsmithvoid 16267754SmsmithAcpiCmInitGlobals ( 16367754Smsmith void); 16467754Smsmith 16567754Smsmithvoid 16667754SmsmithAcpiCmTerminate ( 16767754Smsmith void); 16867754Smsmith 16967754Smsmith 17067754Smsmith/* 17167754Smsmith * CmInit - miscellaneous initialization and shutdown 17267754Smsmith */ 17367754Smsmith 17467754SmsmithACPI_STATUS 17567754SmsmithAcpiCmHardwareInitialize ( 17667754Smsmith void); 17767754Smsmith 17867754SmsmithACPI_STATUS 17967754SmsmithAcpiCmSubsystemShutdown ( 18067754Smsmith void); 18167754Smsmith 18267754SmsmithACPI_STATUS 18369450SmsmithAcpiCmValidateFadt ( 18467754Smsmith void); 18567754Smsmith 18667754Smsmith/* 18767754Smsmith * CmGlobal - Global data structures and procedures 18867754Smsmith */ 18967754Smsmith 19069746Smsmith#ifdef ACPI_DEBUG 19169746Smsmith 19267754SmsmithNATIVE_CHAR * 19367754SmsmithAcpiCmGetMutexName ( 19467754Smsmith UINT32 MutexId); 19567754Smsmith 19667754SmsmithNATIVE_CHAR * 19767754SmsmithAcpiCmGetTypeName ( 19867754Smsmith UINT32 Type); 19967754Smsmith 20069746SmsmithNATIVE_CHAR * 20169746SmsmithAcpiCmGetRegionName ( 20269746Smsmith UINT8 SpaceId); 20369746Smsmith 20469746Smsmith#endif 20569746Smsmith 20669746Smsmith 20767754SmsmithBOOLEAN 20867754SmsmithAcpiCmValidObjectType ( 20967754Smsmith UINT32 Type); 21067754Smsmith 21167754SmsmithACPI_OWNER_ID 21267754SmsmithAcpiCmAllocateOwnerId ( 21367754Smsmith UINT32 IdType); 21467754Smsmith 21567754Smsmith 21667754Smsmith/* 21767754Smsmith * CmClib - Local implementations of C library functions 21867754Smsmith */ 21967754Smsmith 22071867Smsmith#ifndef ACPI_USE_SYSTEM_CLIBRARY 22171867Smsmith 22267754SmsmithNATIVE_UINT 22367754SmsmithAcpiCmStrlen ( 22467754Smsmith const NATIVE_CHAR *String); 22567754Smsmith 22667754SmsmithNATIVE_CHAR * 22767754SmsmithAcpiCmStrcpy ( 22867754Smsmith NATIVE_CHAR *DstString, 22967754Smsmith const NATIVE_CHAR *SrcString); 23067754Smsmith 23167754SmsmithNATIVE_CHAR * 23267754SmsmithAcpiCmStrncpy ( 23367754Smsmith NATIVE_CHAR *DstString, 23467754Smsmith const NATIVE_CHAR *SrcString, 23567754Smsmith NATIVE_UINT Count); 23667754Smsmith 23767754SmsmithUINT32 23867754SmsmithAcpiCmStrncmp ( 23967754Smsmith const NATIVE_CHAR *String1, 24067754Smsmith const NATIVE_CHAR *String2, 24167754Smsmith NATIVE_UINT Count); 24267754Smsmith 24367754SmsmithUINT32 24467754SmsmithAcpiCmStrcmp ( 24567754Smsmith const NATIVE_CHAR *String1, 24667754Smsmith const NATIVE_CHAR *String2); 24767754Smsmith 24867754SmsmithNATIVE_CHAR * 24967754SmsmithAcpiCmStrcat ( 25067754Smsmith NATIVE_CHAR *DstString, 25167754Smsmith const NATIVE_CHAR *SrcString); 25267754Smsmith 25367754SmsmithNATIVE_CHAR * 25467754SmsmithAcpiCmStrncat ( 25567754Smsmith NATIVE_CHAR *DstString, 25667754Smsmith const NATIVE_CHAR *SrcString, 25767754Smsmith NATIVE_UINT Count); 25867754Smsmith 25967754SmsmithUINT32 26067754SmsmithAcpiCmStrtoul ( 26167754Smsmith const NATIVE_CHAR *String, 26267754Smsmith NATIVE_CHAR **Terminator, 26371867Smsmith NATIVE_UINT Base); 26467754Smsmith 26567754SmsmithNATIVE_CHAR * 26667754SmsmithAcpiCmStrstr ( 26767754Smsmith NATIVE_CHAR *String1, 26867754Smsmith NATIVE_CHAR *String2); 26967754Smsmith 27067754SmsmithNATIVE_CHAR * 27167754SmsmithAcpiCmStrupr ( 27267754Smsmith NATIVE_CHAR *SrcString); 27367754Smsmith 27467754Smsmithvoid * 27567754SmsmithAcpiCmMemcpy ( 27667754Smsmith void *Dest, 27767754Smsmith const void *Src, 27867754Smsmith NATIVE_UINT Count); 27967754Smsmith 28067754Smsmithvoid * 28167754SmsmithAcpiCmMemset ( 28267754Smsmith void *Dest, 28371867Smsmith NATIVE_UINT Value, 28467754Smsmith NATIVE_UINT Count); 28567754Smsmith 28667754SmsmithUINT32 28767754SmsmithAcpiCmToUpper ( 28867754Smsmith UINT32 c); 28967754Smsmith 29067754SmsmithUINT32 29167754SmsmithAcpiCmToLower ( 29267754Smsmith UINT32 c); 29367754Smsmith 29471867Smsmith#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 29567754Smsmith 29667754Smsmith/* 29767754Smsmith * CmCopy - Object construction and conversion interfaces 29867754Smsmith */ 29967754Smsmith 30067754SmsmithACPI_STATUS 30167754SmsmithAcpiCmBuildSimpleObject( 30267754Smsmith ACPI_OPERAND_OBJECT *Obj, 30367754Smsmith ACPI_OBJECT *UserObj, 30467754Smsmith UINT8 *DataSpace, 30567754Smsmith UINT32 *BufferSpaceUsed); 30667754Smsmith 30767754SmsmithACPI_STATUS 30867754SmsmithAcpiCmBuildPackageObject ( 30967754Smsmith ACPI_OPERAND_OBJECT *Obj, 31067754Smsmith UINT8 *Buffer, 31167754Smsmith UINT32 *SpaceUsed); 31267754Smsmith 31367754SmsmithACPI_STATUS 31473561SmsmithAcpiCmCopyIobjectToEobject ( 31567754Smsmith ACPI_OPERAND_OBJECT *Obj, 31667754Smsmith ACPI_BUFFER *RetBuffer); 31767754Smsmith 31867754SmsmithACPI_STATUS 31973561SmsmithAcpiCmCopyEsimpleToIsimple( 32067754Smsmith ACPI_OBJECT *UserObj, 32167754Smsmith ACPI_OPERAND_OBJECT *Obj); 32267754Smsmith 32367754SmsmithACPI_STATUS 32473561SmsmithAcpiCmCopyEobjectToIobject ( 32567754Smsmith ACPI_OBJECT *Obj, 32667754Smsmith ACPI_OPERAND_OBJECT *InternalObj); 32767754Smsmith 32867754SmsmithACPI_STATUS 32973561SmsmithAcpiCmCopyISimpleToIsimple ( 33067754Smsmith ACPI_OPERAND_OBJECT *SourceObj, 33167754Smsmith ACPI_OPERAND_OBJECT *DestObj); 33267754Smsmith 33367754SmsmithACPI_STATUS 33473561SmsmithAcpiCmCopyIpackageToIpackage ( 33567754Smsmith ACPI_OPERAND_OBJECT *SourceObj, 33673561Smsmith ACPI_OPERAND_OBJECT *DestObj, 33773561Smsmith ACPI_WALK_STATE *WalkState); 33867754Smsmith 33967754Smsmith 34067754Smsmith/* 34167754Smsmith * CmCreate - Object creation 34267754Smsmith */ 34367754Smsmith 34467754SmsmithACPI_STATUS 34567754SmsmithAcpiCmUpdateObjectReference ( 34667754Smsmith ACPI_OPERAND_OBJECT *Object, 34767754Smsmith UINT16 Action); 34867754Smsmith 34967754SmsmithACPI_OPERAND_OBJECT * 35067754Smsmith_CmCreateInternalObject ( 35167754Smsmith NATIVE_CHAR *ModuleName, 35267754Smsmith UINT32 LineNumber, 35367754Smsmith UINT32 ComponentId, 35467754Smsmith OBJECT_TYPE_INTERNAL Type); 35567754Smsmith 35667754Smsmith 35767754Smsmith/* 35867754Smsmith * CmDebug - Debug interfaces 35967754Smsmith */ 36067754Smsmith 36167754SmsmithUINT32 36267754SmsmithGetDebugLevel ( 36367754Smsmith void); 36467754Smsmith 36567754Smsmithvoid 36667754SmsmithSetDebugLevel ( 36767754Smsmith UINT32 level); 36867754Smsmith 36967754Smsmithvoid 37067754SmsmithFunctionTrace ( 37167754Smsmith NATIVE_CHAR *ModuleName, 37267754Smsmith UINT32 LineNumber, 37367754Smsmith UINT32 ComponentId, 37467754Smsmith NATIVE_CHAR *FunctionName); 37567754Smsmith 37667754Smsmithvoid 37767754SmsmithFunctionTracePtr ( 37867754Smsmith NATIVE_CHAR *ModuleName, 37967754Smsmith UINT32 LineNumber, 38067754Smsmith UINT32 ComponentId, 38167754Smsmith NATIVE_CHAR *FunctionName, 38267754Smsmith void *Pointer); 38367754Smsmith 38467754Smsmithvoid 38567754SmsmithFunctionTraceU32 ( 38667754Smsmith NATIVE_CHAR *ModuleName, 38767754Smsmith UINT32 LineNumber, 38867754Smsmith UINT32 ComponentId, 38967754Smsmith NATIVE_CHAR *FunctionName, 39067754Smsmith UINT32 Integer); 39167754Smsmith 39267754Smsmithvoid 39367754SmsmithFunctionTraceStr ( 39467754Smsmith NATIVE_CHAR *ModuleName, 39567754Smsmith UINT32 LineNumber, 39667754Smsmith UINT32 ComponentId, 39767754Smsmith NATIVE_CHAR *FunctionName, 39867754Smsmith NATIVE_CHAR *String); 39967754Smsmith 40067754Smsmithvoid 40167754SmsmithFunctionExit ( 40267754Smsmith NATIVE_CHAR *ModuleName, 40367754Smsmith UINT32 LineNumber, 40467754Smsmith UINT32 ComponentId, 40567754Smsmith NATIVE_CHAR *FunctionName); 40667754Smsmith 40767754Smsmithvoid 40867754SmsmithFunctionStatusExit ( 40967754Smsmith NATIVE_CHAR *ModuleName, 41067754Smsmith UINT32 LineNumber, 41167754Smsmith UINT32 ComponentId, 41267754Smsmith NATIVE_CHAR *FunctionName, 41367754Smsmith ACPI_STATUS Status); 41467754Smsmith 41567754Smsmithvoid 41667754SmsmithFunctionValueExit ( 41767754Smsmith NATIVE_CHAR *ModuleName, 41867754Smsmith UINT32 LineNumber, 41967754Smsmith UINT32 ComponentId, 42067754Smsmith NATIVE_CHAR *FunctionName, 42171867Smsmith ACPI_INTEGER Value); 42267754Smsmith 42367754Smsmithvoid 42467754SmsmithFunctionPtrExit ( 42567754Smsmith NATIVE_CHAR *ModuleName, 42667754Smsmith UINT32 LineNumber, 42767754Smsmith UINT32 ComponentId, 42867754Smsmith NATIVE_CHAR *FunctionName, 42967754Smsmith UINT8 *Ptr); 43067754Smsmith 43167754Smsmithvoid 43267754SmsmithDebugPrintPrefix ( 43367754Smsmith NATIVE_CHAR *ModuleName, 43467754Smsmith UINT32 LineNumber); 43567754Smsmith 43667754Smsmithvoid 43767754SmsmithDebugPrint ( 43867754Smsmith NATIVE_CHAR *ModuleName, 43967754Smsmith UINT32 LineNumber, 44067754Smsmith UINT32 ComponentId, 44167754Smsmith UINT32 PrintLevel, 44267754Smsmith NATIVE_CHAR *Format, ...); 44367754Smsmith 44467754Smsmithvoid 44567754SmsmithDebugPrintRaw ( 44667754Smsmith NATIVE_CHAR *Format, ...); 44767754Smsmith 44867754Smsmithvoid 44967754Smsmith_ReportInfo ( 45067754Smsmith NATIVE_CHAR *ModuleName, 45167754Smsmith UINT32 LineNumber, 45267754Smsmith UINT32 ComponentId); 45367754Smsmith 45467754Smsmithvoid 45567754Smsmith_ReportError ( 45667754Smsmith NATIVE_CHAR *ModuleName, 45767754Smsmith UINT32 LineNumber, 45867754Smsmith UINT32 ComponentId); 45967754Smsmith 46067754Smsmithvoid 46167754Smsmith_ReportWarning ( 46267754Smsmith NATIVE_CHAR *ModuleName, 46367754Smsmith UINT32 LineNumber, 46467754Smsmith UINT32 ComponentId); 46567754Smsmith 46667754Smsmithvoid 46767754SmsmithAcpiCmDumpBuffer ( 46867754Smsmith UINT8 *Buffer, 46967754Smsmith UINT32 Count, 47067754Smsmith UINT32 Display, 47167754Smsmith UINT32 componentId); 47267754Smsmith 47367754Smsmith 47467754Smsmith/* 47567754Smsmith * CmDelete - Object deletion 47667754Smsmith */ 47767754Smsmith 47867754Smsmithvoid 47967754SmsmithAcpiCmDeleteInternalObj ( 48067754Smsmith ACPI_OPERAND_OBJECT *Object); 48167754Smsmith 48267754Smsmithvoid 48367754SmsmithAcpiCmDeleteInternalPackageObject ( 48467754Smsmith ACPI_OPERAND_OBJECT *Object); 48567754Smsmith 48667754Smsmithvoid 48767754SmsmithAcpiCmDeleteInternalSimpleObject ( 48867754Smsmith ACPI_OPERAND_OBJECT *Object); 48967754Smsmith 49067754SmsmithACPI_STATUS 49167754SmsmithAcpiCmDeleteInternalObjectList ( 49267754Smsmith ACPI_OPERAND_OBJECT **ObjList); 49367754Smsmith 49467754Smsmith 49567754Smsmith/* 49667754Smsmith * CmEval - object evaluation 49767754Smsmith */ 49867754Smsmith 49967754Smsmith/* Method name strings */ 50067754Smsmith 50167754Smsmith#define METHOD_NAME__HID "_HID" 50267754Smsmith#define METHOD_NAME__UID "_UID" 50367754Smsmith#define METHOD_NAME__ADR "_ADR" 50467754Smsmith#define METHOD_NAME__STA "_STA" 50567754Smsmith#define METHOD_NAME__REG "_REG" 50667754Smsmith#define METHOD_NAME__SEG "_SEG" 50767754Smsmith#define METHOD_NAME__BBN "_BBN" 50867754Smsmith 50967754Smsmith 51067754SmsmithACPI_STATUS 51167754SmsmithAcpiCmEvaluateNumericObject ( 51267754Smsmith NATIVE_CHAR *ObjectName, 51367754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 51467754Smsmith ACPI_INTEGER *Address); 51567754Smsmith 51667754SmsmithACPI_STATUS 51767754SmsmithAcpiCmExecute_HID ( 51867754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 51967754Smsmith DEVICE_ID *Hid); 52067754Smsmith 52167754SmsmithACPI_STATUS 52267754SmsmithAcpiCmExecute_STA ( 52367754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 52467754Smsmith UINT32 *StatusFlags); 52567754Smsmith 52667754SmsmithACPI_STATUS 52767754SmsmithAcpiCmExecute_UID ( 52867754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 52967754Smsmith DEVICE_ID *Uid); 53067754Smsmith 53167754Smsmith 53267754Smsmith/* 53367754Smsmith * CmError - exception interfaces 53467754Smsmith */ 53567754Smsmith 53667754SmsmithNATIVE_CHAR * 53767754SmsmithAcpiCmFormatException ( 53867754Smsmith ACPI_STATUS Status); 53967754Smsmith 54067754Smsmith 54167754Smsmith/* 54267754Smsmith * CmMutex - mutual exclusion interfaces 54367754Smsmith */ 54467754Smsmith 54567754SmsmithACPI_STATUS 54667754SmsmithAcpiCmMutexInitialize ( 54767754Smsmith void); 54867754Smsmith 54967754Smsmithvoid 55067754SmsmithAcpiCmMutexTerminate ( 55167754Smsmith void); 55267754Smsmith 55367754SmsmithACPI_STATUS 55467754SmsmithAcpiCmCreateMutex ( 55567754Smsmith ACPI_MUTEX_HANDLE MutexId); 55667754Smsmith 55767754SmsmithACPI_STATUS 55867754SmsmithAcpiCmDeleteMutex ( 55967754Smsmith ACPI_MUTEX_HANDLE MutexId); 56067754Smsmith 56167754SmsmithACPI_STATUS 56267754SmsmithAcpiCmAcquireMutex ( 56367754Smsmith ACPI_MUTEX_HANDLE MutexId); 56467754Smsmith 56567754SmsmithACPI_STATUS 56667754SmsmithAcpiCmReleaseMutex ( 56767754Smsmith ACPI_MUTEX_HANDLE MutexId); 56867754Smsmith 56967754Smsmith 57067754Smsmith/* 57167754Smsmith * CmObject - internal object create/delete/cache routines 57267754Smsmith */ 57367754Smsmith 57467754Smsmithvoid * 57567754Smsmith_CmAllocateObjectDesc ( 57667754Smsmith NATIVE_CHAR *ModuleName, 57767754Smsmith UINT32 LineNumber, 57867754Smsmith UINT32 ComponentId); 57967754Smsmith 58067754Smsmith#define AcpiCmCreateInternalObject(t) _CmCreateInternalObject(_THIS_MODULE,__LINE__,_COMPONENT,t) 58167754Smsmith#define AcpiCmAllocateObjectDesc() _CmAllocateObjectDesc(_THIS_MODULE,__LINE__,_COMPONENT) 58267754Smsmith 58367754Smsmithvoid 58467754SmsmithAcpiCmDeleteObjectDesc ( 58567754Smsmith ACPI_OPERAND_OBJECT *Object); 58667754Smsmith 58767754SmsmithBOOLEAN 58867754SmsmithAcpiCmValidInternalObject ( 58967754Smsmith void *Object); 59067754Smsmith 59167754Smsmith 59267754Smsmith/* 59367754Smsmith * CmRefCnt - Object reference count management 59467754Smsmith */ 59567754Smsmith 59667754Smsmithvoid 59767754SmsmithAcpiCmAddReference ( 59867754Smsmith ACPI_OPERAND_OBJECT *Object); 59967754Smsmith 60067754Smsmithvoid 60167754SmsmithAcpiCmRemoveReference ( 60267754Smsmith ACPI_OPERAND_OBJECT *Object); 60367754Smsmith 60467754Smsmith/* 60567754Smsmith * CmSize - Object size routines 60667754Smsmith */ 60767754Smsmith 60867754SmsmithACPI_STATUS 60967754SmsmithAcpiCmGetSimpleObjectSize ( 61067754Smsmith ACPI_OPERAND_OBJECT *Obj, 61167754Smsmith UINT32 *ObjLength); 61267754Smsmith 61367754SmsmithACPI_STATUS 61467754SmsmithAcpiCmGetPackageObjectSize ( 61567754Smsmith ACPI_OPERAND_OBJECT *Obj, 61667754Smsmith UINT32 *ObjLength); 61767754Smsmith 61867754SmsmithACPI_STATUS 61967754SmsmithAcpiCmGetObjectSize( 62067754Smsmith ACPI_OPERAND_OBJECT *Obj, 62167754Smsmith UINT32 *ObjLength); 62267754Smsmith 62367754Smsmith 62467754Smsmith/* 62567754Smsmith * CmState - Generic state creation/cache routines 62667754Smsmith */ 62767754Smsmith 62867754Smsmithvoid 62967754SmsmithAcpiCmPushGenericState ( 63067754Smsmith ACPI_GENERIC_STATE **ListHead, 63167754Smsmith ACPI_GENERIC_STATE *State); 63267754Smsmith 63367754SmsmithACPI_GENERIC_STATE * 63467754SmsmithAcpiCmPopGenericState ( 63567754Smsmith ACPI_GENERIC_STATE **ListHead); 63667754Smsmith 63767754Smsmith 63867754SmsmithACPI_GENERIC_STATE * 63967754SmsmithAcpiCmCreateGenericState ( 64067754Smsmith void); 64167754Smsmith 64267754SmsmithACPI_GENERIC_STATE * 64367754SmsmithAcpiCmCreateUpdateState ( 64467754Smsmith ACPI_OPERAND_OBJECT *Object, 64567754Smsmith UINT16 Action); 64667754Smsmith 64773561SmsmithACPI_GENERIC_STATE * 64873561SmsmithAcpiCmCreatePkgState ( 64973561Smsmith void *InternalObject, 65073561Smsmith void *ExternalObject, 65173561Smsmith UINT16 Index); 65273561Smsmith 65367754SmsmithACPI_STATUS 65467754SmsmithAcpiCmCreateUpdateStateAndPush ( 65567754Smsmith ACPI_OPERAND_OBJECT *Object, 65667754Smsmith UINT16 Action, 65767754Smsmith ACPI_GENERIC_STATE **StateList); 65867754Smsmith 65973561SmsmithACPI_STATUS 66073561SmsmithAcpiCmCreatePkgStateAndPush ( 66173561Smsmith void *InternalObject, 66273561Smsmith void *ExternalObject, 66373561Smsmith UINT16 Index, 66473561Smsmith ACPI_GENERIC_STATE **StateList); 66573561Smsmith 66667754SmsmithACPI_GENERIC_STATE * 66767754SmsmithAcpiCmCreateControlState ( 66867754Smsmith void); 66967754Smsmith 67067754Smsmithvoid 67167754SmsmithAcpiCmDeleteGenericState ( 67267754Smsmith ACPI_GENERIC_STATE *State); 67367754Smsmith 67467754Smsmithvoid 67567754SmsmithAcpiCmDeleteGenericStateCache ( 67667754Smsmith void); 67767754Smsmith 67867754Smsmithvoid 67967754SmsmithAcpiCmDeleteObjectCache ( 68067754Smsmith void); 68167754Smsmith 68267754Smsmith/* 68367754Smsmith * Cmutils 68467754Smsmith */ 68567754Smsmith 68667754SmsmithBOOLEAN 68767754SmsmithAcpiCmValidAcpiName ( 68867754Smsmith UINT32 Name); 68967754Smsmith 69067754SmsmithBOOLEAN 69167754SmsmithAcpiCmValidAcpiCharacter ( 69267754Smsmith NATIVE_CHAR Character); 69367754Smsmith 69467754SmsmithACPI_STATUS 69567754SmsmithAcpiCmResolvePackageReferences ( 69667754Smsmith ACPI_OPERAND_OBJECT *ObjDesc); 69767754Smsmith 69873561Smsmith#ifdef ACPI_DEBUG 69967754Smsmith 70073561Smsmithvoid 70173561SmsmithAcpiCmDisplayInitPathname ( 70273561Smsmith ACPI_HANDLE ObjHandle, 70373561Smsmith char *Path); 70473561Smsmith 70573561Smsmith#endif 70673561Smsmith 70773561Smsmith 70867754Smsmith/* 70967754Smsmith * Memory allocation functions and related macros. 71067754Smsmith * Macros that expand to include filename and line number 71167754Smsmith */ 71267754Smsmith 71367754Smsmithvoid * 71467754Smsmith_CmAllocate ( 71567754Smsmith UINT32 Size, 71667754Smsmith UINT32 Component, 71767754Smsmith NATIVE_CHAR *Module, 71867754Smsmith UINT32 Line); 71967754Smsmith 72067754Smsmithvoid * 72167754Smsmith_CmCallocate ( 72267754Smsmith UINT32 Size, 72367754Smsmith UINT32 Component, 72467754Smsmith NATIVE_CHAR *Module, 72567754Smsmith UINT32 Line); 72667754Smsmith 72767754Smsmithvoid 72867754Smsmith_CmFree ( 72967754Smsmith void *Address, 73067754Smsmith UINT32 Component, 73167754Smsmith NATIVE_CHAR *Module, 73267754Smsmith UINT32 Line); 73367754Smsmith 73467754Smsmithvoid 73567754SmsmithAcpiCmInitStaticObject ( 73667754Smsmith ACPI_OPERAND_OBJECT *ObjDesc); 73767754Smsmith 73867754Smsmith#define AcpiCmAllocate(a) _CmAllocate(a,_COMPONENT,_THIS_MODULE,__LINE__) 73967754Smsmith#define AcpiCmCallocate(a) _CmCallocate(a, _COMPONENT,_THIS_MODULE,__LINE__) 74067754Smsmith#define AcpiCmFree(a) _CmFree(a,_COMPONENT,_THIS_MODULE,__LINE__) 74167754Smsmith 74271867Smsmith#ifndef ACPI_DEBUG_TRACK_ALLOCATIONS 74367754Smsmith 74467754Smsmith#define AcpiCmAddElementToAllocList(a,b,c,d,e,f) 74567754Smsmith#define AcpiCmDeleteElementFromAllocList(a,b,c,d) 74667754Smsmith#define AcpiCmDumpCurrentAllocations(a,b) 74767754Smsmith#define AcpiCmDumpAllocationInfo() 74867754Smsmith 74967754Smsmith#define DECREMENT_OBJECT_METRICS(a) 75067754Smsmith#define INCREMENT_OBJECT_METRICS(a) 75167754Smsmith#define INITIALIZE_ALLOCATION_METRICS() 75267754Smsmith#define DECREMENT_NAME_TABLE_METRICS(a) 75367754Smsmith#define INCREMENT_NAME_TABLE_METRICS(a) 75467754Smsmith 75567754Smsmith#else 75667754Smsmith 75767754Smsmith#define INITIALIZE_ALLOCATION_METRICS() \ 75867754Smsmith AcpiGbl_CurrentObjectCount = 0; \ 75967754Smsmith AcpiGbl_CurrentObjectSize = 0; \ 76067754Smsmith AcpiGbl_RunningObjectCount = 0; \ 76167754Smsmith AcpiGbl_RunningObjectSize = 0; \ 76267754Smsmith AcpiGbl_MaxConcurrentObjectCount = 0; \ 76367754Smsmith AcpiGbl_MaxConcurrentObjectSize = 0; \ 76467754Smsmith AcpiGbl_CurrentAllocSize = 0; \ 76567754Smsmith AcpiGbl_CurrentAllocCount = 0; \ 76667754Smsmith AcpiGbl_RunningAllocSize = 0; \ 76767754Smsmith AcpiGbl_RunningAllocCount = 0; \ 76867754Smsmith AcpiGbl_MaxConcurrentAllocSize = 0; \ 76967754Smsmith AcpiGbl_MaxConcurrentAllocCount = 0; \ 77067754Smsmith AcpiGbl_CurrentNodeCount = 0; \ 77167754Smsmith AcpiGbl_CurrentNodeSize = 0; \ 77267754Smsmith AcpiGbl_MaxConcurrentNodeCount = 0 77367754Smsmith 77467754Smsmith 77567754Smsmith#define DECREMENT_OBJECT_METRICS(a) \ 77667754Smsmith AcpiGbl_CurrentObjectCount--; \ 77767754Smsmith AcpiGbl_CurrentObjectSize -= a 77867754Smsmith 77967754Smsmith#define INCREMENT_OBJECT_METRICS(a) \ 78067754Smsmith AcpiGbl_CurrentObjectCount++; \ 78167754Smsmith AcpiGbl_RunningObjectCount++; \ 78267754Smsmith if (AcpiGbl_MaxConcurrentObjectCount < AcpiGbl_CurrentObjectCount) \ 78367754Smsmith { \ 78467754Smsmith AcpiGbl_MaxConcurrentObjectCount = AcpiGbl_CurrentObjectCount; \ 78567754Smsmith } \ 78667754Smsmith AcpiGbl_RunningObjectSize += a; \ 78767754Smsmith AcpiGbl_CurrentObjectSize += a; \ 78867754Smsmith if (AcpiGbl_MaxConcurrentObjectSize < AcpiGbl_CurrentObjectSize) \ 78967754Smsmith { \ 79067754Smsmith AcpiGbl_MaxConcurrentObjectSize = AcpiGbl_CurrentObjectSize; \ 79167754Smsmith } 79267754Smsmith 79367754Smsmith#define DECREMENT_NAME_TABLE_METRICS(a) \ 79467754Smsmith AcpiGbl_CurrentNodeCount--; \ 79567754Smsmith AcpiGbl_CurrentNodeSize -= (a) 79667754Smsmith 79767754Smsmith#define INCREMENT_NAME_TABLE_METRICS(a) \ 79867754Smsmith AcpiGbl_CurrentNodeCount++; \ 79967754Smsmith AcpiGbl_CurrentNodeSize+= (a); \ 80067754Smsmith if (AcpiGbl_MaxConcurrentNodeCount < AcpiGbl_CurrentNodeCount) \ 80167754Smsmith { \ 80267754Smsmith AcpiGbl_MaxConcurrentNodeCount = AcpiGbl_CurrentNodeCount; \ 80367754Smsmith } \ 80467754Smsmith 80567754Smsmith 80667754Smsmithvoid 80767754SmsmithAcpiCmDumpAllocationInfo ( 80867754Smsmith void); 80967754Smsmith 81067754Smsmithvoid 81167754SmsmithAcpiCmDumpCurrentAllocations ( 81267754Smsmith UINT32 Component, 81367754Smsmith NATIVE_CHAR *Module); 81467754Smsmith 81567754Smsmith#endif 81667754Smsmith 81767754Smsmith 81867754Smsmith#endif /* _ACCOMMON_H */ 819