acutils.h revision 82367
167754Smsmith/******************************************************************************
267754Smsmith *
377424Smsmith * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
482367Smsmith *       $Revision: 108 $
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
11777424Smsmith#ifndef _ACUTILS_H
11877424Smsmith#define _ACUTILS_H
11967754Smsmith
12067754Smsmith
12173561Smsmithtypedef
12273561SmsmithACPI_STATUS (*ACPI_PKG_CALLBACK) (
12373561Smsmith    UINT8                   ObjectType,
12473561Smsmith    ACPI_OPERAND_OBJECT     *SourceObject,
12573561Smsmith    ACPI_GENERIC_STATE      *State,
12673561Smsmith    void                    *Context);
12773561Smsmith
12873561Smsmith
12973561SmsmithACPI_STATUS
13077424SmsmithAcpiUtWalkPackageTree (
13173561Smsmith    ACPI_OPERAND_OBJECT     *SourceObject,
13273561Smsmith    void                    *TargetObject,
13373561Smsmith    ACPI_PKG_CALLBACK       WalkCallback,
13473561Smsmith    void                    *Context);
13573561Smsmith
13673561Smsmith
13773561Smsmithtypedef struct acpi_pkg_info
13873561Smsmith{
13973561Smsmith    UINT8                   *FreeSpace;
14073561Smsmith    UINT32                  Length;
14173561Smsmith    UINT32                  ObjectSpace;
14273561Smsmith    UINT32                  NumPackages;
14373561Smsmith} ACPI_PKG_INFO;
14473561Smsmith
14567754Smsmith#define REF_INCREMENT       (UINT16) 0
14667754Smsmith#define REF_DECREMENT       (UINT16) 1
14767754Smsmith#define REF_FORCE_DELETE    (UINT16) 2
14867754Smsmith
14977424Smsmith/* AcpiUtDumpBuffer */
15067754Smsmith
15167754Smsmith#define DB_BYTE_DISPLAY     1
15267754Smsmith#define DB_WORD_DISPLAY     2
15367754Smsmith#define DB_DWORD_DISPLAY    4
15467754Smsmith#define DB_QWORD_DISPLAY    8
15567754Smsmith
15667754Smsmith
15767754Smsmith/* Global initialization interfaces */
15867754Smsmith
15967754Smsmithvoid
16077424SmsmithAcpiUtInitGlobals (
16167754Smsmith    void);
16267754Smsmith
16367754Smsmithvoid
16477424SmsmithAcpiUtTerminate (
16567754Smsmith    void);
16667754Smsmith
16767754Smsmith
16867754Smsmith/*
16977424Smsmith * UtInit - miscellaneous initialization and shutdown
17067754Smsmith */
17167754Smsmith
17267754SmsmithACPI_STATUS
17377424SmsmithAcpiUtHardwareInitialize (
17467754Smsmith    void);
17567754Smsmith
17667754SmsmithACPI_STATUS
17777424SmsmithAcpiUtSubsystemShutdown (
17867754Smsmith    void);
17967754Smsmith
18067754SmsmithACPI_STATUS
18177424SmsmithAcpiUtValidateFadt (
18267754Smsmith    void);
18367754Smsmith
18467754Smsmith/*
18577424Smsmith * UtGlobal - Global data structures and procedures
18667754Smsmith */
18767754Smsmith
18869746Smsmith#ifdef ACPI_DEBUG
18969746Smsmith
19067754SmsmithNATIVE_CHAR *
19177424SmsmithAcpiUtGetMutexName (
19267754Smsmith    UINT32                  MutexId);
19367754Smsmith
19467754SmsmithNATIVE_CHAR *
19577424SmsmithAcpiUtGetTypeName (
19667754Smsmith    UINT32                  Type);
19767754Smsmith
19869746SmsmithNATIVE_CHAR *
19977424SmsmithAcpiUtGetRegionName (
20069746Smsmith    UINT8                   SpaceId);
20169746Smsmith
20269746Smsmith#endif
20369746Smsmith
20469746Smsmith
20582367SmsmithUINT8
20682367SmsmithAcpiUtHexToAsciiChar (
20782367Smsmith    ACPI_INTEGER            Integer,
20882367Smsmith    UINT32                  Position);
20982367Smsmith
21067754SmsmithBOOLEAN
21177424SmsmithAcpiUtValidObjectType (
21267754Smsmith    UINT32                  Type);
21367754Smsmith
21467754SmsmithACPI_OWNER_ID
21577424SmsmithAcpiUtAllocateOwnerId (
21667754Smsmith    UINT32                  IdType);
21767754Smsmith
21867754Smsmith
21967754Smsmith/*
22077424Smsmith * UtClib - Local implementations of C library functions
22167754Smsmith */
22267754Smsmith
22371867Smsmith#ifndef ACPI_USE_SYSTEM_CLIBRARY
22471867Smsmith
22577424SmsmithUINT32
22677424SmsmithAcpiUtStrlen (
22767754Smsmith    const NATIVE_CHAR       *String);
22867754Smsmith
22967754SmsmithNATIVE_CHAR *
23077424SmsmithAcpiUtStrcpy (
23167754Smsmith    NATIVE_CHAR             *DstString,
23267754Smsmith    const NATIVE_CHAR       *SrcString);
23367754Smsmith
23467754SmsmithNATIVE_CHAR *
23577424SmsmithAcpiUtStrncpy (
23667754Smsmith    NATIVE_CHAR             *DstString,
23767754Smsmith    const NATIVE_CHAR       *SrcString,
23867754Smsmith    NATIVE_UINT             Count);
23967754Smsmith
24067754SmsmithUINT32
24177424SmsmithAcpiUtStrncmp (
24267754Smsmith    const NATIVE_CHAR       *String1,
24367754Smsmith    const NATIVE_CHAR       *String2,
24467754Smsmith    NATIVE_UINT             Count);
24567754Smsmith
24667754SmsmithUINT32
24777424SmsmithAcpiUtStrcmp (
24867754Smsmith    const NATIVE_CHAR       *String1,
24967754Smsmith    const NATIVE_CHAR       *String2);
25067754Smsmith
25167754SmsmithNATIVE_CHAR *
25277424SmsmithAcpiUtStrcat (
25367754Smsmith    NATIVE_CHAR             *DstString,
25467754Smsmith    const NATIVE_CHAR       *SrcString);
25567754Smsmith
25667754SmsmithNATIVE_CHAR *
25777424SmsmithAcpiUtStrncat (
25867754Smsmith    NATIVE_CHAR             *DstString,
25967754Smsmith    const NATIVE_CHAR       *SrcString,
26067754Smsmith    NATIVE_UINT             Count);
26167754Smsmith
26267754SmsmithUINT32
26377424SmsmithAcpiUtStrtoul (
26467754Smsmith    const NATIVE_CHAR       *String,
26567754Smsmith    NATIVE_CHAR             **Terminator,
26677424Smsmith    UINT32                  Base);
26767754Smsmith
26867754SmsmithNATIVE_CHAR *
26977424SmsmithAcpiUtStrstr (
27067754Smsmith    NATIVE_CHAR             *String1,
27167754Smsmith    NATIVE_CHAR             *String2);
27267754Smsmith
27367754Smsmithvoid *
27477424SmsmithAcpiUtMemcpy (
27567754Smsmith    void                    *Dest,
27667754Smsmith    const void              *Src,
27767754Smsmith    NATIVE_UINT             Count);
27867754Smsmith
27967754Smsmithvoid *
28077424SmsmithAcpiUtMemset (
28167754Smsmith    void                    *Dest,
28271867Smsmith    NATIVE_UINT             Value,
28367754Smsmith    NATIVE_UINT             Count);
28467754Smsmith
28567754SmsmithUINT32
28677424SmsmithAcpiUtToUpper (
28767754Smsmith    UINT32                  c);
28867754Smsmith
28967754SmsmithUINT32
29077424SmsmithAcpiUtToLower (
29167754Smsmith    UINT32                  c);
29267754Smsmith
29371867Smsmith#endif /* ACPI_USE_SYSTEM_CLIBRARY */
29467754Smsmith
29567754Smsmith/*
29677424Smsmith * UtCopy - Object construction and conversion interfaces
29767754Smsmith */
29867754Smsmith
29967754SmsmithACPI_STATUS
30077424SmsmithAcpiUtBuildSimpleObject(
30167754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
30267754Smsmith    ACPI_OBJECT             *UserObj,
30367754Smsmith    UINT8                   *DataSpace,
30467754Smsmith    UINT32                  *BufferSpaceUsed);
30567754Smsmith
30667754SmsmithACPI_STATUS
30777424SmsmithAcpiUtBuildPackageObject (
30867754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
30967754Smsmith    UINT8                   *Buffer,
31067754Smsmith    UINT32                  *SpaceUsed);
31167754Smsmith
31267754SmsmithACPI_STATUS
31377424SmsmithAcpiUtCopyIobjectToEobject (
31467754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
31567754Smsmith    ACPI_BUFFER             *RetBuffer);
31667754Smsmith
31767754SmsmithACPI_STATUS
31877424SmsmithAcpiUtCopyEsimpleToIsimple(
31967754Smsmith    ACPI_OBJECT             *UserObj,
32067754Smsmith    ACPI_OPERAND_OBJECT     *Obj);
32167754Smsmith
32267754SmsmithACPI_STATUS
32377424SmsmithAcpiUtCopyEobjectToIobject (
32467754Smsmith    ACPI_OBJECT             *Obj,
32567754Smsmith    ACPI_OPERAND_OBJECT     *InternalObj);
32667754Smsmith
32767754SmsmithACPI_STATUS
32877424SmsmithAcpiUtCopyISimpleToIsimple (
32967754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
33067754Smsmith    ACPI_OPERAND_OBJECT     *DestObj);
33167754Smsmith
33267754SmsmithACPI_STATUS
33377424SmsmithAcpiUtCopyIpackageToIpackage (
33467754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
33573561Smsmith    ACPI_OPERAND_OBJECT     *DestObj,
33673561Smsmith    ACPI_WALK_STATE         *WalkState);
33767754Smsmith
33867754Smsmith
33967754Smsmith/*
34077424Smsmith * UtCreate - Object creation
34167754Smsmith */
34267754Smsmith
34367754SmsmithACPI_STATUS
34477424SmsmithAcpiUtUpdateObjectReference (
34567754Smsmith    ACPI_OPERAND_OBJECT     *Object,
34667754Smsmith    UINT16                  Action);
34767754Smsmith
34867754SmsmithACPI_OPERAND_OBJECT  *
34977424Smsmith_UtCreateInternalObject (
35067754Smsmith    NATIVE_CHAR             *ModuleName,
35167754Smsmith    UINT32                  LineNumber,
35267754Smsmith    UINT32                  ComponentId,
35377424Smsmith    ACPI_OBJECT_TYPE8       Type);
35467754Smsmith
35567754Smsmith
35667754Smsmith/*
35777424Smsmith * UtDebug - Debug interfaces
35867754Smsmith */
35967754Smsmith
36067754SmsmithUINT32
36167754SmsmithGetDebugLevel (
36267754Smsmith    void);
36367754Smsmith
36467754Smsmithvoid
36567754SmsmithSetDebugLevel (
36667754Smsmith    UINT32                  level);
36767754Smsmith
36867754Smsmithvoid
36967754SmsmithFunctionTrace (
37067754Smsmith    NATIVE_CHAR             *ModuleName,
37167754Smsmith    UINT32                  LineNumber,
37267754Smsmith    UINT32                  ComponentId,
37367754Smsmith    NATIVE_CHAR             *FunctionName);
37467754Smsmith
37567754Smsmithvoid
37667754SmsmithFunctionTracePtr (
37767754Smsmith    NATIVE_CHAR             *ModuleName,
37867754Smsmith    UINT32                  LineNumber,
37967754Smsmith    UINT32                  ComponentId,
38067754Smsmith    NATIVE_CHAR             *FunctionName,
38167754Smsmith    void                    *Pointer);
38267754Smsmith
38367754Smsmithvoid
38467754SmsmithFunctionTraceU32 (
38567754Smsmith    NATIVE_CHAR             *ModuleName,
38667754Smsmith    UINT32                  LineNumber,
38767754Smsmith    UINT32                  ComponentId,
38867754Smsmith    NATIVE_CHAR             *FunctionName,
38967754Smsmith    UINT32                  Integer);
39067754Smsmith
39167754Smsmithvoid
39267754SmsmithFunctionTraceStr (
39367754Smsmith    NATIVE_CHAR             *ModuleName,
39467754Smsmith    UINT32                  LineNumber,
39567754Smsmith    UINT32                  ComponentId,
39667754Smsmith    NATIVE_CHAR             *FunctionName,
39767754Smsmith    NATIVE_CHAR             *String);
39867754Smsmith
39967754Smsmithvoid
40067754SmsmithFunctionExit (
40167754Smsmith    NATIVE_CHAR             *ModuleName,
40267754Smsmith    UINT32                  LineNumber,
40367754Smsmith    UINT32                  ComponentId,
40467754Smsmith    NATIVE_CHAR             *FunctionName);
40567754Smsmith
40667754Smsmithvoid
40767754SmsmithFunctionStatusExit (
40867754Smsmith    NATIVE_CHAR             *ModuleName,
40967754Smsmith    UINT32                  LineNumber,
41067754Smsmith    UINT32                  ComponentId,
41167754Smsmith    NATIVE_CHAR             *FunctionName,
41267754Smsmith    ACPI_STATUS             Status);
41367754Smsmith
41467754Smsmithvoid
41567754SmsmithFunctionValueExit (
41667754Smsmith    NATIVE_CHAR             *ModuleName,
41767754Smsmith    UINT32                  LineNumber,
41867754Smsmith    UINT32                  ComponentId,
41967754Smsmith    NATIVE_CHAR             *FunctionName,
42071867Smsmith    ACPI_INTEGER            Value);
42167754Smsmith
42267754Smsmithvoid
42367754SmsmithFunctionPtrExit (
42467754Smsmith    NATIVE_CHAR             *ModuleName,
42567754Smsmith    UINT32                  LineNumber,
42667754Smsmith    UINT32                  ComponentId,
42767754Smsmith    NATIVE_CHAR             *FunctionName,
42867754Smsmith    UINT8                   *Ptr);
42967754Smsmith
43067754Smsmithvoid
43167754Smsmith_ReportInfo (
43267754Smsmith    NATIVE_CHAR             *ModuleName,
43367754Smsmith    UINT32                  LineNumber,
43467754Smsmith    UINT32                  ComponentId);
43567754Smsmith
43667754Smsmithvoid
43767754Smsmith_ReportError (
43867754Smsmith    NATIVE_CHAR             *ModuleName,
43967754Smsmith    UINT32                  LineNumber,
44067754Smsmith    UINT32                  ComponentId);
44167754Smsmith
44267754Smsmithvoid
44367754Smsmith_ReportWarning (
44467754Smsmith    NATIVE_CHAR             *ModuleName,
44567754Smsmith    UINT32                  LineNumber,
44667754Smsmith    UINT32                  ComponentId);
44767754Smsmith
44867754Smsmithvoid
44977424SmsmithAcpiUtDumpBuffer (
45067754Smsmith    UINT8                   *Buffer,
45167754Smsmith    UINT32                  Count,
45267754Smsmith    UINT32                  Display,
45367754Smsmith    UINT32                  componentId);
45467754Smsmith
45582367Smsmithvoid
45682367SmsmithAcpiUtDebugPrint (
45782367Smsmith    UINT32                  RequestedDebugLevel,
45882367Smsmith    UINT32                  ComponentId,
45982367Smsmith    NATIVE_CHAR             *ModuleName,
46082367Smsmith    NATIVE_CHAR             *ProcName,
46182367Smsmith    UINT32                  LineNumber,
46282367Smsmith    char                    *Format,
46382367Smsmith    ...);
46467754Smsmith
46582367Smsmithvoid
46682367SmsmithAcpiUtDebugPrintRaw (
46782367Smsmith    UINT32                  RequestedDebugLevel,
46882367Smsmith    UINT32                  ComponentId,
46982367Smsmith    NATIVE_CHAR             *ModuleName,
47082367Smsmith    NATIVE_CHAR             *ProcName,
47182367Smsmith    UINT32                  LineNumber,
47282367Smsmith    char                    *Format,
47382367Smsmith    ...);
47482367Smsmith
47567754Smsmith/*
47677424Smsmith * UtDelete - Object deletion
47767754Smsmith */
47867754Smsmith
47967754Smsmithvoid
48077424SmsmithAcpiUtDeleteInternalObj (
48167754Smsmith    ACPI_OPERAND_OBJECT     *Object);
48267754Smsmith
48367754Smsmithvoid
48477424SmsmithAcpiUtDeleteInternalPackageObject (
48567754Smsmith    ACPI_OPERAND_OBJECT     *Object);
48667754Smsmith
48767754Smsmithvoid
48877424SmsmithAcpiUtDeleteInternalSimpleObject (
48967754Smsmith    ACPI_OPERAND_OBJECT     *Object);
49067754Smsmith
49167754SmsmithACPI_STATUS
49277424SmsmithAcpiUtDeleteInternalObjectList (
49367754Smsmith    ACPI_OPERAND_OBJECT     **ObjList);
49467754Smsmith
49567754Smsmith
49667754Smsmith/*
49777424Smsmith * UtEval - object evaluation
49867754Smsmith */
49967754Smsmith
50067754Smsmith/* Method name strings */
50167754Smsmith
50267754Smsmith#define METHOD_NAME__HID        "_HID"
50367754Smsmith#define METHOD_NAME__UID        "_UID"
50467754Smsmith#define METHOD_NAME__ADR        "_ADR"
50567754Smsmith#define METHOD_NAME__STA        "_STA"
50667754Smsmith#define METHOD_NAME__REG        "_REG"
50767754Smsmith#define METHOD_NAME__SEG        "_SEG"
50867754Smsmith#define METHOD_NAME__BBN        "_BBN"
50967754Smsmith
51067754Smsmith
51167754SmsmithACPI_STATUS
51277424SmsmithAcpiUtEvaluateNumericObject (
51367754Smsmith    NATIVE_CHAR             *ObjectName,
51467754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
51567754Smsmith    ACPI_INTEGER            *Address);
51667754Smsmith
51767754SmsmithACPI_STATUS
51877424SmsmithAcpiUtExecute_HID (
51967754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
52077424Smsmith    ACPI_DEVICE_ID          *Hid);
52167754Smsmith
52267754SmsmithACPI_STATUS
52377424SmsmithAcpiUtExecute_STA (
52467754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
52567754Smsmith    UINT32                  *StatusFlags);
52667754Smsmith
52767754SmsmithACPI_STATUS
52877424SmsmithAcpiUtExecute_UID (
52967754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
53077424Smsmith    ACPI_DEVICE_ID          *Uid);
53167754Smsmith
53267754Smsmith
53367754Smsmith/*
53477424Smsmith * UtMutex - mutual exclusion interfaces
53567754Smsmith */
53667754Smsmith
53767754SmsmithACPI_STATUS
53877424SmsmithAcpiUtMutexInitialize (
53967754Smsmith    void);
54067754Smsmith
54167754Smsmithvoid
54277424SmsmithAcpiUtMutexTerminate (
54367754Smsmith    void);
54467754Smsmith
54567754SmsmithACPI_STATUS
54677424SmsmithAcpiUtCreateMutex (
54767754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
54867754Smsmith
54967754SmsmithACPI_STATUS
55077424SmsmithAcpiUtDeleteMutex (
55167754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
55267754Smsmith
55367754SmsmithACPI_STATUS
55477424SmsmithAcpiUtAcquireMutex (
55567754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
55667754Smsmith
55767754SmsmithACPI_STATUS
55877424SmsmithAcpiUtReleaseMutex (
55967754Smsmith    ACPI_MUTEX_HANDLE       MutexId);
56067754Smsmith
56167754Smsmith
56267754Smsmith/*
56377424Smsmith * UtObject - internal object create/delete/cache routines
56467754Smsmith */
56567754Smsmith
56667754Smsmithvoid *
56777424Smsmith_UtAllocateObjectDesc (
56867754Smsmith    NATIVE_CHAR             *ModuleName,
56967754Smsmith    UINT32                  LineNumber,
57067754Smsmith    UINT32                  ComponentId);
57167754Smsmith
57277424Smsmith#define AcpiUtCreateInternalObject(t)   _UtCreateInternalObject(_THIS_MODULE,__LINE__,_COMPONENT,t)
57377424Smsmith#define AcpiUtAllocateObjectDesc()      _UtAllocateObjectDesc(_THIS_MODULE,__LINE__,_COMPONENT)
57467754Smsmith
57567754Smsmithvoid
57677424SmsmithAcpiUtDeleteObjectDesc (
57767754Smsmith    ACPI_OPERAND_OBJECT     *Object);
57867754Smsmith
57967754SmsmithBOOLEAN
58077424SmsmithAcpiUtValidInternalObject (
58167754Smsmith    void                    *Object);
58267754Smsmith
58367754Smsmith
58467754Smsmith/*
58577424Smsmith * UtRefCnt - Object reference count management
58667754Smsmith */
58767754Smsmith
58867754Smsmithvoid
58977424SmsmithAcpiUtAddReference (
59067754Smsmith    ACPI_OPERAND_OBJECT     *Object);
59167754Smsmith
59267754Smsmithvoid
59377424SmsmithAcpiUtRemoveReference (
59467754Smsmith    ACPI_OPERAND_OBJECT     *Object);
59567754Smsmith
59667754Smsmith/*
59777424Smsmith * UtSize - Object size routines
59867754Smsmith */
59967754Smsmith
60067754SmsmithACPI_STATUS
60177424SmsmithAcpiUtGetSimpleObjectSize (
60267754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
60367754Smsmith    UINT32                  *ObjLength);
60467754Smsmith
60567754SmsmithACPI_STATUS
60677424SmsmithAcpiUtGetPackageObjectSize (
60767754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
60867754Smsmith    UINT32                  *ObjLength);
60967754Smsmith
61067754SmsmithACPI_STATUS
61177424SmsmithAcpiUtGetObjectSize(
61267754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
61367754Smsmith    UINT32                  *ObjLength);
61467754Smsmith
61567754Smsmith
61667754Smsmith/*
61777424Smsmith * UtState - Generic state creation/cache routines
61867754Smsmith */
61967754Smsmith
62067754Smsmithvoid
62177424SmsmithAcpiUtPushGenericState (
62267754Smsmith    ACPI_GENERIC_STATE      **ListHead,
62367754Smsmith    ACPI_GENERIC_STATE      *State);
62467754Smsmith
62567754SmsmithACPI_GENERIC_STATE *
62677424SmsmithAcpiUtPopGenericState (
62767754Smsmith    ACPI_GENERIC_STATE      **ListHead);
62867754Smsmith
62967754Smsmith
63067754SmsmithACPI_GENERIC_STATE *
63177424SmsmithAcpiUtCreateGenericState (
63267754Smsmith    void);
63367754Smsmith
63467754SmsmithACPI_GENERIC_STATE *
63577424SmsmithAcpiUtCreateUpdateState (
63667754Smsmith    ACPI_OPERAND_OBJECT     *Object,
63767754Smsmith    UINT16                  Action);
63867754Smsmith
63973561SmsmithACPI_GENERIC_STATE *
64077424SmsmithAcpiUtCreatePkgState (
64173561Smsmith    void                    *InternalObject,
64273561Smsmith    void                    *ExternalObject,
64373561Smsmith    UINT16                  Index);
64473561Smsmith
64567754SmsmithACPI_STATUS
64677424SmsmithAcpiUtCreateUpdateStateAndPush (
64767754Smsmith    ACPI_OPERAND_OBJECT     *Object,
64867754Smsmith    UINT16                  Action,
64967754Smsmith    ACPI_GENERIC_STATE      **StateList);
65067754Smsmith
65173561SmsmithACPI_STATUS
65277424SmsmithAcpiUtCreatePkgStateAndPush (
65373561Smsmith    void                    *InternalObject,
65473561Smsmith    void                    *ExternalObject,
65573561Smsmith    UINT16                  Index,
65673561Smsmith    ACPI_GENERIC_STATE      **StateList);
65773561Smsmith
65867754SmsmithACPI_GENERIC_STATE *
65977424SmsmithAcpiUtCreateControlState (
66067754Smsmith    void);
66167754Smsmith
66267754Smsmithvoid
66377424SmsmithAcpiUtDeleteGenericState (
66467754Smsmith    ACPI_GENERIC_STATE      *State);
66567754Smsmith
66667754Smsmithvoid
66777424SmsmithAcpiUtDeleteGenericStateCache (
66867754Smsmith    void);
66967754Smsmith
67067754Smsmithvoid
67177424SmsmithAcpiUtDeleteObjectCache (
67267754Smsmith    void);
67367754Smsmith
67467754Smsmith/*
67577424Smsmith * Ututils
67667754Smsmith */
67767754Smsmith
67867754SmsmithBOOLEAN
67977424SmsmithAcpiUtValidAcpiName (
68067754Smsmith    UINT32                  Name);
68167754Smsmith
68267754SmsmithBOOLEAN
68377424SmsmithAcpiUtValidAcpiCharacter (
68467754Smsmith    NATIVE_CHAR             Character);
68567754Smsmith
68677424SmsmithNATIVE_CHAR *
68777424SmsmithAcpiUtStrupr (
68877424Smsmith    NATIVE_CHAR             *SrcString);
68977424Smsmith
69067754SmsmithACPI_STATUS
69177424SmsmithAcpiUtResolvePackageReferences (
69267754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc);
69367754Smsmith
69477424Smsmith
69573561Smsmith#ifdef ACPI_DEBUG
69673561Smsmithvoid
69777424SmsmithAcpiUtDisplayInitPathname (
69873561Smsmith    ACPI_HANDLE             ObjHandle,
69973561Smsmith    char                    *Path);
70073561Smsmith
70173561Smsmith#endif
70273561Smsmith
70373561Smsmith
70467754Smsmith/*
70582367Smsmith * Utalloc - memory allocation and object caching
70667754Smsmith */
70767754Smsmith
70867754Smsmithvoid *
70982367SmsmithAcpiUtAcquireFromCache (
71082367Smsmith    UINT32                  ListId);
71182367Smsmith
71282367Smsmithvoid
71382367SmsmithAcpiUtReleaseToCache (
71482367Smsmith    UINT32                  ListId,
71582367Smsmith    void                    *Object);
71682367Smsmith
71782367Smsmithvoid
71882367SmsmithAcpiUtDeleteGenericCache (
71982367Smsmith    UINT32                  ListId);
72082367Smsmith
72182367Smsmith
72282367Smsmith/* Debug Memory allocation functions */
72382367Smsmith
72482367Smsmithvoid *
72580062SmsmithAcpiUtAllocate (
72667754Smsmith    UINT32                  Size,
72767754Smsmith    UINT32                  Component,
72867754Smsmith    NATIVE_CHAR             *Module,
72967754Smsmith    UINT32                  Line);
73067754Smsmith
73167754Smsmithvoid *
73280062SmsmithAcpiUtCallocate (
73367754Smsmith    UINT32                  Size,
73467754Smsmith    UINT32                  Component,
73567754Smsmith    NATIVE_CHAR             *Module,
73667754Smsmith    UINT32                  Line);
73767754Smsmith
73867754Smsmithvoid
73980062SmsmithAcpiUtFree (
74067754Smsmith    void                    *Address,
74167754Smsmith    UINT32                  Component,
74267754Smsmith    NATIVE_CHAR             *Module,
74367754Smsmith    UINT32                  Line);
74467754Smsmith
74567754Smsmithvoid
74677424SmsmithAcpiUtInitStaticObject (
74767754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc);
74867754Smsmith
74967754Smsmith
75080062Smsmith#ifdef ACPI_DBG_TRACK_ALLOCATIONS
75167754Smsmithvoid
75277424SmsmithAcpiUtDumpAllocationInfo (
75367754Smsmith    void);
75467754Smsmith
75567754Smsmithvoid
75677424SmsmithAcpiUtDumpCurrentAllocations (
75767754Smsmith    UINT32                  Component,
75867754Smsmith    NATIVE_CHAR             *Module);
75967754Smsmith#endif
76067754Smsmith
76167754Smsmith
76277424Smsmith
76377424Smsmith#endif /* _ACUTILS_H */
764