acutils.h revision 71867
167754Smsmith/******************************************************************************
267754Smsmith *
367754Smsmith * Name: accommon.h -- prototypes for the common (subsystem-wide) procedures
471867Smsmith *       $Revision: 87 $
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
12167754Smsmith#define REF_INCREMENT       (UINT16) 0
12267754Smsmith#define REF_DECREMENT       (UINT16) 1
12367754Smsmith#define REF_FORCE_DELETE    (UINT16) 2
12467754Smsmith
12567754Smsmith/* AcpiCmDumpBuffer */
12667754Smsmith
12767754Smsmith#define DB_BYTE_DISPLAY     1
12867754Smsmith#define DB_WORD_DISPLAY     2
12967754Smsmith#define DB_DWORD_DISPLAY    4
13067754Smsmith#define DB_QWORD_DISPLAY    8
13167754Smsmith
13267754Smsmith
13367754Smsmith/* Global initialization interfaces */
13467754Smsmith
13567754Smsmithvoid
13667754SmsmithAcpiCmInitGlobals (
13767754Smsmith    void);
13867754Smsmith
13967754Smsmithvoid
14067754SmsmithAcpiCmTerminate (
14167754Smsmith    void);
14267754Smsmith
14367754Smsmith
14467754Smsmith/*
14567754Smsmith * CmInit - miscellaneous initialization and shutdown
14667754Smsmith */
14767754Smsmith
14867754SmsmithACPI_STATUS
14967754SmsmithAcpiCmHardwareInitialize (
15067754Smsmith    void);
15167754Smsmith
15267754SmsmithACPI_STATUS
15367754SmsmithAcpiCmSubsystemShutdown (
15467754Smsmith    void);
15567754Smsmith
15667754SmsmithACPI_STATUS
15769450SmsmithAcpiCmValidateFadt (
15867754Smsmith    void);
15967754Smsmith
16067754Smsmith/*
16167754Smsmith * CmGlobal - Global data structures and procedures
16267754Smsmith */
16367754Smsmith
16469746Smsmith#ifdef ACPI_DEBUG
16569746Smsmith
16667754SmsmithNATIVE_CHAR *
16767754SmsmithAcpiCmGetMutexName (
16867754Smsmith    UINT32                  MutexId);
16967754Smsmith
17067754SmsmithNATIVE_CHAR *
17167754SmsmithAcpiCmGetTypeName (
17267754Smsmith    UINT32                  Type);
17367754Smsmith
17469746SmsmithNATIVE_CHAR *
17569746SmsmithAcpiCmGetRegionName (
17669746Smsmith    UINT8                   SpaceId);
17769746Smsmith
17869746Smsmith#endif
17969746Smsmith
18069746Smsmith
18167754SmsmithBOOLEAN
18267754SmsmithAcpiCmValidObjectType (
18367754Smsmith    UINT32                  Type);
18467754Smsmith
18567754SmsmithACPI_OWNER_ID
18667754SmsmithAcpiCmAllocateOwnerId (
18767754Smsmith    UINT32                  IdType);
18867754Smsmith
18967754Smsmith
19067754Smsmith/*
19167754Smsmith * CmClib - Local implementations of C library functions
19267754Smsmith */
19367754Smsmith
19471867Smsmith#ifndef ACPI_USE_SYSTEM_CLIBRARY
19571867Smsmith
19667754SmsmithNATIVE_UINT
19767754SmsmithAcpiCmStrlen (
19867754Smsmith    const NATIVE_CHAR       *String);
19967754Smsmith
20067754SmsmithNATIVE_CHAR *
20167754SmsmithAcpiCmStrcpy (
20267754Smsmith    NATIVE_CHAR             *DstString,
20367754Smsmith    const NATIVE_CHAR       *SrcString);
20467754Smsmith
20567754SmsmithNATIVE_CHAR *
20667754SmsmithAcpiCmStrncpy (
20767754Smsmith    NATIVE_CHAR             *DstString,
20867754Smsmith    const NATIVE_CHAR       *SrcString,
20967754Smsmith    NATIVE_UINT             Count);
21067754Smsmith
21167754SmsmithUINT32
21267754SmsmithAcpiCmStrncmp (
21367754Smsmith    const NATIVE_CHAR       *String1,
21467754Smsmith    const NATIVE_CHAR       *String2,
21567754Smsmith    NATIVE_UINT             Count);
21667754Smsmith
21767754SmsmithUINT32
21867754SmsmithAcpiCmStrcmp (
21967754Smsmith    const NATIVE_CHAR       *String1,
22067754Smsmith    const NATIVE_CHAR       *String2);
22167754Smsmith
22267754SmsmithNATIVE_CHAR *
22367754SmsmithAcpiCmStrcat (
22467754Smsmith    NATIVE_CHAR             *DstString,
22567754Smsmith    const NATIVE_CHAR       *SrcString);
22667754Smsmith
22767754SmsmithNATIVE_CHAR *
22867754SmsmithAcpiCmStrncat (
22967754Smsmith    NATIVE_CHAR             *DstString,
23067754Smsmith    const NATIVE_CHAR       *SrcString,
23167754Smsmith    NATIVE_UINT             Count);
23267754Smsmith
23367754SmsmithUINT32
23467754SmsmithAcpiCmStrtoul (
23567754Smsmith    const NATIVE_CHAR       *String,
23667754Smsmith    NATIVE_CHAR             **Terminator,
23771867Smsmith    NATIVE_UINT             Base);
23867754Smsmith
23967754SmsmithNATIVE_CHAR *
24067754SmsmithAcpiCmStrstr (
24167754Smsmith    NATIVE_CHAR             *String1,
24267754Smsmith    NATIVE_CHAR             *String2);
24367754Smsmith
24467754SmsmithNATIVE_CHAR *
24567754SmsmithAcpiCmStrupr (
24667754Smsmith    NATIVE_CHAR             *SrcString);
24767754Smsmith
24867754Smsmithvoid *
24967754SmsmithAcpiCmMemcpy (
25067754Smsmith    void                    *Dest,
25167754Smsmith    const void              *Src,
25267754Smsmith    NATIVE_UINT             Count);
25367754Smsmith
25467754Smsmithvoid *
25567754SmsmithAcpiCmMemset (
25667754Smsmith    void                    *Dest,
25771867Smsmith    NATIVE_UINT             Value,
25867754Smsmith    NATIVE_UINT             Count);
25967754Smsmith
26067754SmsmithUINT32
26167754SmsmithAcpiCmToUpper (
26267754Smsmith    UINT32                  c);
26367754Smsmith
26467754SmsmithUINT32
26567754SmsmithAcpiCmToLower (
26667754Smsmith    UINT32                  c);
26767754Smsmith
26871867Smsmith#endif /* ACPI_USE_SYSTEM_CLIBRARY */
26967754Smsmith
27067754Smsmith/*
27167754Smsmith * CmCopy - Object construction and conversion interfaces
27267754Smsmith */
27367754Smsmith
27467754SmsmithACPI_STATUS
27567754SmsmithAcpiCmBuildSimpleObject(
27667754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
27767754Smsmith    ACPI_OBJECT             *UserObj,
27867754Smsmith    UINT8                   *DataSpace,
27967754Smsmith    UINT32                  *BufferSpaceUsed);
28067754Smsmith
28167754SmsmithACPI_STATUS
28267754SmsmithAcpiCmBuildPackageObject (
28367754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
28467754Smsmith    UINT8                   *Buffer,
28567754Smsmith    UINT32                  *SpaceUsed);
28667754Smsmith
28767754SmsmithACPI_STATUS
28867754SmsmithAcpiCmBuildExternalObject (
28967754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
29067754Smsmith    ACPI_BUFFER             *RetBuffer);
29167754Smsmith
29267754SmsmithACPI_STATUS
29367754SmsmithAcpiCmBuildInternalSimpleObject(
29467754Smsmith    ACPI_OBJECT             *UserObj,
29567754Smsmith    ACPI_OPERAND_OBJECT     *Obj);
29667754Smsmith
29767754SmsmithACPI_STATUS
29867754SmsmithAcpiCmBuildInternalObject (
29967754Smsmith    ACPI_OBJECT             *Obj,
30067754Smsmith    ACPI_OPERAND_OBJECT     *InternalObj);
30167754Smsmith
30267754SmsmithACPI_STATUS
30367754SmsmithAcpiCmCopyInternalSimpleObject (
30467754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
30567754Smsmith    ACPI_OPERAND_OBJECT     *DestObj);
30667754Smsmith
30767754SmsmithACPI_STATUS
30867754SmsmithAcpiCmBuildCopyInternalPackageObject (
30967754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
31067754Smsmith    ACPI_OPERAND_OBJECT     *DestObj);
31167754Smsmith
31267754Smsmith
31367754Smsmith/*
31467754Smsmith * CmCreate - Object creation
31567754Smsmith */
31667754Smsmith
31767754SmsmithACPI_STATUS
31867754SmsmithAcpiCmUpdateObjectReference (
31967754Smsmith    ACPI_OPERAND_OBJECT     *Object,
32067754Smsmith    UINT16                  Action);
32167754Smsmith
32267754SmsmithACPI_OPERAND_OBJECT  *
32367754Smsmith_CmCreateInternalObject (
32467754Smsmith    NATIVE_CHAR             *ModuleName,
32567754Smsmith    UINT32                  LineNumber,
32667754Smsmith    UINT32                  ComponentId,
32767754Smsmith    OBJECT_TYPE_INTERNAL    Type);
32867754Smsmith
32967754Smsmith
33067754Smsmith/*
33167754Smsmith * CmDebug - Debug interfaces
33267754Smsmith */
33367754Smsmith
33467754SmsmithUINT32
33567754SmsmithGetDebugLevel (
33667754Smsmith    void);
33767754Smsmith
33867754Smsmithvoid
33967754SmsmithSetDebugLevel (
34067754Smsmith    UINT32                  level);
34167754Smsmith
34267754Smsmithvoid
34367754SmsmithFunctionTrace (
34467754Smsmith    NATIVE_CHAR             *ModuleName,
34567754Smsmith    UINT32                  LineNumber,
34667754Smsmith    UINT32                  ComponentId,
34767754Smsmith    NATIVE_CHAR             *FunctionName);
34867754Smsmith
34967754Smsmithvoid
35067754SmsmithFunctionTracePtr (
35167754Smsmith    NATIVE_CHAR             *ModuleName,
35267754Smsmith    UINT32                  LineNumber,
35367754Smsmith    UINT32                  ComponentId,
35467754Smsmith    NATIVE_CHAR             *FunctionName,
35567754Smsmith    void                    *Pointer);
35667754Smsmith
35767754Smsmithvoid
35867754SmsmithFunctionTraceU32 (
35967754Smsmith    NATIVE_CHAR             *ModuleName,
36067754Smsmith    UINT32                  LineNumber,
36167754Smsmith    UINT32                  ComponentId,
36267754Smsmith    NATIVE_CHAR             *FunctionName,
36367754Smsmith    UINT32                  Integer);
36467754Smsmith
36567754Smsmithvoid
36667754SmsmithFunctionTraceStr (
36767754Smsmith    NATIVE_CHAR             *ModuleName,
36867754Smsmith    UINT32                  LineNumber,
36967754Smsmith    UINT32                  ComponentId,
37067754Smsmith    NATIVE_CHAR             *FunctionName,
37167754Smsmith    NATIVE_CHAR             *String);
37267754Smsmith
37367754Smsmithvoid
37467754SmsmithFunctionExit (
37567754Smsmith    NATIVE_CHAR             *ModuleName,
37667754Smsmith    UINT32                  LineNumber,
37767754Smsmith    UINT32                  ComponentId,
37867754Smsmith    NATIVE_CHAR             *FunctionName);
37967754Smsmith
38067754Smsmithvoid
38167754SmsmithFunctionStatusExit (
38267754Smsmith    NATIVE_CHAR             *ModuleName,
38367754Smsmith    UINT32                  LineNumber,
38467754Smsmith    UINT32                  ComponentId,
38567754Smsmith    NATIVE_CHAR             *FunctionName,
38667754Smsmith    ACPI_STATUS             Status);
38767754Smsmith
38867754Smsmithvoid
38967754SmsmithFunctionValueExit (
39067754Smsmith    NATIVE_CHAR             *ModuleName,
39167754Smsmith    UINT32                  LineNumber,
39267754Smsmith    UINT32                  ComponentId,
39367754Smsmith    NATIVE_CHAR             *FunctionName,
39471867Smsmith    ACPI_INTEGER            Value);
39567754Smsmith
39667754Smsmithvoid
39767754SmsmithFunctionPtrExit (
39867754Smsmith    NATIVE_CHAR             *ModuleName,
39967754Smsmith    UINT32                  LineNumber,
40067754Smsmith    UINT32                  ComponentId,
40167754Smsmith    NATIVE_CHAR             *FunctionName,
40267754Smsmith    UINT8                   *Ptr);
40367754Smsmith
40467754Smsmithvoid
40567754SmsmithDebugPrintPrefix (
40667754Smsmith    NATIVE_CHAR             *ModuleName,
40767754Smsmith    UINT32                  LineNumber);
40867754Smsmith
40967754Smsmithvoid
41067754SmsmithDebugPrint (
41167754Smsmith    NATIVE_CHAR             *ModuleName,
41267754Smsmith    UINT32                  LineNumber,
41367754Smsmith    UINT32                  ComponentId,
41467754Smsmith    UINT32                  PrintLevel,
41567754Smsmith    NATIVE_CHAR             *Format, ...);
41667754Smsmith
41767754Smsmithvoid
41867754SmsmithDebugPrintRaw (
41967754Smsmith    NATIVE_CHAR             *Format, ...);
42067754Smsmith
42167754Smsmithvoid
42267754Smsmith_ReportInfo (
42367754Smsmith    NATIVE_CHAR             *ModuleName,
42467754Smsmith    UINT32                  LineNumber,
42567754Smsmith    UINT32                  ComponentId);
42667754Smsmith
42767754Smsmithvoid
42867754Smsmith_ReportError (
42967754Smsmith    NATIVE_CHAR             *ModuleName,
43067754Smsmith    UINT32                  LineNumber,
43167754Smsmith    UINT32                  ComponentId);
43267754Smsmith
43367754Smsmithvoid
43467754Smsmith_ReportWarning (
43567754Smsmith    NATIVE_CHAR             *ModuleName,
43667754Smsmith    UINT32                  LineNumber,
43767754Smsmith    UINT32                  ComponentId);
43867754Smsmith
43967754Smsmithvoid
44067754SmsmithAcpiCmDumpBuffer (
44167754Smsmith    UINT8                   *Buffer,
44267754Smsmith    UINT32                  Count,
44367754Smsmith    UINT32                  Display,
44467754Smsmith    UINT32                  componentId);
44567754Smsmith
44667754Smsmith
44767754Smsmith/*
44867754Smsmith * CmDelete - Object deletion
44967754Smsmith */
45067754Smsmith
45167754Smsmithvoid
45267754SmsmithAcpiCmDeleteInternalObj (
45367754Smsmith    ACPI_OPERAND_OBJECT     *Object);
45467754Smsmith
45567754Smsmithvoid
45667754SmsmithAcpiCmDeleteInternalPackageObject (
45767754Smsmith    ACPI_OPERAND_OBJECT     *Object);
45867754Smsmith
45967754Smsmithvoid
46067754SmsmithAcpiCmDeleteInternalSimpleObject (
46167754Smsmith    ACPI_OPERAND_OBJECT     *Object);
46267754Smsmith
46367754SmsmithACPI_STATUS
46467754SmsmithAcpiCmDeleteInternalObjectList (
46567754Smsmith    ACPI_OPERAND_OBJECT     **ObjList);
46667754Smsmith
46767754Smsmith
46867754Smsmith/*
46967754Smsmith * CmEval - object evaluation
47067754Smsmith */
47167754Smsmith
47267754Smsmith/* Method name strings */
47367754Smsmith
47467754Smsmith#define METHOD_NAME__HID        "_HID"
47567754Smsmith#define METHOD_NAME__UID        "_UID"
47667754Smsmith#define METHOD_NAME__ADR        "_ADR"
47767754Smsmith#define METHOD_NAME__STA        "_STA"
47867754Smsmith#define METHOD_NAME__REG        "_REG"
47967754Smsmith#define METHOD_NAME__SEG        "_SEG"
48067754Smsmith#define METHOD_NAME__BBN        "_BBN"
48167754Smsmith
48267754Smsmith
48367754SmsmithACPI_STATUS
48467754SmsmithAcpiCmEvaluateNumericObject (
48567754Smsmith    NATIVE_CHAR             *ObjectName,
48667754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
48767754Smsmith    ACPI_INTEGER            *Address);
48867754Smsmith
48967754SmsmithACPI_STATUS
49067754SmsmithAcpiCmExecute_HID (
49167754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
49267754Smsmith    DEVICE_ID               *Hid);
49367754Smsmith
49467754SmsmithACPI_STATUS
49567754SmsmithAcpiCmExecute_STA (
49667754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
49767754Smsmith    UINT32                  *StatusFlags);
49867754Smsmith
49967754SmsmithACPI_STATUS
50067754SmsmithAcpiCmExecute_UID (
50167754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
50267754Smsmith    DEVICE_ID               *Uid);
50367754Smsmith
50467754Smsmith
50567754Smsmith/*
50667754Smsmith * CmError - exception interfaces
50767754Smsmith */
50867754Smsmith
50967754SmsmithNATIVE_CHAR *
51067754SmsmithAcpiCmFormatException (
51167754Smsmith    ACPI_STATUS             Status);
51267754Smsmith
51367754Smsmith
51467754Smsmith/*
51567754Smsmith * CmMutex - mutual exclusion interfaces
51667754Smsmith */
51767754Smsmith
51867754SmsmithACPI_STATUS
51967754SmsmithAcpiCmMutexInitialize (
52067754Smsmith    void);
52167754Smsmith
52267754Smsmithvoid
52367754SmsmithAcpiCmMutexTerminate (
52467754Smsmith    void);
52567754Smsmith
52667754SmsmithACPI_STATUS
52767754SmsmithAcpiCmCreateMutex (
52867754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
52967754Smsmith
53067754SmsmithACPI_STATUS
53167754SmsmithAcpiCmDeleteMutex (
53267754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
53367754Smsmith
53467754SmsmithACPI_STATUS
53567754SmsmithAcpiCmAcquireMutex (
53667754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
53767754Smsmith
53867754SmsmithACPI_STATUS
53967754SmsmithAcpiCmReleaseMutex (
54067754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
54167754Smsmith
54267754Smsmith
54367754Smsmith/*
54467754Smsmith * CmObject - internal object create/delete/cache routines
54567754Smsmith */
54667754Smsmith
54767754Smsmithvoid *
54867754Smsmith_CmAllocateObjectDesc (
54967754Smsmith    NATIVE_CHAR             *ModuleName,
55067754Smsmith    UINT32                  LineNumber,
55167754Smsmith    UINT32                  ComponentId);
55267754Smsmith
55367754Smsmith#define AcpiCmCreateInternalObject(t)   _CmCreateInternalObject(_THIS_MODULE,__LINE__,_COMPONENT,t)
55467754Smsmith#define AcpiCmAllocateObjectDesc()      _CmAllocateObjectDesc(_THIS_MODULE,__LINE__,_COMPONENT)
55567754Smsmith
55667754Smsmithvoid
55767754SmsmithAcpiCmDeleteObjectDesc (
55867754Smsmith    ACPI_OPERAND_OBJECT     *Object);
55967754Smsmith
56067754SmsmithBOOLEAN
56167754SmsmithAcpiCmValidInternalObject (
56267754Smsmith    void                    *Object);
56367754Smsmith
56467754Smsmith
56567754Smsmith/*
56667754Smsmith * CmRefCnt - Object reference count management
56767754Smsmith */
56867754Smsmith
56967754Smsmithvoid
57067754SmsmithAcpiCmAddReference (
57167754Smsmith    ACPI_OPERAND_OBJECT     *Object);
57267754Smsmith
57367754Smsmithvoid
57467754SmsmithAcpiCmRemoveReference (
57567754Smsmith    ACPI_OPERAND_OBJECT     *Object);
57667754Smsmith
57767754Smsmith/*
57867754Smsmith * CmSize - Object size routines
57967754Smsmith */
58067754Smsmith
58167754SmsmithACPI_STATUS
58267754SmsmithAcpiCmGetSimpleObjectSize (
58367754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
58467754Smsmith    UINT32                  *ObjLength);
58567754Smsmith
58667754SmsmithACPI_STATUS
58767754SmsmithAcpiCmGetPackageObjectSize (
58867754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
58967754Smsmith    UINT32                  *ObjLength);
59067754Smsmith
59167754SmsmithACPI_STATUS
59267754SmsmithAcpiCmGetObjectSize(
59367754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
59467754Smsmith    UINT32                  *ObjLength);
59567754Smsmith
59667754Smsmith
59767754Smsmith/*
59867754Smsmith * CmState - Generic state creation/cache routines
59967754Smsmith */
60067754Smsmith
60167754Smsmithvoid
60267754SmsmithAcpiCmPushGenericState (
60367754Smsmith    ACPI_GENERIC_STATE      **ListHead,
60467754Smsmith    ACPI_GENERIC_STATE      *State);
60567754Smsmith
60667754SmsmithACPI_GENERIC_STATE *
60767754SmsmithAcpiCmPopGenericState (
60867754Smsmith    ACPI_GENERIC_STATE      **ListHead);
60967754Smsmith
61067754Smsmith
61167754SmsmithACPI_GENERIC_STATE *
61267754SmsmithAcpiCmCreateGenericState (
61367754Smsmith    void);
61467754Smsmith
61567754SmsmithACPI_GENERIC_STATE *
61667754SmsmithAcpiCmCreateUpdateState (
61767754Smsmith    ACPI_OPERAND_OBJECT     *Object,
61867754Smsmith    UINT16                  Action);
61967754Smsmith
62067754SmsmithACPI_STATUS
62167754SmsmithAcpiCmCreateUpdateStateAndPush (
62267754Smsmith    ACPI_OPERAND_OBJECT     *Object,
62367754Smsmith    UINT16                  Action,
62467754Smsmith    ACPI_GENERIC_STATE      **StateList);
62567754Smsmith
62667754SmsmithACPI_GENERIC_STATE *
62767754SmsmithAcpiCmCreateControlState (
62867754Smsmith    void);
62967754Smsmith
63067754Smsmithvoid
63167754SmsmithAcpiCmDeleteGenericState (
63267754Smsmith    ACPI_GENERIC_STATE      *State);
63367754Smsmith
63467754Smsmithvoid
63567754SmsmithAcpiCmDeleteGenericStateCache (
63667754Smsmith    void);
63767754Smsmith
63867754Smsmithvoid
63967754SmsmithAcpiCmDeleteObjectCache (
64067754Smsmith    void);
64167754Smsmith
64267754Smsmith/*
64367754Smsmith * Cmutils
64467754Smsmith */
64567754Smsmith
64667754SmsmithBOOLEAN
64767754SmsmithAcpiCmValidAcpiName (
64867754Smsmith    UINT32                  Name);
64967754Smsmith
65067754SmsmithBOOLEAN
65167754SmsmithAcpiCmValidAcpiCharacter (
65267754Smsmith    NATIVE_CHAR             Character);
65367754Smsmith
65467754SmsmithACPI_STATUS
65567754SmsmithAcpiCmResolvePackageReferences (
65667754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc);
65767754Smsmith
65867754Smsmith
65967754Smsmith/*
66067754Smsmith * Memory allocation functions and related macros.
66167754Smsmith * Macros that expand to include filename and line number
66267754Smsmith */
66367754Smsmith
66467754Smsmithvoid *
66567754Smsmith_CmAllocate (
66667754Smsmith    UINT32                  Size,
66767754Smsmith    UINT32                  Component,
66867754Smsmith    NATIVE_CHAR             *Module,
66967754Smsmith    UINT32                  Line);
67067754Smsmith
67167754Smsmithvoid *
67267754Smsmith_CmCallocate (
67367754Smsmith    UINT32                  Size,
67467754Smsmith    UINT32                  Component,
67567754Smsmith    NATIVE_CHAR             *Module,
67667754Smsmith    UINT32                  Line);
67767754Smsmith
67867754Smsmithvoid
67967754Smsmith_CmFree (
68067754Smsmith    void                    *Address,
68167754Smsmith    UINT32                  Component,
68267754Smsmith    NATIVE_CHAR             *Module,
68367754Smsmith    UINT32                  Line);
68467754Smsmith
68567754Smsmithvoid
68667754SmsmithAcpiCmInitStaticObject (
68767754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc);
68867754Smsmith
68967754Smsmith#define AcpiCmAllocate(a)               _CmAllocate(a,_COMPONENT,_THIS_MODULE,__LINE__)
69067754Smsmith#define AcpiCmCallocate(a)              _CmCallocate(a, _COMPONENT,_THIS_MODULE,__LINE__)
69167754Smsmith#define AcpiCmFree(a)                   _CmFree(a,_COMPONENT,_THIS_MODULE,__LINE__)
69267754Smsmith
69371867Smsmith#ifndef ACPI_DEBUG_TRACK_ALLOCATIONS
69467754Smsmith
69567754Smsmith#define AcpiCmAddElementToAllocList(a,b,c,d,e,f)
69667754Smsmith#define AcpiCmDeleteElementFromAllocList(a,b,c,d)
69767754Smsmith#define AcpiCmDumpCurrentAllocations(a,b)
69867754Smsmith#define AcpiCmDumpAllocationInfo()
69967754Smsmith
70067754Smsmith#define DECREMENT_OBJECT_METRICS(a)
70167754Smsmith#define INCREMENT_OBJECT_METRICS(a)
70267754Smsmith#define INITIALIZE_ALLOCATION_METRICS()
70367754Smsmith#define DECREMENT_NAME_TABLE_METRICS(a)
70467754Smsmith#define INCREMENT_NAME_TABLE_METRICS(a)
70567754Smsmith
70667754Smsmith#else
70767754Smsmith
70867754Smsmith#define INITIALIZE_ALLOCATION_METRICS() \
70967754Smsmith    AcpiGbl_CurrentObjectCount = 0; \
71067754Smsmith    AcpiGbl_CurrentObjectSize = 0; \
71167754Smsmith    AcpiGbl_RunningObjectCount = 0; \
71267754Smsmith    AcpiGbl_RunningObjectSize = 0; \
71367754Smsmith    AcpiGbl_MaxConcurrentObjectCount = 0; \
71467754Smsmith    AcpiGbl_MaxConcurrentObjectSize = 0; \
71567754Smsmith    AcpiGbl_CurrentAllocSize = 0; \
71667754Smsmith    AcpiGbl_CurrentAllocCount = 0; \
71767754Smsmith    AcpiGbl_RunningAllocSize = 0; \
71867754Smsmith    AcpiGbl_RunningAllocCount = 0; \
71967754Smsmith    AcpiGbl_MaxConcurrentAllocSize = 0; \
72067754Smsmith    AcpiGbl_MaxConcurrentAllocCount = 0; \
72167754Smsmith    AcpiGbl_CurrentNodeCount = 0; \
72267754Smsmith    AcpiGbl_CurrentNodeSize = 0; \
72367754Smsmith    AcpiGbl_MaxConcurrentNodeCount = 0
72467754Smsmith
72567754Smsmith
72667754Smsmith#define DECREMENT_OBJECT_METRICS(a) \
72767754Smsmith    AcpiGbl_CurrentObjectCount--; \
72867754Smsmith    AcpiGbl_CurrentObjectSize -= a
72967754Smsmith
73067754Smsmith#define INCREMENT_OBJECT_METRICS(a) \
73167754Smsmith    AcpiGbl_CurrentObjectCount++; \
73267754Smsmith    AcpiGbl_RunningObjectCount++; \
73367754Smsmith    if (AcpiGbl_MaxConcurrentObjectCount < AcpiGbl_CurrentObjectCount) \
73467754Smsmith    { \
73567754Smsmith        AcpiGbl_MaxConcurrentObjectCount = AcpiGbl_CurrentObjectCount; \
73667754Smsmith    } \
73767754Smsmith    AcpiGbl_RunningObjectSize += a; \
73867754Smsmith    AcpiGbl_CurrentObjectSize += a; \
73967754Smsmith    if (AcpiGbl_MaxConcurrentObjectSize < AcpiGbl_CurrentObjectSize) \
74067754Smsmith    { \
74167754Smsmith        AcpiGbl_MaxConcurrentObjectSize = AcpiGbl_CurrentObjectSize; \
74267754Smsmith    }
74367754Smsmith
74467754Smsmith#define DECREMENT_NAME_TABLE_METRICS(a) \
74567754Smsmith    AcpiGbl_CurrentNodeCount--; \
74667754Smsmith    AcpiGbl_CurrentNodeSize -= (a)
74767754Smsmith
74867754Smsmith#define INCREMENT_NAME_TABLE_METRICS(a) \
74967754Smsmith    AcpiGbl_CurrentNodeCount++; \
75067754Smsmith    AcpiGbl_CurrentNodeSize+= (a); \
75167754Smsmith    if (AcpiGbl_MaxConcurrentNodeCount < AcpiGbl_CurrentNodeCount) \
75267754Smsmith    { \
75367754Smsmith        AcpiGbl_MaxConcurrentNodeCount = AcpiGbl_CurrentNodeCount; \
75467754Smsmith    } \
75567754Smsmith
75667754Smsmith
75767754Smsmithvoid
75867754SmsmithAcpiCmDumpAllocationInfo (
75967754Smsmith    void);
76067754Smsmith
76167754Smsmithvoid
76267754SmsmithAcpiCmDumpCurrentAllocations (
76367754Smsmith    UINT32                  Component,
76467754Smsmith    NATIVE_CHAR             *Module);
76567754Smsmith
76667754Smsmith#endif
76767754Smsmith
76867754Smsmith
76967754Smsmith#endif /* _ACCOMMON_H */
770