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_WARNING
231250838Sjkim#define ACPI_MSG_WARNING        "ACPI Warning: "
232300879Sjkim#endif
233300879Sjkim#ifndef ACPI_MSG_INFO
234250838Sjkim#define ACPI_MSG_INFO           "ACPI: "
235300879Sjkim#endif
236250838Sjkim
237300879Sjkim#ifndef ACPI_MSG_BIOS_ERROR
238327557Sjkim#define ACPI_MSG_BIOS_ERROR     "Firmware Error (ACPI): "
239300879Sjkim#endif
240300879Sjkim#ifndef ACPI_MSG_BIOS_WARNING
241327557Sjkim#define ACPI_MSG_BIOS_WARNING   "Firmware Warning (ACPI): "
242300879Sjkim#endif
243250838Sjkim
244250838Sjkim/*
245250838Sjkim * Common message suffix
246250838Sjkim */
247250838Sjkim#define ACPI_MSG_SUFFIX \
248250838Sjkim    AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
249250838Sjkim
250327557Sjkim/* Flags to indicate implicit or explicit string-to-integer conversion */
251250838Sjkim
252327557Sjkim#define ACPI_IMPLICIT_CONVERSION        TRUE
253327557Sjkim#define ACPI_NO_IMPLICIT_CONVERSION     FALSE
254327557Sjkim
255167802Sjkim/* Types for Resource descriptor entries */
256167802Sjkim
257167802Sjkim#define ACPI_INVALID_RESOURCE           0
258167802Sjkim#define ACPI_FIXED_LENGTH               1
259167802Sjkim#define ACPI_VARIABLE_LENGTH            2
260167802Sjkim#define ACPI_SMALL_VARIABLE_LENGTH      3
261167802Sjkim
26273561Smsmithtypedef
263167802SjkimACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
264167802Sjkim    UINT8                   *Aml,
265167802Sjkim    UINT32                  Length,
266167802Sjkim    UINT32                  Offset,
267167802Sjkim    UINT8                   ResourceIndex,
268245582Sjkim    void                    **Context);
269167802Sjkim
270167802Sjkimtypedef
27173561SmsmithACPI_STATUS (*ACPI_PKG_CALLBACK) (
27273561Smsmith    UINT8                   ObjectType,
27373561Smsmith    ACPI_OPERAND_OBJECT     *SourceObject,
27473561Smsmith    ACPI_GENERIC_STATE      *State,
27573561Smsmith    void                    *Context);
27673561Smsmith
27773561Smsmithtypedef struct acpi_pkg_info
27873561Smsmith{
27973561Smsmith    UINT8                   *FreeSpace;
28091116Smsmith    ACPI_SIZE               Length;
28173561Smsmith    UINT32                  ObjectSpace;
28273561Smsmith    UINT32                  NumPackages;
283114237Snjl
28473561Smsmith} ACPI_PKG_INFO;
28573561Smsmith
286249112Sjkim/* Object reference counts */
287249112Sjkim
28867754Smsmith#define REF_INCREMENT       (UINT16) 0
28967754Smsmith#define REF_DECREMENT       (UINT16) 1
29067754Smsmith
29177424Smsmith/* AcpiUtDumpBuffer */
29267754Smsmith
29367754Smsmith#define DB_BYTE_DISPLAY     1
29467754Smsmith#define DB_WORD_DISPLAY     2
29567754Smsmith#define DB_DWORD_DISPLAY    4
29667754Smsmith#define DB_QWORD_DISPLAY    8
29767754Smsmith
298285797Sjkim
29967754Smsmith/*
300298714Sjkim * utascii - ASCII utilities
301298714Sjkim */
302298714SjkimBOOLEAN
303298714SjkimAcpiUtValidNameseg (
304298714Sjkim    char                    *Signature);
305298714Sjkim
306298714SjkimBOOLEAN
307298714SjkimAcpiUtValidNameChar (
308298714Sjkim    char                    Character,
309298714Sjkim    UINT32                  Position);
310298714Sjkim
311298714Sjkimvoid
312298714SjkimAcpiUtCheckAndRepairAscii (
313298714Sjkim    UINT8                   *Name,
314298714Sjkim    char                    *RepairedName,
315298714Sjkim    UINT32                  Count);
316298714Sjkim
317298714Sjkim
318298714Sjkim/*
319285797Sjkim * utnonansi - Non-ANSI C library functions
320285797Sjkim */
321285797Sjkimvoid
322285797SjkimAcpiUtStrupr (
323285797Sjkim    char                    *SrcString);
324285797Sjkim
325285797Sjkimvoid
326285797SjkimAcpiUtStrlwr (
327285797Sjkim    char                    *SrcString);
328285797Sjkim
329285797Sjkimint
330285797SjkimAcpiUtStricmp (
331285797Sjkim    char                    *String1,
332285797Sjkim    char                    *String2);
333285797Sjkim
334327557Sjkim
335327557Sjkim/*
336327557Sjkim * utstrsuppt - string-to-integer conversion support functions
337327557Sjkim */
338285797SjkimACPI_STATUS
339327557SjkimAcpiUtConvertOctalString (
340285797Sjkim    char                    *String,
341327557Sjkim    UINT64                  *ReturnValue);
342285797Sjkim
343327557SjkimACPI_STATUS
344327557SjkimAcpiUtConvertDecimalString (
345327557Sjkim    char                    *String,
346327557Sjkim    UINT64                  *ReturnValuePtr);
347327557Sjkim
348327557SjkimACPI_STATUS
349327557SjkimAcpiUtConvertHexString (
350327557Sjkim    char                    *String,
351327557Sjkim    UINT64                  *ReturnValuePtr);
352327557Sjkim
353327557Sjkimchar
354327557SjkimAcpiUtRemoveWhitespace (
355327557Sjkim    char                    **String);
356327557Sjkim
357327557Sjkimchar
358327557SjkimAcpiUtRemoveLeadingZeros (
359327557Sjkim    char                    **String);
360327557Sjkim
361327557SjkimBOOLEAN
362327557SjkimAcpiUtDetectHexPrefix (
363327557Sjkim    char                    **String);
364327557Sjkim
365327557SjkimBOOLEAN
366327557SjkimAcpiUtDetectOctalPrefix (
367327557Sjkim    char                    **String);
368327557Sjkim
369327557Sjkim
370316303Sjkim/*
371327557Sjkim * utstrtoul64 - string-to-integer conversion functions
372316303Sjkim */
373327557SjkimACPI_STATUS
374327557SjkimAcpiUtStrtoul64 (
375327557Sjkim    char                    *String,
376327557Sjkim    UINT64                  *RetInteger);
377285797Sjkim
378327557SjkimUINT64
379327557SjkimAcpiUtExplicitStrtoul64 (
380327557Sjkim    char                    *String);
381298714Sjkim
382327557SjkimUINT64
383327557SjkimAcpiUtImplicitStrtoul64 (
384327557Sjkim    char                    *String);
385327557Sjkim
386327557Sjkim
387285797Sjkim/*
388151937Sjkim * utglobal - Global data structures and procedures
38967754Smsmith */
390193267SjkimACPI_STATUS
391151937SjkimAcpiUtInitGlobals (
39267754Smsmith    void);
39367754Smsmith
394298714Sjkimconst char *
39577424SmsmithAcpiUtGetMutexName (
39667754Smsmith    UINT32                  MutexId);
39767754Smsmith
398327557Sjkim#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
399327557Sjkim
400193267Sjkimconst char *
401193267SjkimAcpiUtGetNotifyName (
402272444Sjkim    UINT32                  NotifyValue,
403272444Sjkim    ACPI_OBJECT_TYPE        Type);
404100966Siwasaki#endif
405100966Siwasaki
406298714Sjkimconst char *
40777424SmsmithAcpiUtGetTypeName (
40891116Smsmith    ACPI_OBJECT_TYPE        Type);
40967754Smsmith
410298714Sjkimconst char *
411123315SnjlAcpiUtGetNodeName (
412123315Snjl    void                    *Object);
413123315Snjl
414298714Sjkimconst char *
415123315SnjlAcpiUtGetDescriptorName (
416123315Snjl    void                    *Object);
417123315Snjl
418193267Sjkimconst char *
419193267SjkimAcpiUtGetReferenceName (
420193267Sjkim    ACPI_OPERAND_OBJECT     *Object);
421193267Sjkim
422298714Sjkimconst char *
42399679SiwasakiAcpiUtGetObjectTypeName (
42499679Siwasaki    ACPI_OPERAND_OBJECT     *ObjDesc);
42599679Siwasaki
426298714Sjkimconst char *
42777424SmsmithAcpiUtGetRegionName (
42869746Smsmith    UINT8                   SpaceId);
42969746Smsmith
430298714Sjkimconst char *
43191116SmsmithAcpiUtGetEventName (
43291116Smsmith    UINT32                  EventId);
43369746Smsmith
434316303Sjkimconst char *
435316303SjkimAcpiUtGetArgumentTypeName (
436316303Sjkim    UINT32                  ArgType);
437316303Sjkim
43899679Siwasakichar
43982367SmsmithAcpiUtHexToAsciiChar (
440202771Sjkim    UINT64                  Integer,
44182367Smsmith    UINT32                  Position);
44282367Smsmith
443316303SjkimACPI_STATUS
444316303SjkimAcpiUtAsciiToHexByte (
445316303Sjkim    char                    *TwoAsciiChars,
446316303Sjkim    UINT8                   *ReturnByte);
447316303Sjkim
448272444SjkimUINT8
449272444SjkimAcpiUtAsciiCharToHex (
450272444Sjkim    int                     HexChar);
451272444Sjkim
45267754SmsmithBOOLEAN
45377424SmsmithAcpiUtValidObjectType (
45491116Smsmith    ACPI_OBJECT_TYPE        Type);
45567754Smsmith
45667754Smsmith
457151937Sjkim/*
458151937Sjkim * utinit - miscellaneous initialization and shutdown
459151937Sjkim */
460151937SjkimACPI_STATUS
461151937SjkimAcpiUtHardwareInitialize (
462151937Sjkim    void);
46367754Smsmith
464151937Sjkimvoid
465151937SjkimAcpiUtSubsystemShutdown (
466151937Sjkim    void);
467151937Sjkim
468151937Sjkim
46967754Smsmith/*
470151937Sjkim * utcopy - Object construction and conversion interfaces
47167754Smsmith */
47267754SmsmithACPI_STATUS
47377424SmsmithAcpiUtBuildSimpleObject(
47467754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
47567754Smsmith    ACPI_OBJECT             *UserObj,
47667754Smsmith    UINT8                   *DataSpace,
47767754Smsmith    UINT32                  *BufferSpaceUsed);
47867754Smsmith
47967754SmsmithACPI_STATUS
48077424SmsmithAcpiUtBuildPackageObject (
48167754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
48267754Smsmith    UINT8                   *Buffer,
48367754Smsmith    UINT32                  *SpaceUsed);
48467754Smsmith
48567754SmsmithACPI_STATUS
48677424SmsmithAcpiUtCopyIobjectToEobject (
48767754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
48867754Smsmith    ACPI_BUFFER             *RetBuffer);
48967754Smsmith
49067754SmsmithACPI_STATUS
49177424SmsmithAcpiUtCopyEobjectToIobject (
49267754Smsmith    ACPI_OBJECT             *Obj,
49384491Smsmith    ACPI_OPERAND_OBJECT     **InternalObj);
49467754Smsmith
49567754SmsmithACPI_STATUS
49677424SmsmithAcpiUtCopyISimpleToIsimple (
49767754Smsmith    ACPI_OPERAND_OBJECT     *SourceObj,
49867754Smsmith    ACPI_OPERAND_OBJECT     *DestObj);
49967754Smsmith
50067754SmsmithACPI_STATUS
50191116SmsmithAcpiUtCopyIobjectToIobject (
50291116Smsmith    ACPI_OPERAND_OBJECT     *SourceDesc,
50391116Smsmith    ACPI_OPERAND_OBJECT     **DestDesc,
50491116Smsmith    ACPI_WALK_STATE         *WalkState);
50591116Smsmith
50691116Smsmith
50767754Smsmith/*
508151937Sjkim * utcreate - Object creation
50967754Smsmith */
51067754SmsmithACPI_STATUS
51177424SmsmithAcpiUtUpdateObjectReference (
51267754Smsmith    ACPI_OPERAND_OBJECT     *Object,
51367754Smsmith    UINT16                  Action);
51467754Smsmith
51567754Smsmith
51667754Smsmith/*
517151937Sjkim * utdebug - Debug interfaces
51867754Smsmith */
51983174Smsmithvoid
52083174SmsmithAcpiUtInitStackPtrTrace (
52167754Smsmith    void);
52267754Smsmith
52367754Smsmithvoid
52483174SmsmithAcpiUtTrackStackPtr (
52583174Smsmith    void);
52667754Smsmith
52767754Smsmithvoid
52883174SmsmithAcpiUtTrace (
52967754Smsmith    UINT32                  LineNumber,
530151937Sjkim    const char              *FunctionName,
531193267Sjkim    const char              *ModuleName,
532151937Sjkim    UINT32                  ComponentId);
53367754Smsmith
53467754Smsmithvoid
53583174SmsmithAcpiUtTracePtr (
53667754Smsmith    UINT32                  LineNumber,
537151937Sjkim    const char              *FunctionName,
538193267Sjkim    const char              *ModuleName,
539151937Sjkim    UINT32                  ComponentId,
540298714Sjkim    const void              *Pointer);
54167754Smsmith
54267754Smsmithvoid
54383174SmsmithAcpiUtTraceU32 (
54467754Smsmith    UINT32                  LineNumber,
545151937Sjkim    const char              *FunctionName,
546193267Sjkim    const char              *ModuleName,
547151937Sjkim    UINT32                  ComponentId,
54867754Smsmith    UINT32                  Integer);
54967754Smsmith
55067754Smsmithvoid
55183174SmsmithAcpiUtTraceStr (
55267754Smsmith    UINT32                  LineNumber,
553151937Sjkim    const char              *FunctionName,
554193267Sjkim    const char              *ModuleName,
555151937Sjkim    UINT32                  ComponentId,
556298714Sjkim    const char              *String);
55767754Smsmith
55867754Smsmithvoid
55983174SmsmithAcpiUtExit (
56067754Smsmith    UINT32                  LineNumber,
561151937Sjkim    const char              *FunctionName,
562193267Sjkim    const char              *ModuleName,
563151937Sjkim    UINT32                  ComponentId);
56467754Smsmith
56567754Smsmithvoid
56683174SmsmithAcpiUtStatusExit (
56767754Smsmith    UINT32                  LineNumber,
568151937Sjkim    const char              *FunctionName,
569193267Sjkim    const char              *ModuleName,
570151937Sjkim    UINT32                  ComponentId,
57167754Smsmith    ACPI_STATUS             Status);
57267754Smsmith
57367754Smsmithvoid
57483174SmsmithAcpiUtValueExit (
57567754Smsmith    UINT32                  LineNumber,
576151937Sjkim    const char              *FunctionName,
577193267Sjkim    const char              *ModuleName,
578151937Sjkim    UINT32                  ComponentId,
579202771Sjkim    UINT64                  Value);
58067754Smsmith
58167754Smsmithvoid
58283174SmsmithAcpiUtPtrExit (
58367754Smsmith    UINT32                  LineNumber,
584151937Sjkim    const char              *FunctionName,
585193267Sjkim    const char              *ModuleName,
586151937Sjkim    UINT32                  ComponentId,
58767754Smsmith    UINT8                   *Ptr);
58867754Smsmith
58967754Smsmithvoid
590298714SjkimAcpiUtStrExit (
591298714Sjkim    UINT32                  LineNumber,
592298714Sjkim    const char              *FunctionName,
593298714Sjkim    const char              *ModuleName,
594298714Sjkim    UINT32                  ComponentId,
595298714Sjkim    const char              *String);
596298714Sjkim
597298714Sjkimvoid
598241973SjkimAcpiUtDebugDumpBuffer (
599167802Sjkim    UINT8                   *Buffer,
600167802Sjkim    UINT32                  Count,
601167802Sjkim    UINT32                  Display,
602237412Sjkim    UINT32                  ComponentId);
60367754Smsmith
60467754Smsmithvoid
605241973SjkimAcpiUtDumpBuffer (
606167802Sjkim    UINT8                   *Buffer,
607167802Sjkim    UINT32                  Count,
608241973Sjkim    UINT32                  Display,
609241973Sjkim    UINT32                  Offset);
610167802Sjkim
611272444Sjkim#ifdef ACPI_APPLICATION
612167802Sjkimvoid
613272444SjkimAcpiUtDumpBufferToFile (
614272444Sjkim    ACPI_FILE               File,
615272444Sjkim    UINT8                   *Buffer,
616272444Sjkim    UINT32                  Count,
617272444Sjkim    UINT32                  Display,
618272444Sjkim    UINT32                  BaseOffset);
619272444Sjkim#endif
620272444Sjkim
621272444Sjkimvoid
62283174SmsmithAcpiUtReportError (
623114237Snjl    char                    *ModuleName,
624167802Sjkim    UINT32                  LineNumber);
62567754Smsmith
62667754Smsmithvoid
627167802SjkimAcpiUtReportInfo (
628114237Snjl    char                    *ModuleName,
629167802Sjkim    UINT32                  LineNumber);
63067754Smsmith
63167754Smsmithvoid
632167802SjkimAcpiUtReportWarning (
633167802Sjkim    char                    *ModuleName,
634167802Sjkim    UINT32                  LineNumber);
63567754Smsmith
636285797Sjkim
63767754Smsmith/*
638151937Sjkim * utdelete - Object deletion and reference counts
63967754Smsmith */
640151937Sjkimvoid
641151937SjkimAcpiUtAddReference (
642151937Sjkim    ACPI_OPERAND_OBJECT     *Object);
64367754Smsmith
64467754Smsmithvoid
645151937SjkimAcpiUtRemoveReference (
64667754Smsmith    ACPI_OPERAND_OBJECT     *Object);
64767754Smsmith
64867754Smsmithvoid
64977424SmsmithAcpiUtDeleteInternalPackageObject (
65067754Smsmith    ACPI_OPERAND_OBJECT     *Object);
65167754Smsmith
65267754Smsmithvoid
65377424SmsmithAcpiUtDeleteInternalSimpleObject (
65467754Smsmith    ACPI_OPERAND_OBJECT     *Object);
65567754Smsmith
65699679Siwasakivoid
65777424SmsmithAcpiUtDeleteInternalObjectList (
65867754Smsmith    ACPI_OPERAND_OBJECT     **ObjList);
65967754Smsmith
66067754Smsmith
66167754Smsmith/*
662151937Sjkim * uteval - object evaluation
66367754Smsmith */
66467754SmsmithACPI_STATUS
665114237SnjlAcpiUtEvaluateObject (
666114237Snjl    ACPI_NAMESPACE_NODE     *PrefixNode,
667298714Sjkim    const char              *Path,
668114237Snjl    UINT32                  ExpectedReturnBtypes,
669114237Snjl    ACPI_OPERAND_OBJECT     **ReturnDesc);
670114237Snjl
671114237SnjlACPI_STATUS
67277424SmsmithAcpiUtEvaluateNumericObject (
673298714Sjkim    const char              *ObjectName,
67467754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
675202771Sjkim    UINT64                  *Value);
67667754Smsmith
67767754SmsmithACPI_STATUS
678197104SjkimAcpiUtExecute_STA (
67967754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
680197104Sjkim    UINT32                  *StatusFlags);
68167754Smsmith
68267754SmsmithACPI_STATUS
683197104SjkimAcpiUtExecutePowerMethods (
68487031Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
685197104Sjkim    const char              **MethodNames,
686197104Sjkim    UINT8                   MethodCount,
687197104Sjkim    UINT8                   *OutValues);
68887031Smsmith
689197104Sjkim
690197104Sjkim/*
691197104Sjkim * utids - device ID support
692197104Sjkim */
69387031SmsmithACPI_STATUS
694197104SjkimAcpiUtExecute_HID (
69567754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
696241973Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
69767754Smsmith
69867754SmsmithACPI_STATUS
69977424SmsmithAcpiUtExecute_UID (
70067754Smsmith    ACPI_NAMESPACE_NODE     *DeviceNode,
701241973Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
70267754Smsmith
703126372SnjlACPI_STATUS
704197104SjkimAcpiUtExecute_CID (
705126372Snjl    ACPI_NAMESPACE_NODE     *DeviceNode,
706241973Sjkim    ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
70767754Smsmith
708284583SjkimACPI_STATUS
709284583SjkimAcpiUtExecute_CLS (
710284583Sjkim    ACPI_NAMESPACE_NODE     *DeviceNode,
711284583Sjkim    ACPI_PNP_DEVICE_ID      **ReturnId);
712197104Sjkim
713284583Sjkim
714193267Sjkim/*
715193267Sjkim * utlock - reader/writer locks
716193267Sjkim */
717193267SjkimACPI_STATUS
718193267SjkimAcpiUtCreateRwLock (
719193267Sjkim    ACPI_RW_LOCK            *Lock);
72067754Smsmith
721193267Sjkimvoid
722193267SjkimAcpiUtDeleteRwLock (
723193267Sjkim    ACPI_RW_LOCK            *Lock);
724193267Sjkim
725193267SjkimACPI_STATUS
726193267SjkimAcpiUtAcquireReadLock (
727193267Sjkim    ACPI_RW_LOCK            *Lock);
728193267Sjkim
729193267SjkimACPI_STATUS
730193267SjkimAcpiUtReleaseReadLock (
731193267Sjkim    ACPI_RW_LOCK            *Lock);
732193267Sjkim
733193267SjkimACPI_STATUS
734193267SjkimAcpiUtAcquireWriteLock (
735193267Sjkim    ACPI_RW_LOCK            *Lock);
736193267Sjkim
737193267Sjkimvoid
738193267SjkimAcpiUtReleaseWriteLock (
739193267Sjkim    ACPI_RW_LOCK            *Lock);
740193267Sjkim
741193267Sjkim
74267754Smsmith/*
743151937Sjkim * utobject - internal object create/delete/cache routines
74467754Smsmith */
74583174SmsmithACPI_OPERAND_OBJECT  *
74683174SmsmithAcpiUtCreateInternalObjectDbg (
747193267Sjkim    const char              *ModuleName,
74883174Smsmith    UINT32                  LineNumber,
74983174Smsmith    UINT32                  ComponentId,
75091116Smsmith    ACPI_OBJECT_TYPE        Type);
75183174Smsmith
75267754Smsmithvoid *
75383174SmsmithAcpiUtAllocateObjectDescDbg (
754193267Sjkim    const char              *ModuleName,
75567754Smsmith    UINT32                  LineNumber,
75667754Smsmith    UINT32                  ComponentId);
75767754Smsmith
758151937Sjkim#define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
759151937Sjkim#define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
76067754Smsmith
76167754Smsmithvoid
76277424SmsmithAcpiUtDeleteObjectDesc (
76367754Smsmith    ACPI_OPERAND_OBJECT     *Object);
76467754Smsmith
76567754SmsmithBOOLEAN
76677424SmsmithAcpiUtValidInternalObject (
76767754Smsmith    void                    *Object);
76867754Smsmith
769107325SiwasakiACPI_OPERAND_OBJECT *
770193267SjkimAcpiUtCreatePackageObject (
771193267Sjkim    UINT32                  Count);
772193267Sjkim
773193267SjkimACPI_OPERAND_OBJECT *
774199337SjkimAcpiUtCreateIntegerObject (
775199337Sjkim    UINT64                  Value);
776199337Sjkim
777199337SjkimACPI_OPERAND_OBJECT *
778107325SiwasakiAcpiUtCreateBufferObject (
779107325Siwasaki    ACPI_SIZE               BufferSize);
78067754Smsmith
781138287SmarksACPI_OPERAND_OBJECT *
782138287SmarksAcpiUtCreateStringObject (
783138287Smarks    ACPI_SIZE               StringSize);
784107325Siwasaki
78567754SmsmithACPI_STATUS
78677424SmsmithAcpiUtGetObjectSize(
78767754Smsmith    ACPI_OPERAND_OBJECT     *Obj,
78891116Smsmith    ACPI_SIZE               *ObjLength);
78967754Smsmith
79067754Smsmith
79167754Smsmith/*
792210976Sjkim * utosi - Support for the _OSI predefined control method
793210976Sjkim */
794210976SjkimACPI_STATUS
795210976SjkimAcpiUtInitializeInterfaces (
796210976Sjkim    void);
797210976Sjkim
798249112SjkimACPI_STATUS
799210976SjkimAcpiUtInterfaceTerminate (
800210976Sjkim    void);
801210976Sjkim
802210976SjkimACPI_STATUS
803210976SjkimAcpiUtInstallInterface (
804210976Sjkim    ACPI_STRING             InterfaceName);
805210976Sjkim
806210976SjkimACPI_STATUS
807210976SjkimAcpiUtRemoveInterface (
808210976Sjkim    ACPI_STRING             InterfaceName);
809210976Sjkim
810253690SjkimACPI_STATUS
811253690SjkimAcpiUtUpdateInterfaces (
812253690Sjkim    UINT8                   Action);
813253690Sjkim
814210976SjkimACPI_INTERFACE_INFO *
815210976SjkimAcpiUtGetInterface (
816210976Sjkim    ACPI_STRING             InterfaceName);
817210976Sjkim
818210976SjkimACPI_STATUS
819210976SjkimAcpiUtOsiImplementation (
820210976Sjkim    ACPI_WALK_STATE         *WalkState);
821210976Sjkim
822210976Sjkim
823210976Sjkim/*
824249112Sjkim * utpredef - support for predefined names
825249112Sjkim */
826249112Sjkimconst ACPI_PREDEFINED_INFO *
827249112SjkimAcpiUtGetNextPredefinedMethod (
828249112Sjkim    const ACPI_PREDEFINED_INFO  *ThisName);
829249112Sjkim
830249112Sjkimconst ACPI_PREDEFINED_INFO *
831249112SjkimAcpiUtMatchPredefinedMethod (
832249112Sjkim    char                        *Name);
833249112Sjkim
834281396Sjkimvoid
835281396SjkimAcpiUtGetExpectedReturnTypes (
836281396Sjkim    char                    *Buffer,
837281396Sjkim    UINT32                  ExpectedBtypes);
838281396Sjkim
839281396Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
840249112Sjkimconst ACPI_PREDEFINED_INFO *
841249112SjkimAcpiUtMatchResourceName (
842249112Sjkim    char                        *Name);
843249112Sjkim
844249112Sjkimvoid
845249112SjkimAcpiUtDisplayPredefinedMethod (
846249112Sjkim    char                        *Buffer,
847249112Sjkim    const ACPI_PREDEFINED_INFO  *ThisName,
848249112Sjkim    BOOLEAN                     MultiLine);
849249112Sjkim
850249112SjkimUINT32
851249112SjkimAcpiUtGetResourceBitWidth (
852249112Sjkim    char                    *Buffer,
853249112Sjkim    UINT16                  Types);
854281396Sjkim#endif
855249112Sjkim
856249112Sjkim
857249112Sjkim/*
858151937Sjkim * utstate - Generic state creation/cache routines
85967754Smsmith */
86067754Smsmithvoid
86177424SmsmithAcpiUtPushGenericState (
86267754Smsmith    ACPI_GENERIC_STATE      **ListHead,
86367754Smsmith    ACPI_GENERIC_STATE      *State);
86467754Smsmith
86567754SmsmithACPI_GENERIC_STATE *
86677424SmsmithAcpiUtPopGenericState (
86767754Smsmith    ACPI_GENERIC_STATE      **ListHead);
86867754Smsmith
86967754Smsmith
87067754SmsmithACPI_GENERIC_STATE *
87177424SmsmithAcpiUtCreateGenericState (
87267754Smsmith    void);
87367754Smsmith
87487031SmsmithACPI_THREAD_STATE *
87587031SmsmithAcpiUtCreateThreadState (
87687031Smsmith    void);
87787031Smsmith
87867754SmsmithACPI_GENERIC_STATE *
87977424SmsmithAcpiUtCreateUpdateState (
88067754Smsmith    ACPI_OPERAND_OBJECT     *Object,
88167754Smsmith    UINT16                  Action);
88267754Smsmith
88373561SmsmithACPI_GENERIC_STATE *
88477424SmsmithAcpiUtCreatePkgState (
88573561Smsmith    void                    *InternalObject,
88673561Smsmith    void                    *ExternalObject,
887322877Sjkim    UINT32                  Index);
88873561Smsmith
88967754SmsmithACPI_STATUS
89077424SmsmithAcpiUtCreateUpdateStateAndPush (
89167754Smsmith    ACPI_OPERAND_OBJECT     *Object,
89267754Smsmith    UINT16                  Action,
89367754Smsmith    ACPI_GENERIC_STATE      **StateList);
89467754Smsmith
89567754SmsmithACPI_GENERIC_STATE *
89677424SmsmithAcpiUtCreateControlState (
89767754Smsmith    void);
89867754Smsmith
89967754Smsmithvoid
90077424SmsmithAcpiUtDeleteGenericState (
90167754Smsmith    ACPI_GENERIC_STATE      *State);
90267754Smsmith
90367754Smsmith
90467754Smsmith/*
905151937Sjkim * utmath
90667754Smsmith */
90784491SmsmithACPI_STATUS
90884491SmsmithAcpiUtDivide (
909202771Sjkim    UINT64                  InDividend,
910202771Sjkim    UINT64                  InDivisor,
911202771Sjkim    UINT64                  *OutQuotient,
912202771Sjkim    UINT64                  *OutRemainder);
91384491Smsmith
91484491SmsmithACPI_STATUS
91584491SmsmithAcpiUtShortDivide (
916202771Sjkim    UINT64                  InDividend,
91784491Smsmith    UINT32                  Divisor,
918202771Sjkim    UINT64                  *OutQuotient,
91984491Smsmith    UINT32                  *OutRemainder);
92084491Smsmith
921322877SjkimACPI_STATUS
922322877SjkimAcpiUtShortMultiply (
923322877Sjkim    UINT64                  InMultiplicand,
924322877Sjkim    UINT32                  Multiplier,
925322877Sjkim    UINT64                  *Outproduct);
926246849Sjkim
927322877SjkimACPI_STATUS
928322877SjkimAcpiUtShortShiftLeft (
929322877Sjkim    UINT64                  Operand,
930322877Sjkim    UINT32                  Count,
931322877Sjkim    UINT64                  *OutResult);
932322877Sjkim
933322877SjkimACPI_STATUS
934322877SjkimAcpiUtShortShiftRight (
935322877Sjkim    UINT64                  Operand,
936322877Sjkim    UINT32                  Count,
937322877Sjkim    UINT64                  *OutResult);
938322877Sjkim
939322877Sjkim
940151937Sjkim/*
941151937Sjkim * utmisc
942151937Sjkim */
943246849Sjkimconst ACPI_EXCEPTION_INFO *
944167802SjkimAcpiUtValidateException (
945167802Sjkim    ACPI_STATUS             Status);
946167802Sjkim
947167802SjkimBOOLEAN
948197104SjkimAcpiUtIsPciRootBridge (
949197104Sjkim    char                    *Id);
950197104Sjkim
951287168Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
952197104SjkimBOOLEAN
953167802SjkimAcpiUtIsAmlTable (
954167802Sjkim    ACPI_TABLE_HEADER       *Table);
955281396Sjkim#endif
956167802Sjkim
957151937SjkimACPI_STATUS
958151937SjkimAcpiUtWalkPackageTree (
959151937Sjkim    ACPI_OPERAND_OBJECT     *SourceObject,
960151937Sjkim    void                    *TargetObject,
961151937Sjkim    ACPI_PKG_CALLBACK       WalkCallback,
962151937Sjkim    void                    *Context);
963151937Sjkim
964138287Smarks/* Values for Base above (16=Hex, 10=Decimal) */
965138287Smarks
966138287Smarks#define ACPI_ANY_BASE        0
967138287Smarks
968285797Sjkim
969151937SjkimUINT32
97099679SiwasakiAcpiUtDwordByteSwap (
97199679Siwasaki    UINT32                  Value);
97299679Siwasaki
97399679Siwasakivoid
97499679SiwasakiAcpiUtSetIntegerWidth (
97599679Siwasaki    UINT8                   Revision);
97699679Siwasaki
977102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT
97873561Smsmithvoid
97977424SmsmithAcpiUtDisplayInitPathname (
980114237Snjl    UINT8                   Type,
981114237Snjl    ACPI_NAMESPACE_NODE     *ObjHandle,
982298714Sjkim    const char              *Path);
98373561Smsmith#endif
98473561Smsmith
98573561Smsmith
98667754Smsmith/*
987245582Sjkim * utownerid - Support for Table/Method Owner IDs
988245582Sjkim */
989245582SjkimACPI_STATUS
990245582SjkimAcpiUtAllocateOwnerId (
991245582Sjkim    ACPI_OWNER_ID           *OwnerId);
992245582Sjkim
993245582Sjkimvoid
994245582SjkimAcpiUtReleaseOwnerId (
995245582Sjkim    ACPI_OWNER_ID           *OwnerId);
996245582Sjkim
997245582Sjkim
998245582Sjkim/*
999167802Sjkim * utresrc
1000167802Sjkim */
1001167802SjkimACPI_STATUS
1002167802SjkimAcpiUtWalkAmlResources (
1003243347Sjkim    ACPI_WALK_STATE         *WalkState,
1004167802Sjkim    UINT8                   *Aml,
1005167802Sjkim    ACPI_SIZE               AmlLength,
1006167802Sjkim    ACPI_WALK_AML_CALLBACK  UserFunction,
1007245582Sjkim    void                    **Context);
1008167802Sjkim
1009167802SjkimACPI_STATUS
1010167802SjkimAcpiUtValidateResource (
1011243347Sjkim    ACPI_WALK_STATE         *WalkState,
1012167802Sjkim    void                    *Aml,
1013167802Sjkim    UINT8                   *ReturnIndex);
1014167802Sjkim
1015167802SjkimUINT32
1016167802SjkimAcpiUtGetDescriptorLength (
1017167802Sjkim    void                    *Aml);
1018167802Sjkim
1019167802SjkimUINT16
1020167802SjkimAcpiUtGetResourceLength (
1021167802Sjkim    void                    *Aml);
1022167802Sjkim
1023167802SjkimUINT8
1024167802SjkimAcpiUtGetResourceHeaderLength (
1025167802Sjkim    void                    *Aml);
1026167802Sjkim
1027167802SjkimUINT8
1028167802SjkimAcpiUtGetResourceType (
1029167802Sjkim    void                    *Aml);
1030167802Sjkim
1031167802SjkimACPI_STATUS
1032167802SjkimAcpiUtGetResourceEndTag (
1033167802Sjkim    ACPI_OPERAND_OBJECT     *ObjDesc,
1034167802Sjkim    UINT8                   **EndTag);
1035167802Sjkim
1036167802Sjkim
1037167802Sjkim/*
1038245582Sjkim * utstring - String and character utilities
1039245582Sjkim */
1040245582Sjkimvoid
1041245582SjkimAcpiUtPrintString (
1042245582Sjkim    char                    *String,
1043252279Sjkim    UINT16                  MaxLength);
1044245582Sjkim
1045281396Sjkim#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
1046245582Sjkimvoid
1047245582SjkimUtConvertBackslashes (
1048245582Sjkim    char                    *Pathname);
1049281396Sjkim#endif
1050245582Sjkim
1051245582Sjkimvoid
1052245582SjkimAcpiUtRepairName (
1053245582Sjkim    char                    *Name);
1054245582Sjkim
1055272444Sjkim#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
1056272444SjkimBOOLEAN
1057272444SjkimAcpiUtSafeStrcpy (
1058272444Sjkim    char                    *Dest,
1059272444Sjkim    ACPI_SIZE               DestSize,
1060272444Sjkim    char                    *Source);
1061245582Sjkim
1062327557Sjkimvoid
1063327557SjkimAcpiUtSafeStrncpy (
1064327557Sjkim    char                    *Dest,
1065327557Sjkim    char                    *Source,
1066327557Sjkim    ACPI_SIZE               DestSize);
1067327557Sjkim
1068272444SjkimBOOLEAN
1069272444SjkimAcpiUtSafeStrcat (
1070272444Sjkim    char                    *Dest,
1071272444Sjkim    ACPI_SIZE               DestSize,
1072272444Sjkim    char                    *Source);
1073298714Sjkim
1074298714SjkimBOOLEAN
1075298714SjkimAcpiUtSafeStrncat (
1076298714Sjkim    char                    *Dest,
1077298714Sjkim    ACPI_SIZE               DestSize,
1078298714Sjkim    char                    *Source,
1079298714Sjkim    ACPI_SIZE               MaxTransferLength);
1080272444Sjkim#endif
1081272444Sjkim
1082272444Sjkim
1083245582Sjkim/*
1084151937Sjkim * utmutex - mutex support
108567754Smsmith */
1086151937SjkimACPI_STATUS
1087151937SjkimAcpiUtMutexInitialize (
1088151937Sjkim    void);
108967754Smsmith
109082367Smsmithvoid
1091151937SjkimAcpiUtMutexTerminate (
1092151937Sjkim    void);
109382367Smsmith
1094151937SjkimACPI_STATUS
1095151937SjkimAcpiUtAcquireMutex (
1096151937Sjkim    ACPI_MUTEX_HANDLE       MutexId);
109782367Smsmith
109891116SmsmithACPI_STATUS
1099151937SjkimAcpiUtReleaseMutex (
1100151937Sjkim    ACPI_MUTEX_HANDLE       MutexId);
1101151937Sjkim
1102151937Sjkim
1103151937Sjkim/*
1104151937Sjkim * utalloc - memory allocation and object caching
1105151937Sjkim */
1106151937SjkimACPI_STATUS
1107151937SjkimAcpiUtCreateCaches (
1108151937Sjkim    void);
1109151937Sjkim
1110151937SjkimACPI_STATUS
1111151937SjkimAcpiUtDeleteCaches (
1112151937Sjkim    void);
1113151937Sjkim
1114151937SjkimACPI_STATUS
111591116SmsmithAcpiUtValidateBuffer (
111691116Smsmith    ACPI_BUFFER             *Buffer);
111782367Smsmith
111891116SmsmithACPI_STATUS
111991116SmsmithAcpiUtInitializeBuffer (
112091116Smsmith    ACPI_BUFFER             *Buffer,
112191116Smsmith    ACPI_SIZE               RequiredLength);
112282367Smsmith
112391116Smsmith#ifdef ACPI_DBG_TRACK_ALLOCATIONS
112491116Smsmithvoid *
112591116SmsmithAcpiUtAllocateAndTrack (
112691116Smsmith    ACPI_SIZE               Size,
112791116Smsmith    UINT32                  Component,
1128193267Sjkim    const char              *Module,
112991116Smsmith    UINT32                  Line);
113091116Smsmith
113191116Smsmithvoid *
1132167802SjkimAcpiUtAllocateZeroedAndTrack (
113391116Smsmith    ACPI_SIZE               Size,
113491116Smsmith    UINT32                  Component,
1135193267Sjkim    const char              *Module,
113691116Smsmith    UINT32                  Line);
113791116Smsmith
113867754Smsmithvoid
113991116SmsmithAcpiUtFreeAndTrack (
114067754Smsmith    void                    *Address,
114167754Smsmith    UINT32                  Component,
1142193267Sjkim    const char              *Module,
114367754Smsmith    UINT32                  Line);
114499679Siwasaki
114567754Smsmithvoid
114677424SmsmithAcpiUtDumpAllocationInfo (
114767754Smsmith    void);
114867754Smsmith
114967754Smsmithvoid
115084491SmsmithAcpiUtDumpAllocations (
115167754Smsmith    UINT32                  Component,
1152193267Sjkim    const char              *Module);
1153167802Sjkim
1154167802SjkimACPI_STATUS
1155167802SjkimAcpiUtCreateList (
1156298714Sjkim    const char              *ListName,
1157167802Sjkim    UINT16                  ObjectSize,
1158167802Sjkim    ACPI_MEMORY_LIST        **ReturnCache);
1159167802Sjkim
1160212761Sjkim#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
1161167802Sjkim
1162285797Sjkim
1163229989Sjkim/*
1164229989Sjkim * utaddress - address range check
1165229989Sjkim */
1166229989SjkimACPI_STATUS
1167229989SjkimAcpiUtAddAddressRange (
1168229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1169229989Sjkim    ACPI_PHYSICAL_ADDRESS   Address,
1170229989Sjkim    UINT32                  Length,
1171229989Sjkim    ACPI_NAMESPACE_NODE     *RegionNode);
117267754Smsmith
1173229989Sjkimvoid
1174229989SjkimAcpiUtRemoveAddressRange (
1175229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1176229989Sjkim    ACPI_NAMESPACE_NODE     *RegionNode);
1177229989Sjkim
1178229989SjkimUINT32
1179229989SjkimAcpiUtCheckAddressRange (
1180229989Sjkim    ACPI_ADR_SPACE_TYPE     SpaceId,
1181229989Sjkim    ACPI_PHYSICAL_ADDRESS   Address,
1182229989Sjkim    UINT32                  Length,
1183229989Sjkim    BOOLEAN                 Warn);
1184229989Sjkim
1185229989Sjkimvoid
1186229989SjkimAcpiUtDeleteAddressLists (
1187229989Sjkim    void);
1188229989Sjkim
1189285797Sjkim
1190212761Sjkim/*
1191212761Sjkim * utxferror - various error/warning output functions
1192212761Sjkim */
1193212761Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1194212761SjkimAcpiUtPredefinedWarning (
1195212761Sjkim    const char              *ModuleName,
1196212761Sjkim    UINT32                  LineNumber,
1197212761Sjkim    char                    *Pathname,
1198212761Sjkim    UINT8                   NodeFlags,
1199212761Sjkim    const char              *Format,
1200212761Sjkim    ...);
1201212761Sjkim
1202212761Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1203212761SjkimAcpiUtPredefinedInfo (
1204212761Sjkim    const char              *ModuleName,
1205212761Sjkim    UINT32                  LineNumber,
1206212761Sjkim    char                    *Pathname,
1207212761Sjkim    UINT8                   NodeFlags,
1208212761Sjkim    const char              *Format,
1209212761Sjkim    ...);
1210212761Sjkim
1211249663Sjkimvoid ACPI_INTERNAL_VAR_XFACE
1212249663SjkimAcpiUtPredefinedBiosError (
1213249663Sjkim    const char              *ModuleName,
1214249663Sjkim    UINT32                  LineNumber,
1215249663Sjkim    char                    *Pathname,
1216249663Sjkim    UINT8                   NodeFlags,
1217249663Sjkim    const char              *Format,
1218249663Sjkim    ...);
1219249663Sjkim
1220212761Sjkimvoid
1221327557SjkimAcpiUtPrefixedNamespaceError (
1222212761Sjkim    const char              *ModuleName,
1223212761Sjkim    UINT32                  LineNumber,
1224327557Sjkim    ACPI_GENERIC_STATE      *PrefixScope,
1225212761Sjkim    const char              *InternalName,
1226212761Sjkim    ACPI_STATUS             LookupStatus);
1227212761Sjkim
1228212761Sjkimvoid
1229212761SjkimAcpiUtMethodError (
1230212761Sjkim    const char              *ModuleName,
1231212761Sjkim    UINT32                  LineNumber,
1232212761Sjkim    const char              *Message,
1233212761Sjkim    ACPI_NAMESPACE_NODE     *Node,
1234212761Sjkim    const char              *Path,
1235212761Sjkim    ACPI_STATUS             LookupStatus);
1236212761Sjkim
1237285797Sjkim
1238272444Sjkim/*
1239272444Sjkim * Utility functions for ACPI names and IDs
1240272444Sjkim */
1241272444Sjkimconst AH_PREDEFINED_NAME *
1242272444SjkimAcpiAhMatchPredefinedName (
1243272444Sjkim    char                    *Nameseg);
1244272444Sjkim
1245272444Sjkimconst AH_DEVICE_ID *
1246272444SjkimAcpiAhMatchHardwareId (
1247272444Sjkim    char                    *Hid);
1248272444Sjkim
1249272444Sjkimconst char *
1250272444SjkimAcpiAhMatchUuid (
1251272444Sjkim    UINT8                   *Data);
1252272444Sjkim
1253285797Sjkim
1254272444Sjkim/*
1255272444Sjkim * utuuid -- UUID support functions
1256272444Sjkim */
1257281396Sjkim#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
1258272444Sjkimvoid
1259272444SjkimAcpiUtConvertStringToUuid (
1260272444Sjkim    char                    *InString,
1261272444Sjkim    UINT8                   *UuidBuffer);
1262281396Sjkim#endif
1263272444Sjkim
126477424Smsmith#endif /* _ACUTILS_H */
1265