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