acutils.h revision 322877
167754Smsmith/******************************************************************************
267754Smsmith *
377424Smsmith * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
467754Smsmith *
567754Smsmith *****************************************************************************/
667754Smsmith
7316303Sjkim/******************************************************************************
8316303Sjkim *
9316303Sjkim * 1. Copyright Notice
10316303Sjkim *
11316303Sjkim * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
1270243Smsmith * All rights reserved.
1367754Smsmith *
14316303Sjkim * 2. License
15316303Sjkim *
16316303Sjkim * 2.1. This is your license from Intel Corp. under its intellectual property
17316303Sjkim * rights. You may have additional license terms from the party that provided
18316303Sjkim * you this software, covering your right to use that party's intellectual
19316303Sjkim * property rights.
20316303Sjkim *
21316303Sjkim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22316303Sjkim * copy of the source code appearing in this file ("Covered Code") an
23316303Sjkim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24316303Sjkim * base code distributed originally by Intel ("Original Intel Code") to copy,
25316303Sjkim * make derivatives, distribute, use and display any portion of the Covered
26316303Sjkim * Code in any form, with the right to sublicense such rights; and
27316303Sjkim *
28316303Sjkim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29316303Sjkim * license (with the right to sublicense), under only those claims of Intel
30316303Sjkim * patents that are infringed by the Original Intel Code, to make, use, sell,
31316303Sjkim * offer to sell, and import the Covered Code and derivative works thereof
32316303Sjkim * solely to the minimum extent necessary to exercise the above copyright
33316303Sjkim * license, and in no event shall the patent license extend to any additions
34316303Sjkim * to or modifications of the Original Intel Code. No other license or right
35316303Sjkim * is granted directly or by implication, estoppel or otherwise;
36316303Sjkim *
37316303Sjkim * The above copyright and patent license is granted only if the following
38316303Sjkim * conditions are met:
39316303Sjkim *
40316303Sjkim * 3. Conditions
41316303Sjkim *
42316303Sjkim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43316303Sjkim * Redistribution of source code of any substantial portion of the Covered
44316303Sjkim * Code or modification with rights to further distribute source must include
45316303Sjkim * the above Copyright Notice, the above License, this list of Conditions,
46316303Sjkim * and the following Disclaimer and Export Compliance provision. In addition,
47316303Sjkim * Licensee must cause all Covered Code to which Licensee contributes to
48316303Sjkim * contain a file documenting the changes Licensee made to create that Covered
49316303Sjkim * Code and the date of any change. Licensee must include in that file the
50316303Sjkim * documentation of any changes made by any predecessor Licensee. Licensee
51316303Sjkim * must include a prominent statement that the modification is derived,
52316303Sjkim * directly or indirectly, from Original Intel Code.
53316303Sjkim *
54316303Sjkim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55316303Sjkim * Redistribution of source code of any substantial portion of the Covered
56316303Sjkim * Code or modification without rights to further distribute source must
57316303Sjkim * include the following Disclaimer and Export Compliance provision in the
58316303Sjkim * documentation and/or other materials provided with distribution. In
59316303Sjkim * addition, Licensee may not authorize further sublicense of source of any
60316303Sjkim * portion of the Covered Code, and must include terms to the effect that the
61316303Sjkim * license from Licensee to its licensee is limited to the intellectual
62316303Sjkim * property embodied in the software Licensee provides to its licensee, and
63316303Sjkim * not to intellectual property embodied in modifications its licensee may
64316303Sjkim * make.
65316303Sjkim *
66316303Sjkim * 3.3. Redistribution of Executable. Redistribution in executable form of any
67316303Sjkim * substantial portion of the Covered Code or modification must reproduce the
68316303Sjkim * above Copyright Notice, and the following Disclaimer and Export Compliance
69316303Sjkim * provision in the documentation and/or other materials provided with the
70316303Sjkim * distribution.
71316303Sjkim *
72316303Sjkim * 3.4. Intel retains all right, title, and interest in and to the Original
73316303Sjkim * Intel Code.
74316303Sjkim *
75316303Sjkim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76316303Sjkim * Intel shall be used in advertising or otherwise to promote the sale, use or
77316303Sjkim * other dealings in products derived from or relating to the Covered Code
78316303Sjkim * without prior written authorization from Intel.
79316303Sjkim *
80316303Sjkim * 4. Disclaimer and Export Compliance
81316303Sjkim *
82316303Sjkim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83316303Sjkim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84316303Sjkim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85316303Sjkim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86316303Sjkim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87316303Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88316303Sjkim * PARTICULAR PURPOSE.
89316303Sjkim *
90316303Sjkim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91316303Sjkim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92316303Sjkim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93316303Sjkim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94316303Sjkim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95316303Sjkim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96316303Sjkim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97316303Sjkim * LIMITED REMEDY.
98316303Sjkim *
99316303Sjkim * 4.3. Licensee shall not export, either directly or indirectly, any of this
100316303Sjkim * software or system incorporating such software without first obtaining any
101316303Sjkim * required license or other approval from the U. S. Department of Commerce or
102316303Sjkim * any other agency or department of the United States Government. In the
103316303Sjkim * event Licensee exports any such software from the United States or
104316303Sjkim * re-exports any such software from a foreign destination, Licensee shall
105316303Sjkim * ensure that the distribution and export/re-export of the software is in
106316303Sjkim * compliance with all laws, regulations, orders, or other restrictions of the
107316303Sjkim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108316303Sjkim * any of its subsidiaries will export/re-export any technical data, process,
109316303Sjkim * software, or service, directly or indirectly, to any country for which the
110316303Sjkim * United States government or any agency thereof requires an export license,
111316303Sjkim * other governmental approval, or letter of assurance, without first obtaining
112316303Sjkim * such license, approval or letter.
113316303Sjkim *
114316303Sjkim *****************************************************************************
115316303Sjkim *
116316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
117316303Sjkim * following license:
118316303Sjkim *
119217365Sjkim * Redistribution and use in source and binary forms, with or without
120217365Sjkim * modification, are permitted provided that the following conditions
121217365Sjkim * are met:
122217365Sjkim * 1. Redistributions of source code must retain the above copyright
123217365Sjkim *    notice, this list of conditions, and the following disclaimer,
124217365Sjkim *    without modification.
125217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126217365Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
127217365Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
128217365Sjkim *    including a substantially similar Disclaimer requirement for further
129217365Sjkim *    binary redistribution.
130217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
131217365Sjkim *    of any contributors may be used to endorse or promote products derived
132217365Sjkim *    from this software without specific prior written permission.
13367754Smsmith *
134316303Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135316303Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136316303Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137316303Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138316303Sjkim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139316303Sjkim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140316303Sjkim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141316303Sjkim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142316303Sjkim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143316303Sjkim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144316303Sjkim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145316303Sjkim *
146316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
147217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
148217365Sjkim * Software Foundation.
14967754Smsmith *
150316303Sjkim *****************************************************************************/
15167754Smsmith
15277424Smsmith#ifndef _ACUTILS_H
15377424Smsmith#define _ACUTILS_H
15467754Smsmith
15567754Smsmith
156167802Sjkimextern const UINT8                      AcpiGbl_ResourceAmlSizes[];
157228110Sjkimextern const UINT8                      AcpiGbl_ResourceAmlSerialBusSizes[];
158167802Sjkim
159167802Sjkim/* Strings used by the disassembler and debugger resource dump routines */
160167802Sjkim
161272444Sjkim#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
162167802Sjkim
163167802Sjkimextern const char                       *AcpiGbl_BmDecode[];
164167802Sjkimextern const char                       *AcpiGbl_ConfigDecode[];
165167802Sjkimextern const char                       *AcpiGbl_ConsumeDecode[];
166167802Sjkimextern const char                       *AcpiGbl_DecDecode[];
167167802Sjkimextern const char                       *AcpiGbl_HeDecode[];
168167802Sjkimextern const char                       *AcpiGbl_IoDecode[];
169167802Sjkimextern const char                       *AcpiGbl_LlDecode[];
170167802Sjkimextern const char                       *AcpiGbl_MaxDecode[];
171167802Sjkimextern const char                       *AcpiGbl_MemDecode[];
172167802Sjkimextern const char                       *AcpiGbl_MinDecode[];
173167802Sjkimextern const char                       *AcpiGbl_MtpDecode[];
174167802Sjkimextern const char                       *AcpiGbl_RngDecode[];
175167802Sjkimextern const char                       *AcpiGbl_RwDecode[];
176167802Sjkimextern const char                       *AcpiGbl_ShrDecode[];
177167802Sjkimextern const char                       *AcpiGbl_SizDecode[];
178167802Sjkimextern const char                       *AcpiGbl_TrsDecode[];
179167802Sjkimextern const char                       *AcpiGbl_TtpDecode[];
180167802Sjkimextern const char                       *AcpiGbl_TypDecode[];
181228110Sjkimextern const char                       *AcpiGbl_PpcDecode[];
182228110Sjkimextern const char                       *AcpiGbl_IorDecode[];
183228110Sjkimextern const char                       *AcpiGbl_DtsDecode[];
184228110Sjkimextern const char                       *AcpiGbl_CtDecode[];
185228110Sjkimextern const char                       *AcpiGbl_SbtDecode[];
186228110Sjkimextern const char                       *AcpiGbl_AmDecode[];
187228110Sjkimextern const char                       *AcpiGbl_SmDecode[];
188228110Sjkimextern const char                       *AcpiGbl_WmDecode[];
189228110Sjkimextern const char                       *AcpiGbl_CphDecode[];
190228110Sjkimextern const char                       *AcpiGbl_CpoDecode[];
191228110Sjkimextern const char                       *AcpiGbl_DpDecode[];
192228110Sjkimextern const char                       *AcpiGbl_EdDecode[];
193228110Sjkimextern const char                       *AcpiGbl_BpbDecode[];
194228110Sjkimextern const char                       *AcpiGbl_SbDecode[];
195228110Sjkimextern const char                       *AcpiGbl_FcDecode[];
196228110Sjkimextern const char                       *AcpiGbl_PtDecode[];
197322877Sjkimextern const char                       *AcpiGbl_PtypDecode[];
198167802Sjkim#endif
199167802Sjkim
200250838Sjkim/*
201250838Sjkim * For the iASL compiler case, the output is redirected to stderr so that
202250838Sjkim * any of the various ACPI errors and warnings do not appear in the output
203250838Sjkim * files, for either the compiler or disassembler portions of the tool.
204250838Sjkim */
205250838Sjkim#ifdef ACPI_ASL_COMPILER
206250838Sjkim
207250838Sjkim#include <stdio.h>
208250838Sjkim
209250838Sjkim#define ACPI_MSG_REDIRECT_BEGIN \
210250838Sjkim    FILE                    *OutputFile = AcpiGbl_OutputFile; \
211250838Sjkim    AcpiOsRedirectOutput (stderr);
212250838Sjkim
213250838Sjkim#define ACPI_MSG_REDIRECT_END \
214250838Sjkim    AcpiOsRedirectOutput (OutputFile);
215250838Sjkim
216250838Sjkim#else
217250838Sjkim/*
218250838Sjkim * non-iASL case - no redirection, nothing to do
219250838Sjkim */
220250838Sjkim#define ACPI_MSG_REDIRECT_BEGIN
221250838Sjkim#define ACPI_MSG_REDIRECT_END
222250838Sjkim#endif
223250838Sjkim
224250838Sjkim/*
225250838Sjkim * Common error message prefixes
226250838Sjkim */
227300879Sjkim#ifndef ACPI_MSG_ERROR
228250838Sjkim#define ACPI_MSG_ERROR          "ACPI Error: "
229300879Sjkim#endif
230300879Sjkim#ifndef ACPI_MSG_EXCEPTION
231250838Sjkim#define ACPI_MSG_EXCEPTION      "ACPI Exception: "
232300879Sjkim#endif
233300879Sjkim#ifndef ACPI_MSG_WARNING
234250838Sjkim#define ACPI_MSG_WARNING        "ACPI Warning: "
235300879Sjkim#endif
236300879Sjkim#ifndef ACPI_MSG_INFO
237250838Sjkim#define ACPI_MSG_INFO           "ACPI: "
238300879Sjkim#endif
239250838Sjkim
240300879Sjkim#ifndef ACPI_MSG_BIOS_ERROR
241250838Sjkim#define ACPI_MSG_BIOS_ERROR     "ACPI BIOS Error (bug): "
242300879Sjkim#endif
243300879Sjkim#ifndef ACPI_MSG_BIOS_WARNING
244250838Sjkim#define ACPI_MSG_BIOS_WARNING   "ACPI BIOS Warning (bug): "
245300879Sjkim#endif
246250838Sjkim
247250838Sjkim/*
248250838Sjkim * Common message suffix
249250838Sjkim */
250250838Sjkim#define ACPI_MSG_SUFFIX \
251250838Sjkim    AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
252250838Sjkim
253250838Sjkim
254167802Sjkim/* Types for Resource descriptor entries */
255167802Sjkim
256167802Sjkim#define ACPI_INVALID_RESOURCE           0
257167802Sjkim#define ACPI_FIXED_LENGTH               1
258167802Sjkim#define ACPI_VARIABLE_LENGTH            2
259167802Sjkim#define ACPI_SMALL_VARIABLE_LENGTH      3
260167802Sjkim
26173561Smsmithtypedef
262167802SjkimACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
263167802Sjkim    UINT8                   *Aml,
264167802Sjkim    UINT32                  Length,
265167802Sjkim    UINT32                  Offset,
266167802Sjkim    UINT8                   ResourceIndex,
267245582Sjkim    void                    **Context);
268167802Sjkim
269167802Sjkimtypedef
27073561SmsmithACPI_STATUS (*ACPI_PKG_CALLBACK) (
27173561Smsmith    UINT8                   ObjectType,
27273561Smsmith    ACPI_OPERAND_OBJECT     *SourceObject,
27373561Smsmith    ACPI_GENERIC_STATE      *State,
27473561Smsmith    void                    *Context);
27573561Smsmith
27673561Smsmithtypedef struct acpi_pkg_info
27773561Smsmith{
27873561Smsmith    UINT8                   *FreeSpace;
27991116Smsmith    ACPI_SIZE               Length;
28073561Smsmith    UINT32                  ObjectSpace;
28173561Smsmith    UINT32                  NumPackages;
282114237Snjl
28373561Smsmith} ACPI_PKG_INFO;
28473561Smsmith
285249112Sjkim/* Object reference counts */
286249112Sjkim
28767754Smsmith#define REF_INCREMENT       (UINT16) 0
28867754Smsmith#define REF_DECREMENT       (UINT16) 1
28967754Smsmith
29077424Smsmith/* AcpiUtDumpBuffer */
29167754Smsmith
29267754Smsmith#define DB_BYTE_DISPLAY     1
29367754Smsmith#define DB_WORD_DISPLAY     2
29467754Smsmith#define DB_DWORD_DISPLAY    4
29567754Smsmith#define DB_QWORD_DISPLAY    8
29667754Smsmith
297285797Sjkim
29867754Smsmith/*
299298714Sjkim * utascii - ASCII utilities
300298714Sjkim */
301298714SjkimBOOLEAN
302298714SjkimAcpiUtValidNameseg (
303298714Sjkim    char                    *Signature);
304298714Sjkim
305298714SjkimBOOLEAN
306298714SjkimAcpiUtValidNameChar (
307298714Sjkim    char                    Character,
308298714Sjkim    UINT32                  Position);
309298714Sjkim
310298714Sjkimvoid
311298714SjkimAcpiUtCheckAndRepairAscii (
312298714Sjkim    UINT8                   *Name,
313298714Sjkim    char                    *RepairedName,
314298714Sjkim    UINT32                  Count);
315298714Sjkim
316298714Sjkim
317298714Sjkim/*
318285797Sjkim * utnonansi - Non-ANSI C library functions
319285797Sjkim */
320285797Sjkimvoid
321285797SjkimAcpiUtStrupr (
322285797Sjkim    char                    *SrcString);
323285797Sjkim
324285797Sjkimvoid
325285797SjkimAcpiUtStrlwr (
326285797Sjkim    char                    *SrcString);
327285797Sjkim
328285797Sjkimint
329285797SjkimAcpiUtStricmp (
330285797Sjkim    char                    *String1,
331285797Sjkim    char                    *String2);
332285797Sjkim
333285797SjkimACPI_STATUS
334285797SjkimAcpiUtStrtoul64 (
335285797Sjkim    char                    *String,
336316303Sjkim    UINT32                  Flags,
337285797Sjkim    UINT64                  *RetInteger);
338285797Sjkim
339316303Sjkim/*
340316303Sjkim * Values for Flags above
341316303Sjkim * Note: LIMIT values correspond to AcpiGbl_IntegerByteWidth values (4/8)
342316303Sjkim */
343316303Sjkim#define ACPI_STRTOUL_32BIT          0x04    /* 4 bytes */
344316303Sjkim#define ACPI_STRTOUL_64BIT          0x08    /* 8 bytes */
345316303Sjkim#define ACPI_STRTOUL_BASE16         0x10    /* Default: Base10/16 */
346285797Sjkim
347298714Sjkim
348285797Sjkim/*
349151937Sjkim * utglobal - Global data structures and procedures
35067754Smsmith */
351193267SjkimACPI_STATUS
352151937SjkimAcpiUtInitGlobals (
35367754Smsmith    void);
35467754Smsmith
355102550Siwasaki#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
35669746Smsmith
357298714Sjkimconst char *
35877424SmsmithAcpiUtGetMutexName (
35967754Smsmith    UINT32                  MutexId);
36067754Smsmith
361193267Sjkimconst char *
362193267SjkimAcpiUtGetNotifyName (
363272444Sjkim    UINT32                  NotifyValue,
364272444Sjkim    ACPI_OBJECT_TYPE        Type);
365100966Siwasaki#endif
366100966Siwasaki
367298714Sjkimconst char *
36877424SmsmithAcpiUtGetTypeName (
36991116Smsmith    ACPI_OBJECT_TYPE        Type);
37067754Smsmith
371298714Sjkimconst char *
372123315SnjlAcpiUtGetNodeName (
373123315Snjl    void                    *Object);
374123315Snjl
375298714Sjkimconst char *
376123315SnjlAcpiUtGetDescriptorName (
377123315Snjl    void                    *Object);
378123315Snjl
379193267Sjkimconst char *
380193267SjkimAcpiUtGetReferenceName (
381193267Sjkim    ACPI_OPERAND_OBJECT     *Object);
382193267Sjkim
383298714Sjkimconst char *
38499679SiwasakiAcpiUtGetObjectTypeName (
38599679Siwasaki    ACPI_OPERAND_OBJECT     *ObjDesc);
38699679Siwasaki
387298714Sjkimconst char *
38877424SmsmithAcpiUtGetRegionName (
38969746Smsmith    UINT8                   SpaceId);
39069746Smsmith
391298714Sjkimconst char *
39291116SmsmithAcpiUtGetEventName (
39391116Smsmith    UINT32                  EventId);
39469746Smsmith
395316303Sjkimconst char *
396316303SjkimAcpiUtGetArgumentTypeName (
397316303Sjkim    UINT32                  ArgType);
398316303Sjkim
39999679Siwasakichar
40082367SmsmithAcpiUtHexToAsciiChar (
401202771Sjkim    UINT64                  Integer,
40282367Smsmith    UINT32                  Position);
40382367Smsmith
404316303SjkimACPI_STATUS
405316303SjkimAcpiUtAsciiToHexByte (
406316303Sjkim    char                    *TwoAsciiChars,
407316303Sjkim    UINT8                   *ReturnByte);
408316303Sjkim
409272444SjkimUINT8
410272444SjkimAcpiUtAsciiCharToHex (
411272444Sjkim    int                     HexChar);
412272444Sjkim
41367754SmsmithBOOLEAN
41477424SmsmithAcpiUtValidObjectType (
41591116Smsmith    ACPI_OBJECT_TYPE        Type);
41667754Smsmith
41767754Smsmith
418151937Sjkim/*
419151937Sjkim * utinit - miscellaneous initialization and shutdown
420151937Sjkim */
421151937SjkimACPI_STATUS
422151937SjkimAcpiUtHardwareInitialize (
423151937Sjkim    void);
42467754Smsmith
425151937Sjkimvoid
426151937SjkimAcpiUtSubsystemShutdown (
427151937Sjkim    void);
428151937Sjkim
429151937Sjkim
43067754Smsmith/*
431151937Sjkim * utcopy - Object construction and conversion interfaces
43267754Smsmith */
43367754SmsmithACPI_STATUS
43477424SmsmithAcpiUtBuildSimpleObject(
43567754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
43667754Smsmith    ACPI_OBJECT             *UserObj,
43767754Smsmith    UINT8                   *DataSpace,
43867754Smsmith    UINT32                  *BufferSpaceUsed);
43967754Smsmith
44067754SmsmithACPI_STATUS
44177424SmsmithAcpiUtBuildPackageObject (
44267754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
44367754Smsmith    UINT8                   *Buffer,
44467754Smsmith    UINT32                  *SpaceUsed);
44567754Smsmith
44667754SmsmithACPI_STATUS
44777424SmsmithAcpiUtCopyIobjectToEobject (
44867754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
44967754Smsmith    ACPI_BUFFER             *RetBuffer);
45067754Smsmith
45167754SmsmithACPI_STATUS
45277424SmsmithAcpiUtCopyEobjectToIobject (
45367754Smsmith    ACPI_OBJECT             *Obj,
45484491Smsmith    ACPI_OPERAND_OBJECT     **InternalObj);
45567754Smsmith
45667754SmsmithACPI_STATUS
45777424SmsmithAcpiUtCopyISimpleToIsimple (
45867754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
45967754Smsmith    ACPI_OPERAND_OBJECT     *DestObj);
46067754Smsmith
46167754SmsmithACPI_STATUS
46291116SmsmithAcpiUtCopyIobjectToIobject (
46391116Smsmith    ACPI_OPERAND_OBJECT     *SourceDesc,
46491116Smsmith    ACPI_OPERAND_OBJECT     **DestDesc,
46591116Smsmith    ACPI_WALK_STATE         *WalkState);
46691116Smsmith
46791116Smsmith
46867754Smsmith/*
469151937Sjkim * utcreate - Object creation
47067754Smsmith */
47167754SmsmithACPI_STATUS
47277424SmsmithAcpiUtUpdateObjectReference (
47367754Smsmith    ACPI_OPERAND_OBJECT     *Object,
47467754Smsmith    UINT16                  Action);
47567754Smsmith
47667754Smsmith
47767754Smsmith/*
478151937Sjkim * utdebug - Debug interfaces
47967754Smsmith */
48083174Smsmithvoid
48183174SmsmithAcpiUtInitStackPtrTrace (
48267754Smsmith    void);
48367754Smsmith
48467754Smsmithvoid
48583174SmsmithAcpiUtTrackStackPtr (
48683174Smsmith    void);
48767754Smsmith
48867754Smsmithvoid
48983174SmsmithAcpiUtTrace (
49067754Smsmith    UINT32                  LineNumber,
491151937Sjkim    const char              *FunctionName,
492193267Sjkim    const char              *ModuleName,
493151937Sjkim    UINT32                  ComponentId);
49467754Smsmith
49567754Smsmithvoid
49683174SmsmithAcpiUtTracePtr (
49767754Smsmith    UINT32                  LineNumber,
498151937Sjkim    const char              *FunctionName,
499193267Sjkim    const char              *ModuleName,
500151937Sjkim    UINT32                  ComponentId,
501298714Sjkim    const void              *Pointer);
50267754Smsmith
50367754Smsmithvoid
50483174SmsmithAcpiUtTraceU32 (
50567754Smsmith    UINT32                  LineNumber,
506151937Sjkim    const char              *FunctionName,
507193267Sjkim    const char              *ModuleName,
508151937Sjkim    UINT32                  ComponentId,
50967754Smsmith    UINT32                  Integer);
51067754Smsmith
51167754Smsmithvoid
51283174SmsmithAcpiUtTraceStr (
51367754Smsmith    UINT32                  LineNumber,
514151937Sjkim    const char              *FunctionName,
515193267Sjkim    const char              *ModuleName,
516151937Sjkim    UINT32                  ComponentId,
517298714Sjkim    const char              *String);
51867754Smsmith
51967754Smsmithvoid
52083174SmsmithAcpiUtExit (
52167754Smsmith    UINT32                  LineNumber,
522151937Sjkim    const char              *FunctionName,
523193267Sjkim    const char              *ModuleName,
524151937Sjkim    UINT32                  ComponentId);
52567754Smsmith
52667754Smsmithvoid
52783174SmsmithAcpiUtStatusExit (
52867754Smsmith    UINT32                  LineNumber,
529151937Sjkim    const char              *FunctionName,
530193267Sjkim    const char              *ModuleName,
531151937Sjkim    UINT32                  ComponentId,
53267754Smsmith    ACPI_STATUS             Status);
53367754Smsmith
53467754Smsmithvoid
53583174SmsmithAcpiUtValueExit (
53667754Smsmith    UINT32                  LineNumber,
537151937Sjkim    const char              *FunctionName,
538193267Sjkim    const char              *ModuleName,
539151937Sjkim    UINT32                  ComponentId,
540202771Sjkim    UINT64                  Value);
54167754Smsmith
54267754Smsmithvoid
54383174SmsmithAcpiUtPtrExit (
54467754Smsmith    UINT32                  LineNumber,
545151937Sjkim    const char              *FunctionName,
546193267Sjkim    const char              *ModuleName,
547151937Sjkim    UINT32                  ComponentId,
54867754Smsmith    UINT8                   *Ptr);
54967754Smsmith
55067754Smsmithvoid
551298714SjkimAcpiUtStrExit (
552298714Sjkim    UINT32                  LineNumber,
553298714Sjkim    const char              *FunctionName,
554298714Sjkim    const char              *ModuleName,
555298714Sjkim    UINT32                  ComponentId,
556298714Sjkim    const char              *String);
557298714Sjkim
558298714Sjkimvoid
559241973SjkimAcpiUtDebugDumpBuffer (
560167802Sjkim    UINT8                   *Buffer,
561167802Sjkim    UINT32                  Count,
562167802Sjkim    UINT32                  Display,
563237412Sjkim    UINT32                  ComponentId);
56467754Smsmith
56567754Smsmithvoid
566241973SjkimAcpiUtDumpBuffer (
567167802Sjkim    UINT8                   *Buffer,
568167802Sjkim    UINT32                  Count,
569241973Sjkim    UINT32                  Display,
570241973Sjkim    UINT32                  Offset);
571167802Sjkim
572272444Sjkim#ifdef ACPI_APPLICATION
573167802Sjkimvoid
574272444SjkimAcpiUtDumpBufferToFile (
575272444Sjkim    ACPI_FILE               File,
576272444Sjkim    UINT8                   *Buffer,
577272444Sjkim    UINT32                  Count,
578272444Sjkim    UINT32                  Display,
579272444Sjkim    UINT32                  BaseOffset);
580272444Sjkim#endif
581272444Sjkim
582272444Sjkimvoid
58383174SmsmithAcpiUtReportError (
584114237Snjl    char                    *ModuleName,
585167802Sjkim    UINT32                  LineNumber);
58667754Smsmith
58767754Smsmithvoid
588167802SjkimAcpiUtReportInfo (
589114237Snjl    char                    *ModuleName,
590167802Sjkim    UINT32                  LineNumber);
59167754Smsmith
59267754Smsmithvoid
593167802SjkimAcpiUtReportWarning (
594167802Sjkim    char                    *ModuleName,
595167802Sjkim    UINT32                  LineNumber);
59667754Smsmith
597285797Sjkim
59867754Smsmith/*
599151937Sjkim * utdelete - Object deletion and reference counts
60067754Smsmith */
601151937Sjkimvoid
602151937SjkimAcpiUtAddReference (
603151937Sjkim    ACPI_OPERAND_OBJECT     *Object);
60467754Smsmith
60567754Smsmithvoid
606151937SjkimAcpiUtRemoveReference (
60767754Smsmith    ACPI_OPERAND_OBJECT     *Object);
60867754Smsmith
60967754Smsmithvoid
61077424SmsmithAcpiUtDeleteInternalPackageObject (
61167754Smsmith    ACPI_OPERAND_OBJECT     *Object);
61267754Smsmith
61367754Smsmithvoid
61477424SmsmithAcpiUtDeleteInternalSimpleObject (
61567754Smsmith    ACPI_OPERAND_OBJECT     *Object);
61667754Smsmith
61799679Siwasakivoid
61877424SmsmithAcpiUtDeleteInternalObjectList (
61967754Smsmith    ACPI_OPERAND_OBJECT     **ObjList);
62067754Smsmith
62167754Smsmith
62267754Smsmith/*
623151937Sjkim * uteval - object evaluation
62467754Smsmith */
62567754SmsmithACPI_STATUS
626114237SnjlAcpiUtEvaluateObject (
627114237Snjl    ACPI_NAMESPACE_NODE     *PrefixNode,
628298714Sjkim    const char              *Path,
629114237Snjl    UINT32                  ExpectedReturnBtypes,
630114237Snjl    ACPI_OPERAND_OBJECT     **ReturnDesc);
631114237Snjl
632114237SnjlACPI_STATUS
63377424SmsmithAcpiUtEvaluateNumericObject (
634298714Sjkim    const char              *ObjectName,
63567754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
636202771Sjkim    UINT64                  *Value);
63767754Smsmith
63867754SmsmithACPI_STATUS
639197104SjkimAcpiUtExecute_STA (
64067754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
641197104Sjkim    UINT32                  *StatusFlags);
64267754Smsmith
64367754SmsmithACPI_STATUS
644197104SjkimAcpiUtExecutePowerMethods (
64587031Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
646197104Sjkim    const char              **MethodNames,
647197104Sjkim    UINT8                   MethodCount,
648197104Sjkim    UINT8                   *OutValues);
64987031Smsmith
650197104Sjkim
651197104Sjkim/*
652197104Sjkim * utids - device ID support
653197104Sjkim */
65487031SmsmithACPI_STATUS
655197104SjkimAcpiUtExecute_HID (
65667754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
657241973Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
65867754Smsmith
65967754SmsmithACPI_STATUS
66077424SmsmithAcpiUtExecute_UID (
66167754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
662241973Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
66367754Smsmith
664126372SnjlACPI_STATUS
665197104SjkimAcpiUtExecute_CID (
666126372Snjl    ACPI_NAMESPACE_NODE     *DeviceNode,
667241973Sjkim    ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
66867754Smsmith
669284583SjkimACPI_STATUS
670284583SjkimAcpiUtExecute_CLS (
671284583Sjkim    ACPI_NAMESPACE_NODE     *DeviceNode,
672284583Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
673197104Sjkim
674284583Sjkim
675193267Sjkim/*
676193267Sjkim * utlock - reader/writer locks
677193267Sjkim */
678193267SjkimACPI_STATUS
679193267SjkimAcpiUtCreateRwLock (
680193267Sjkim    ACPI_RW_LOCK            *Lock);
68167754Smsmith
682193267Sjkimvoid
683193267SjkimAcpiUtDeleteRwLock (
684193267Sjkim    ACPI_RW_LOCK            *Lock);
685193267Sjkim
686193267SjkimACPI_STATUS
687193267SjkimAcpiUtAcquireReadLock (
688193267Sjkim    ACPI_RW_LOCK            *Lock);
689193267Sjkim
690193267SjkimACPI_STATUS
691193267SjkimAcpiUtReleaseReadLock (
692193267Sjkim    ACPI_RW_LOCK            *Lock);
693193267Sjkim
694193267SjkimACPI_STATUS
695193267SjkimAcpiUtAcquireWriteLock (
696193267Sjkim    ACPI_RW_LOCK            *Lock);
697193267Sjkim
698193267Sjkimvoid
699193267SjkimAcpiUtReleaseWriteLock (
700193267Sjkim    ACPI_RW_LOCK            *Lock);
701193267Sjkim
702193267Sjkim
70367754Smsmith/*
704151937Sjkim * utobject - internal object create/delete/cache routines
70567754Smsmith */
70683174SmsmithACPI_OPERAND_OBJECT  *
70783174SmsmithAcpiUtCreateInternalObjectDbg (
708193267Sjkim    const char              *ModuleName,
70983174Smsmith    UINT32                  LineNumber,
71083174Smsmith    UINT32                  ComponentId,
71191116Smsmith    ACPI_OBJECT_TYPE        Type);
71283174Smsmith
71367754Smsmithvoid *
71483174SmsmithAcpiUtAllocateObjectDescDbg (
715193267Sjkim    const char              *ModuleName,
71667754Smsmith    UINT32                  LineNumber,
71767754Smsmith    UINT32                  ComponentId);
71867754Smsmith
719151937Sjkim#define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
720151937Sjkim#define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
72167754Smsmith
72267754Smsmithvoid
72377424SmsmithAcpiUtDeleteObjectDesc (
72467754Smsmith    ACPI_OPERAND_OBJECT     *Object);
72567754Smsmith
72667754SmsmithBOOLEAN
72777424SmsmithAcpiUtValidInternalObject (
72867754Smsmith    void                    *Object);
72967754Smsmith
730107325SiwasakiACPI_OPERAND_OBJECT *
731193267SjkimAcpiUtCreatePackageObject (
732193267Sjkim    UINT32                  Count);
733193267Sjkim
734193267SjkimACPI_OPERAND_OBJECT *
735199337SjkimAcpiUtCreateIntegerObject (
736199337Sjkim    UINT64                  Value);
737199337Sjkim
738199337SjkimACPI_OPERAND_OBJECT *
739107325SiwasakiAcpiUtCreateBufferObject (
740107325Siwasaki    ACPI_SIZE               BufferSize);
74167754Smsmith
742138287SmarksACPI_OPERAND_OBJECT *
743138287SmarksAcpiUtCreateStringObject (
744138287Smarks    ACPI_SIZE               StringSize);
745107325Siwasaki
74667754SmsmithACPI_STATUS
74777424SmsmithAcpiUtGetObjectSize(
74867754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
74991116Smsmith    ACPI_SIZE               *ObjLength);
75067754Smsmith
75167754Smsmith
75267754Smsmith/*
753210976Sjkim * utosi - Support for the _OSI predefined control method
754210976Sjkim */
755210976SjkimACPI_STATUS
756210976SjkimAcpiUtInitializeInterfaces (
757210976Sjkim    void);
758210976Sjkim
759249112SjkimACPI_STATUS
760210976SjkimAcpiUtInterfaceTerminate (
761210976Sjkim    void);
762210976Sjkim
763210976SjkimACPI_STATUS
764210976SjkimAcpiUtInstallInterface (
765210976Sjkim    ACPI_STRING             InterfaceName);
766210976Sjkim
767210976SjkimACPI_STATUS
768210976SjkimAcpiUtRemoveInterface (
769210976Sjkim    ACPI_STRING             InterfaceName);
770210976Sjkim
771253690SjkimACPI_STATUS
772253690SjkimAcpiUtUpdateInterfaces (
773253690Sjkim    UINT8                   Action);
774253690Sjkim
775210976SjkimACPI_INTERFACE_INFO *
776210976SjkimAcpiUtGetInterface (
777210976Sjkim    ACPI_STRING             InterfaceName);
778210976Sjkim
779210976SjkimACPI_STATUS
780210976SjkimAcpiUtOsiImplementation (
781210976Sjkim    ACPI_WALK_STATE         *WalkState);
782210976Sjkim
783210976Sjkim
784210976Sjkim/*
785249112Sjkim * utpredef - support for predefined names
786249112Sjkim */
787249112Sjkimconst ACPI_PREDEFINED_INFO *
788249112SjkimAcpiUtGetNextPredefinedMethod (
789249112Sjkim    const ACPI_PREDEFINED_INFO  *ThisName);
790249112Sjkim
791249112Sjkimconst ACPI_PREDEFINED_INFO *
792249112SjkimAcpiUtMatchPredefinedMethod (
793249112Sjkim    char                        *Name);
794249112Sjkim
795281396Sjkimvoid
796281396SjkimAcpiUtGetExpectedReturnTypes (
797281396Sjkim    char                    *Buffer,
798281396Sjkim    UINT32                  ExpectedBtypes);
799281396Sjkim
800281396Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
801249112Sjkimconst ACPI_PREDEFINED_INFO *
802249112SjkimAcpiUtMatchResourceName (
803249112Sjkim    char                        *Name);
804249112Sjkim
805249112Sjkimvoid
806249112SjkimAcpiUtDisplayPredefinedMethod (
807249112Sjkim    char                        *Buffer,
808249112Sjkim    const ACPI_PREDEFINED_INFO  *ThisName,
809249112Sjkim    BOOLEAN                     MultiLine);
810249112Sjkim
811249112SjkimUINT32
812249112SjkimAcpiUtGetResourceBitWidth (
813249112Sjkim    char                    *Buffer,
814249112Sjkim    UINT16                  Types);
815281396Sjkim#endif
816249112Sjkim
817249112Sjkim
818249112Sjkim/*
819151937Sjkim * utstate - Generic state creation/cache routines
82067754Smsmith */
82167754Smsmithvoid
82277424SmsmithAcpiUtPushGenericState (
82367754Smsmith    ACPI_GENERIC_STATE      **ListHead,
82467754Smsmith    ACPI_GENERIC_STATE      *State);
82567754Smsmith
82667754SmsmithACPI_GENERIC_STATE *
82777424SmsmithAcpiUtPopGenericState (
82867754Smsmith    ACPI_GENERIC_STATE      **ListHead);
82967754Smsmith
83067754Smsmith
83167754SmsmithACPI_GENERIC_STATE *
83277424SmsmithAcpiUtCreateGenericState (
83367754Smsmith    void);
83467754Smsmith
83587031SmsmithACPI_THREAD_STATE *
83687031SmsmithAcpiUtCreateThreadState (
83787031Smsmith    void);
83887031Smsmith
83967754SmsmithACPI_GENERIC_STATE *
84077424SmsmithAcpiUtCreateUpdateState (
84167754Smsmith    ACPI_OPERAND_OBJECT     *Object,
84267754Smsmith    UINT16                  Action);
84367754Smsmith
84473561SmsmithACPI_GENERIC_STATE *
84577424SmsmithAcpiUtCreatePkgState (
84673561Smsmith    void                    *InternalObject,
84773561Smsmith    void                    *ExternalObject,
848322877Sjkim    UINT32                  Index);
84973561Smsmith
85067754SmsmithACPI_STATUS
85177424SmsmithAcpiUtCreateUpdateStateAndPush (
85267754Smsmith    ACPI_OPERAND_OBJECT     *Object,
85367754Smsmith    UINT16                  Action,
85467754Smsmith    ACPI_GENERIC_STATE      **StateList);
85567754Smsmith
85667754SmsmithACPI_GENERIC_STATE *
85777424SmsmithAcpiUtCreateControlState (
85867754Smsmith    void);
85967754Smsmith
86067754Smsmithvoid
86177424SmsmithAcpiUtDeleteGenericState (
86267754Smsmith    ACPI_GENERIC_STATE      *State);
86367754Smsmith
86467754Smsmith
86567754Smsmith/*
866151937Sjkim * utmath
86767754Smsmith */
86884491SmsmithACPI_STATUS
86984491SmsmithAcpiUtDivide (
870202771Sjkim    UINT64                  InDividend,
871202771Sjkim    UINT64                  InDivisor,
872202771Sjkim    UINT64                  *OutQuotient,
873202771Sjkim    UINT64                  *OutRemainder);
87484491Smsmith
87584491SmsmithACPI_STATUS
87684491SmsmithAcpiUtShortDivide (
877202771Sjkim    UINT64                  InDividend,
87884491Smsmith    UINT32                  Divisor,
879202771Sjkim    UINT64                  *OutQuotient,
88084491Smsmith    UINT32                  *OutRemainder);
88184491Smsmith
882322877SjkimACPI_STATUS
883322877SjkimAcpiUtShortMultiply (
884322877Sjkim    UINT64                  InMultiplicand,
885322877Sjkim    UINT32                  Multiplier,
886322877Sjkim    UINT64                  *Outproduct);
887246849Sjkim
888322877SjkimACPI_STATUS
889322877SjkimAcpiUtShortShiftLeft (
890322877Sjkim    UINT64                  Operand,
891322877Sjkim    UINT32                  Count,
892322877Sjkim    UINT64                  *OutResult);
893322877Sjkim
894322877SjkimACPI_STATUS
895322877SjkimAcpiUtShortShiftRight (
896322877Sjkim    UINT64                  Operand,
897322877Sjkim    UINT32                  Count,
898322877Sjkim    UINT64                  *OutResult);
899322877Sjkim
900322877Sjkim
901151937Sjkim/*
902151937Sjkim * utmisc
903151937Sjkim */
904246849Sjkimconst ACPI_EXCEPTION_INFO *
905167802SjkimAcpiUtValidateException (
906167802Sjkim    ACPI_STATUS             Status);
907167802Sjkim
908167802SjkimBOOLEAN
909197104SjkimAcpiUtIsPciRootBridge (
910197104Sjkim    char                    *Id);
911197104Sjkim
912287168Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
913197104SjkimBOOLEAN
914167802SjkimAcpiUtIsAmlTable (
915167802Sjkim    ACPI_TABLE_HEADER       *Table);
916281396Sjkim#endif
917167802Sjkim
918151937SjkimACPI_STATUS
919151937SjkimAcpiUtWalkPackageTree (
920151937Sjkim    ACPI_OPERAND_OBJECT     *SourceObject,
921151937Sjkim    void                    *TargetObject,
922151937Sjkim    ACPI_PKG_CALLBACK       WalkCallback,
923151937Sjkim    void                    *Context);
924151937Sjkim
925138287Smarks/* Values for Base above (16=Hex, 10=Decimal) */
926138287Smarks
927138287Smarks#define ACPI_ANY_BASE        0
928138287Smarks
929285797Sjkim
930151937SjkimUINT32
93199679SiwasakiAcpiUtDwordByteSwap (
93299679Siwasaki    UINT32                  Value);
93399679Siwasaki
93499679Siwasakivoid
93599679SiwasakiAcpiUtSetIntegerWidth (
93699679Siwasaki    UINT8                   Revision);
93799679Siwasaki
938102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT
93973561Smsmithvoid
94077424SmsmithAcpiUtDisplayInitPathname (
941114237Snjl    UINT8                   Type,
942114237Snjl    ACPI_NAMESPACE_NODE     *ObjHandle,
943298714Sjkim    const char              *Path);
94473561Smsmith#endif
94573561Smsmith
94673561Smsmith
94767754Smsmith/*
948245582Sjkim * utownerid - Support for Table/Method Owner IDs
949245582Sjkim */
950245582SjkimACPI_STATUS
951245582SjkimAcpiUtAllocateOwnerId (
952245582Sjkim    ACPI_OWNER_ID           *OwnerId);
953245582Sjkim
954245582Sjkimvoid
955245582SjkimAcpiUtReleaseOwnerId (
956245582Sjkim    ACPI_OWNER_ID           *OwnerId);
957245582Sjkim
958245582Sjkim
959245582Sjkim/*
960167802Sjkim * utresrc
961167802Sjkim */
962167802SjkimACPI_STATUS
963167802SjkimAcpiUtWalkAmlResources (
964243347Sjkim    ACPI_WALK_STATE         *WalkState,
965167802Sjkim    UINT8                   *Aml,
966167802Sjkim    ACPI_SIZE               AmlLength,
967167802Sjkim    ACPI_WALK_AML_CALLBACK  UserFunction,
968245582Sjkim    void                    **Context);
969167802Sjkim
970167802SjkimACPI_STATUS
971167802SjkimAcpiUtValidateResource (
972243347Sjkim    ACPI_WALK_STATE         *WalkState,
973167802Sjkim    void                    *Aml,
974167802Sjkim    UINT8                   *ReturnIndex);
975167802Sjkim
976167802SjkimUINT32
977167802SjkimAcpiUtGetDescriptorLength (
978167802Sjkim    void                    *Aml);
979167802Sjkim
980167802SjkimUINT16
981167802SjkimAcpiUtGetResourceLength (
982167802Sjkim    void                    *Aml);
983167802Sjkim
984167802SjkimUINT8
985167802SjkimAcpiUtGetResourceHeaderLength (
986167802Sjkim    void                    *Aml);
987167802Sjkim
988167802SjkimUINT8
989167802SjkimAcpiUtGetResourceType (
990167802Sjkim    void                    *Aml);
991167802Sjkim
992167802SjkimACPI_STATUS
993167802SjkimAcpiUtGetResourceEndTag (
994167802Sjkim    ACPI_OPERAND_OBJECT     *ObjDesc,
995167802Sjkim    UINT8                   **EndTag);
996167802Sjkim
997167802Sjkim
998167802Sjkim/*
999245582Sjkim * utstring - String and character utilities
1000245582Sjkim */
1001245582Sjkimvoid
1002245582SjkimAcpiUtPrintString (
1003245582Sjkim    char                    *String,
1004252279Sjkim    UINT16                  MaxLength);
1005245582Sjkim
1006281396Sjkim#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
1007245582Sjkimvoid
1008245582SjkimUtConvertBackslashes (
1009245582Sjkim    char                    *Pathname);
1010281396Sjkim#endif
1011245582Sjkim
1012245582Sjkimvoid
1013245582SjkimAcpiUtRepairName (
1014245582Sjkim    char                    *Name);
1015245582Sjkim
1016272444Sjkim#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
1017272444SjkimBOOLEAN
1018272444SjkimAcpiUtSafeStrcpy (
1019272444Sjkim    char                    *Dest,
1020272444Sjkim    ACPI_SIZE               DestSize,
1021272444Sjkim    char                    *Source);
1022245582Sjkim
1023272444SjkimBOOLEAN
1024272444SjkimAcpiUtSafeStrcat (
1025272444Sjkim    char                    *Dest,
1026272444Sjkim    ACPI_SIZE               DestSize,
1027272444Sjkim    char                    *Source);
1028298714Sjkim
1029298714SjkimBOOLEAN
1030298714SjkimAcpiUtSafeStrncat (
1031298714Sjkim    char                    *Dest,
1032298714Sjkim    ACPI_SIZE               DestSize,
1033298714Sjkim    char                    *Source,
1034298714Sjkim    ACPI_SIZE               MaxTransferLength);
1035272444Sjkim#endif
1036272444Sjkim
1037272444Sjkim
1038245582Sjkim/*
1039151937Sjkim * utmutex - mutex support
104067754Smsmith */
1041151937SjkimACPI_STATUS
1042151937SjkimAcpiUtMutexInitialize (
1043151937Sjkim    void);
104467754Smsmith
104582367Smsmithvoid
1046151937SjkimAcpiUtMutexTerminate (
1047151937Sjkim    void);
104882367Smsmith
1049151937SjkimACPI_STATUS
1050151937SjkimAcpiUtAcquireMutex (
1051151937Sjkim    ACPI_MUTEX_HANDLE       MutexId);
105282367Smsmith
105391116SmsmithACPI_STATUS
1054151937SjkimAcpiUtReleaseMutex (
1055151937Sjkim    ACPI_MUTEX_HANDLE       MutexId);
1056151937Sjkim
1057151937Sjkim
1058151937Sjkim/*
1059151937Sjkim * utalloc - memory allocation and object caching
1060151937Sjkim */
1061151937SjkimACPI_STATUS
1062151937SjkimAcpiUtCreateCaches (
1063151937Sjkim    void);
1064151937Sjkim
1065151937SjkimACPI_STATUS
1066151937SjkimAcpiUtDeleteCaches (
1067151937Sjkim    void);
1068151937Sjkim
1069151937SjkimACPI_STATUS
107091116SmsmithAcpiUtValidateBuffer (
107191116Smsmith    ACPI_BUFFER             *Buffer);
107282367Smsmith
107391116SmsmithACPI_STATUS
107491116SmsmithAcpiUtInitializeBuffer (
107591116Smsmith    ACPI_BUFFER             *Buffer,
107691116Smsmith    ACPI_SIZE               RequiredLength);
107782367Smsmith
107891116Smsmith#ifdef ACPI_DBG_TRACK_ALLOCATIONS
107991116Smsmithvoid *
108091116SmsmithAcpiUtAllocateAndTrack (
108191116Smsmith    ACPI_SIZE               Size,
108291116Smsmith    UINT32                  Component,
1083193267Sjkim    const char              *Module,
108491116Smsmith    UINT32                  Line);
108591116Smsmith
108691116Smsmithvoid *
1087167802SjkimAcpiUtAllocateZeroedAndTrack (
108891116Smsmith    ACPI_SIZE               Size,
108991116Smsmith    UINT32                  Component,
1090193267Sjkim    const char              *Module,
109191116Smsmith    UINT32                  Line);
109291116Smsmith
109367754Smsmithvoid
109491116SmsmithAcpiUtFreeAndTrack (
109567754Smsmith    void                    *Address,
109667754Smsmith    UINT32                  Component,
1097193267Sjkim    const char              *Module,
109867754Smsmith    UINT32                  Line);
109999679Siwasaki
110067754Smsmithvoid
110177424SmsmithAcpiUtDumpAllocationInfo (
110267754Smsmith    void);
110367754Smsmith
110467754Smsmithvoid
110584491SmsmithAcpiUtDumpAllocations (
110667754Smsmith    UINT32                  Component,
1107193267Sjkim    const char              *Module);
1108167802Sjkim
1109167802SjkimACPI_STATUS
1110167802SjkimAcpiUtCreateList (
1111298714Sjkim    const char              *ListName,
1112167802Sjkim    UINT16                  ObjectSize,
1113167802Sjkim    ACPI_MEMORY_LIST        **ReturnCache);
1114167802Sjkim
1115212761Sjkim#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
1116167802Sjkim
1117285797Sjkim
1118229989Sjkim/*
1119229989Sjkim * utaddress - address range check
1120229989Sjkim */
1121229989SjkimACPI_STATUS
1122229989SjkimAcpiUtAddAddressRange (
1123229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1124229989Sjkim    ACPI_PHYSICAL_ADDRESS   Address,
1125229989Sjkim    UINT32                  Length,
1126229989Sjkim    ACPI_NAMESPACE_NODE     *RegionNode);
112767754Smsmith
1128229989Sjkimvoid
1129229989SjkimAcpiUtRemoveAddressRange (
1130229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1131229989Sjkim    ACPI_NAMESPACE_NODE     *RegionNode);
1132229989Sjkim
1133229989SjkimUINT32
1134229989SjkimAcpiUtCheckAddressRange (
1135229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1136229989Sjkim    ACPI_PHYSICAL_ADDRESS   Address,
1137229989Sjkim    UINT32                  Length,
1138229989Sjkim    BOOLEAN                 Warn);
1139229989Sjkim
1140229989Sjkimvoid
1141229989SjkimAcpiUtDeleteAddressLists (
1142229989Sjkim    void);
1143229989Sjkim
1144285797Sjkim
1145212761Sjkim/*
1146212761Sjkim * utxferror - various error/warning output functions
1147212761Sjkim */
1148212761Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1149212761SjkimAcpiUtPredefinedWarning (
1150212761Sjkim    const char              *ModuleName,
1151212761Sjkim    UINT32                  LineNumber,
1152212761Sjkim    char                    *Pathname,
1153212761Sjkim    UINT8                   NodeFlags,
1154212761Sjkim    const char              *Format,
1155212761Sjkim    ...);
1156212761Sjkim
1157212761Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1158212761SjkimAcpiUtPredefinedInfo (
1159212761Sjkim    const char              *ModuleName,
1160212761Sjkim    UINT32                  LineNumber,
1161212761Sjkim    char                    *Pathname,
1162212761Sjkim    UINT8                   NodeFlags,
1163212761Sjkim    const char              *Format,
1164212761Sjkim    ...);
1165212761Sjkim
1166249663Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1167249663SjkimAcpiUtPredefinedBiosError (
1168249663Sjkim    const char              *ModuleName,
1169249663Sjkim    UINT32                  LineNumber,
1170249663Sjkim    char                    *Pathname,
1171249663Sjkim    UINT8                   NodeFlags,
1172249663Sjkim    const char              *Format,
1173249663Sjkim    ...);
1174249663Sjkim
1175212761Sjkimvoid
1176212761SjkimAcpiUtNamespaceError (
1177212761Sjkim    const char              *ModuleName,
1178212761Sjkim    UINT32                  LineNumber,
1179212761Sjkim    const char              *InternalName,
1180212761Sjkim    ACPI_STATUS             LookupStatus);
1181212761Sjkim
1182212761Sjkimvoid
1183212761SjkimAcpiUtMethodError (
1184212761Sjkim    const char              *ModuleName,
1185212761Sjkim    UINT32                  LineNumber,
1186212761Sjkim    const char              *Message,
1187212761Sjkim    ACPI_NAMESPACE_NODE     *Node,
1188212761Sjkim    const char              *Path,
1189212761Sjkim    ACPI_STATUS             LookupStatus);
1190212761Sjkim
1191285797Sjkim
1192272444Sjkim/*
1193272444Sjkim * Utility functions for ACPI names and IDs
1194272444Sjkim */
1195272444Sjkimconst AH_PREDEFINED_NAME *
1196272444SjkimAcpiAhMatchPredefinedName (
1197272444Sjkim    char                    *Nameseg);
1198272444Sjkim
1199272444Sjkimconst AH_DEVICE_ID *
1200272444SjkimAcpiAhMatchHardwareId (
1201272444Sjkim    char                    *Hid);
1202272444Sjkim
1203272444Sjkimconst char *
1204272444SjkimAcpiAhMatchUuid (
1205272444Sjkim    UINT8                   *Data);
1206272444Sjkim
1207285797Sjkim
1208272444Sjkim/*
1209272444Sjkim * utuuid -- UUID support functions
1210272444Sjkim */
1211281396Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
1212272444Sjkimvoid
1213272444SjkimAcpiUtConvertStringToUuid (
1214272444Sjkim    char                    *InString,
1215272444Sjkim    UINT8                   *UuidBuffer);
1216281396Sjkim#endif
1217272444Sjkim
121877424Smsmith#endif /* _ACUTILS_H */
1219