xref: /freebsd/sys/contrib/dev/acpica/include/acutils.h (revision 709fac06161594e03e54a1075a2ee7e064053cb7)
1a9f12690SJung-uk Kim /******************************************************************************
2a9f12690SJung-uk Kim  *
3a9f12690SJung-uk Kim  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4a9f12690SJung-uk Kim  *
5a9f12690SJung-uk Kim  *****************************************************************************/
6a9f12690SJung-uk Kim 
7a9f12690SJung-uk Kim /******************************************************************************
8a9f12690SJung-uk Kim  *
9a9f12690SJung-uk Kim  * 1. Copyright Notice
10a9f12690SJung-uk Kim  *
119a179dd8SJung-uk Kim  * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
12a9f12690SJung-uk Kim  * All rights reserved.
13a9f12690SJung-uk Kim  *
14a9f12690SJung-uk Kim  * 2. License
15a9f12690SJung-uk Kim  *
16a9f12690SJung-uk Kim  * 2.1. This is your license from Intel Corp. under its intellectual property
17a9f12690SJung-uk Kim  * rights.  You may have additional license terms from the party that provided
18a9f12690SJung-uk Kim  * you this software, covering your right to use that party's intellectual
19a9f12690SJung-uk Kim  * property rights.
20a9f12690SJung-uk Kim  *
21a9f12690SJung-uk Kim  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22a9f12690SJung-uk Kim  * copy of the source code appearing in this file ("Covered Code") an
23a9f12690SJung-uk Kim  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24a9f12690SJung-uk Kim  * base code distributed originally by Intel ("Original Intel Code") to copy,
25a9f12690SJung-uk Kim  * make derivatives, distribute, use and display any portion of the Covered
26a9f12690SJung-uk Kim  * Code in any form, with the right to sublicense such rights; and
27a9f12690SJung-uk Kim  *
28a9f12690SJung-uk Kim  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29a9f12690SJung-uk Kim  * license (with the right to sublicense), under only those claims of Intel
30a9f12690SJung-uk Kim  * patents that are infringed by the Original Intel Code, to make, use, sell,
31a9f12690SJung-uk Kim  * offer to sell, and import the Covered Code and derivative works thereof
32a9f12690SJung-uk Kim  * solely to the minimum extent necessary to exercise the above copyright
33a9f12690SJung-uk Kim  * license, and in no event shall the patent license extend to any additions
34a9f12690SJung-uk Kim  * to or modifications of the Original Intel Code.  No other license or right
35a9f12690SJung-uk Kim  * is granted directly or by implication, estoppel or otherwise;
36a9f12690SJung-uk Kim  *
37a9f12690SJung-uk Kim  * The above copyright and patent license is granted only if the following
38a9f12690SJung-uk Kim  * conditions are met:
39a9f12690SJung-uk Kim  *
40a9f12690SJung-uk Kim  * 3. Conditions
41a9f12690SJung-uk Kim  *
42a9f12690SJung-uk Kim  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
44a9f12690SJung-uk Kim  * Code or modification with rights to further distribute source must include
45a9f12690SJung-uk Kim  * the above Copyright Notice, the above License, this list of Conditions,
46a9f12690SJung-uk Kim  * and the following Disclaimer and Export Compliance provision.  In addition,
47a9f12690SJung-uk Kim  * Licensee must cause all Covered Code to which Licensee contributes to
48a9f12690SJung-uk Kim  * contain a file documenting the changes Licensee made to create that Covered
49a9f12690SJung-uk Kim  * Code and the date of any change.  Licensee must include in that file the
50a9f12690SJung-uk Kim  * documentation of any changes made by any predecessor Licensee.  Licensee
51a9f12690SJung-uk Kim  * must include a prominent statement that the modification is derived,
52a9f12690SJung-uk Kim  * directly or indirectly, from Original Intel Code.
53a9f12690SJung-uk Kim  *
54a9f12690SJung-uk Kim  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
56a9f12690SJung-uk Kim  * Code or modification without rights to further distribute source must
57a9f12690SJung-uk Kim  * include the following Disclaimer and Export Compliance provision in the
58a9f12690SJung-uk Kim  * documentation and/or other materials provided with distribution.  In
59a9f12690SJung-uk Kim  * addition, Licensee may not authorize further sublicense of source of any
60a9f12690SJung-uk Kim  * portion of the Covered Code, and must include terms to the effect that the
61a9f12690SJung-uk Kim  * license from Licensee to its licensee is limited to the intellectual
62a9f12690SJung-uk Kim  * property embodied in the software Licensee provides to its licensee, and
63a9f12690SJung-uk Kim  * not to intellectual property embodied in modifications its licensee may
64a9f12690SJung-uk Kim  * make.
65a9f12690SJung-uk Kim  *
66a9f12690SJung-uk Kim  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67a9f12690SJung-uk Kim  * substantial portion of the Covered Code or modification must reproduce the
68a9f12690SJung-uk Kim  * above Copyright Notice, and the following Disclaimer and Export Compliance
69a9f12690SJung-uk Kim  * provision in the documentation and/or other materials provided with the
70a9f12690SJung-uk Kim  * distribution.
71a9f12690SJung-uk Kim  *
72a9f12690SJung-uk Kim  * 3.4. Intel retains all right, title, and interest in and to the Original
73a9f12690SJung-uk Kim  * Intel Code.
74a9f12690SJung-uk Kim  *
75a9f12690SJung-uk Kim  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76a9f12690SJung-uk Kim  * Intel shall be used in advertising or otherwise to promote the sale, use or
77a9f12690SJung-uk Kim  * other dealings in products derived from or relating to the Covered Code
78a9f12690SJung-uk Kim  * without prior written authorization from Intel.
79a9f12690SJung-uk Kim  *
80a9f12690SJung-uk Kim  * 4. Disclaimer and Export Compliance
81a9f12690SJung-uk Kim  *
82a9f12690SJung-uk Kim  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83a9f12690SJung-uk Kim  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84a9f12690SJung-uk Kim  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
85a9f12690SJung-uk Kim  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
86a9f12690SJung-uk Kim  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
87a9f12690SJung-uk Kim  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88a9f12690SJung-uk Kim  * PARTICULAR PURPOSE.
89a9f12690SJung-uk Kim  *
90a9f12690SJung-uk Kim  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91a9f12690SJung-uk Kim  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92a9f12690SJung-uk Kim  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93a9f12690SJung-uk Kim  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94a9f12690SJung-uk Kim  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95a9f12690SJung-uk Kim  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96a9f12690SJung-uk Kim  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97a9f12690SJung-uk Kim  * LIMITED REMEDY.
98a9f12690SJung-uk Kim  *
99a9f12690SJung-uk Kim  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100a9f12690SJung-uk Kim  * software or system incorporating such software without first obtaining any
101a9f12690SJung-uk Kim  * required license or other approval from the U. S. Department of Commerce or
102a9f12690SJung-uk Kim  * any other agency or department of the United States Government.  In the
103a9f12690SJung-uk Kim  * event Licensee exports any such software from the United States or
104a9f12690SJung-uk Kim  * re-exports any such software from a foreign destination, Licensee shall
105a9f12690SJung-uk Kim  * ensure that the distribution and export/re-export of the software is in
106a9f12690SJung-uk Kim  * compliance with all laws, regulations, orders, or other restrictions of the
107a9f12690SJung-uk Kim  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108a9f12690SJung-uk Kim  * any of its subsidiaries will export/re-export any technical data, process,
109a9f12690SJung-uk Kim  * software, or service, directly or indirectly, to any country for which the
110a9f12690SJung-uk Kim  * United States government or any agency thereof requires an export license,
111a9f12690SJung-uk Kim  * other governmental approval, or letter of assurance, without first obtaining
112a9f12690SJung-uk Kim  * such license, approval or letter.
113a9f12690SJung-uk Kim  *
114a9f12690SJung-uk Kim  *****************************************************************************/
115a9f12690SJung-uk Kim 
116a9f12690SJung-uk Kim #ifndef _ACUTILS_H
117a9f12690SJung-uk Kim #define _ACUTILS_H
118a9f12690SJung-uk Kim 
119a9f12690SJung-uk Kim 
120a9f12690SJung-uk Kim extern const UINT8                      AcpiGbl_ResourceAmlSizes[];
121a9f12690SJung-uk Kim 
122a9f12690SJung-uk Kim /* Strings used by the disassembler and debugger resource dump routines */
123a9f12690SJung-uk Kim 
124a9f12690SJung-uk Kim #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
125a9f12690SJung-uk Kim 
126a9f12690SJung-uk Kim extern const char                       *AcpiGbl_BmDecode[];
127a9f12690SJung-uk Kim extern const char                       *AcpiGbl_ConfigDecode[];
128a9f12690SJung-uk Kim extern const char                       *AcpiGbl_ConsumeDecode[];
129a9f12690SJung-uk Kim extern const char                       *AcpiGbl_DecDecode[];
130a9f12690SJung-uk Kim extern const char                       *AcpiGbl_HeDecode[];
131a9f12690SJung-uk Kim extern const char                       *AcpiGbl_IoDecode[];
132a9f12690SJung-uk Kim extern const char                       *AcpiGbl_LlDecode[];
133a9f12690SJung-uk Kim extern const char                       *AcpiGbl_MaxDecode[];
134a9f12690SJung-uk Kim extern const char                       *AcpiGbl_MemDecode[];
135a9f12690SJung-uk Kim extern const char                       *AcpiGbl_MinDecode[];
136a9f12690SJung-uk Kim extern const char                       *AcpiGbl_MtpDecode[];
137a9f12690SJung-uk Kim extern const char                       *AcpiGbl_RngDecode[];
138a9f12690SJung-uk Kim extern const char                       *AcpiGbl_RwDecode[];
139a9f12690SJung-uk Kim extern const char                       *AcpiGbl_ShrDecode[];
140a9f12690SJung-uk Kim extern const char                       *AcpiGbl_SizDecode[];
141a9f12690SJung-uk Kim extern const char                       *AcpiGbl_TrsDecode[];
142a9f12690SJung-uk Kim extern const char                       *AcpiGbl_TtpDecode[];
143a9f12690SJung-uk Kim extern const char                       *AcpiGbl_TypDecode[];
144a9f12690SJung-uk Kim #endif
145a9f12690SJung-uk Kim 
146a9f12690SJung-uk Kim /* Types for Resource descriptor entries */
147a9f12690SJung-uk Kim 
148a9f12690SJung-uk Kim #define ACPI_INVALID_RESOURCE           0
149a9f12690SJung-uk Kim #define ACPI_FIXED_LENGTH               1
150a9f12690SJung-uk Kim #define ACPI_VARIABLE_LENGTH            2
151a9f12690SJung-uk Kim #define ACPI_SMALL_VARIABLE_LENGTH      3
152a9f12690SJung-uk Kim 
153a9f12690SJung-uk Kim typedef
154a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
155a9f12690SJung-uk Kim     UINT8                   *Aml,
156a9f12690SJung-uk Kim     UINT32                  Length,
157a9f12690SJung-uk Kim     UINT32                  Offset,
158a9f12690SJung-uk Kim     UINT8                   ResourceIndex,
159a9f12690SJung-uk Kim     void                    *Context);
160a9f12690SJung-uk Kim 
161a9f12690SJung-uk Kim typedef
162a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_PKG_CALLBACK) (
163a9f12690SJung-uk Kim     UINT8                   ObjectType,
164a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *SourceObject,
165a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      *State,
166a9f12690SJung-uk Kim     void                    *Context);
167a9f12690SJung-uk Kim 
168a9f12690SJung-uk Kim typedef struct acpi_pkg_info
169a9f12690SJung-uk Kim {
170a9f12690SJung-uk Kim     UINT8                   *FreeSpace;
171a9f12690SJung-uk Kim     ACPI_SIZE               Length;
172a9f12690SJung-uk Kim     UINT32                  ObjectSpace;
173a9f12690SJung-uk Kim     UINT32                  NumPackages;
174a9f12690SJung-uk Kim 
175a9f12690SJung-uk Kim } ACPI_PKG_INFO;
176a9f12690SJung-uk Kim 
177a9f12690SJung-uk Kim #define REF_INCREMENT       (UINT16) 0
178a9f12690SJung-uk Kim #define REF_DECREMENT       (UINT16) 1
179a9f12690SJung-uk Kim #define REF_FORCE_DELETE    (UINT16) 2
180a9f12690SJung-uk Kim 
181a9f12690SJung-uk Kim /* AcpiUtDumpBuffer */
182a9f12690SJung-uk Kim 
183a9f12690SJung-uk Kim #define DB_BYTE_DISPLAY     1
184a9f12690SJung-uk Kim #define DB_WORD_DISPLAY     2
185a9f12690SJung-uk Kim #define DB_DWORD_DISPLAY    4
186a9f12690SJung-uk Kim #define DB_QWORD_DISPLAY    8
187a9f12690SJung-uk Kim 
188a9f12690SJung-uk Kim 
189a9f12690SJung-uk Kim /*
190a9f12690SJung-uk Kim  * utglobal - Global data structures and procedures
191a9f12690SJung-uk Kim  */
192a9f12690SJung-uk Kim ACPI_STATUS
193a9f12690SJung-uk Kim AcpiUtInitGlobals (
194a9f12690SJung-uk Kim     void);
195a9f12690SJung-uk Kim 
196a9f12690SJung-uk Kim #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
197a9f12690SJung-uk Kim 
198a9f12690SJung-uk Kim char *
199a9f12690SJung-uk Kim AcpiUtGetMutexName (
200a9f12690SJung-uk Kim     UINT32                  MutexId);
201a9f12690SJung-uk Kim 
202a9f12690SJung-uk Kim const char *
203a9f12690SJung-uk Kim AcpiUtGetNotifyName (
204a9f12690SJung-uk Kim     UINT32                  NotifyValue);
205a9f12690SJung-uk Kim 
206a9f12690SJung-uk Kim #endif
207a9f12690SJung-uk Kim 
208a9f12690SJung-uk Kim char *
209a9f12690SJung-uk Kim AcpiUtGetTypeName (
210a9f12690SJung-uk Kim     ACPI_OBJECT_TYPE        Type);
211a9f12690SJung-uk Kim 
212a9f12690SJung-uk Kim char *
213a9f12690SJung-uk Kim AcpiUtGetNodeName (
214a9f12690SJung-uk Kim     void                    *Object);
215a9f12690SJung-uk Kim 
216a9f12690SJung-uk Kim char *
217a9f12690SJung-uk Kim AcpiUtGetDescriptorName (
218a9f12690SJung-uk Kim     void                    *Object);
219a9f12690SJung-uk Kim 
220a9f12690SJung-uk Kim const char *
221a9f12690SJung-uk Kim AcpiUtGetReferenceName (
222a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
223a9f12690SJung-uk Kim 
224a9f12690SJung-uk Kim char *
225a9f12690SJung-uk Kim AcpiUtGetObjectTypeName (
226a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *ObjDesc);
227a9f12690SJung-uk Kim 
228a9f12690SJung-uk Kim char *
229a9f12690SJung-uk Kim AcpiUtGetRegionName (
230a9f12690SJung-uk Kim     UINT8                   SpaceId);
231a9f12690SJung-uk Kim 
232a9f12690SJung-uk Kim char *
233a9f12690SJung-uk Kim AcpiUtGetEventName (
234a9f12690SJung-uk Kim     UINT32                  EventId);
235a9f12690SJung-uk Kim 
236a9f12690SJung-uk Kim char
237a9f12690SJung-uk Kim AcpiUtHexToAsciiChar (
2389a179dd8SJung-uk Kim     UINT64                  Integer,
239a9f12690SJung-uk Kim     UINT32                  Position);
240a9f12690SJung-uk Kim 
241a9f12690SJung-uk Kim BOOLEAN
242a9f12690SJung-uk Kim AcpiUtValidObjectType (
243a9f12690SJung-uk Kim     ACPI_OBJECT_TYPE        Type);
244a9f12690SJung-uk Kim 
245a9f12690SJung-uk Kim 
246a9f12690SJung-uk Kim /*
247a9f12690SJung-uk Kim  * utinit - miscellaneous initialization and shutdown
248a9f12690SJung-uk Kim  */
249a9f12690SJung-uk Kim ACPI_STATUS
250a9f12690SJung-uk Kim AcpiUtHardwareInitialize (
251a9f12690SJung-uk Kim     void);
252a9f12690SJung-uk Kim 
253a9f12690SJung-uk Kim void
254a9f12690SJung-uk Kim AcpiUtSubsystemShutdown (
255a9f12690SJung-uk Kim     void);
256a9f12690SJung-uk Kim 
257a9f12690SJung-uk Kim 
258a9f12690SJung-uk Kim /*
259a9f12690SJung-uk Kim  * utclib - Local implementations of C library functions
260a9f12690SJung-uk Kim  */
261a9f12690SJung-uk Kim #ifndef ACPI_USE_SYSTEM_CLIBRARY
262a9f12690SJung-uk Kim 
263a9f12690SJung-uk Kim ACPI_SIZE
264a9f12690SJung-uk Kim AcpiUtStrlen (
265a9f12690SJung-uk Kim     const char              *String);
266a9f12690SJung-uk Kim 
267a9f12690SJung-uk Kim char *
268a9f12690SJung-uk Kim AcpiUtStrcpy (
269a9f12690SJung-uk Kim     char                    *DstString,
270a9f12690SJung-uk Kim     const char              *SrcString);
271a9f12690SJung-uk Kim 
272a9f12690SJung-uk Kim char *
273a9f12690SJung-uk Kim AcpiUtStrncpy (
274a9f12690SJung-uk Kim     char                    *DstString,
275a9f12690SJung-uk Kim     const char              *SrcString,
276a9f12690SJung-uk Kim     ACPI_SIZE               Count);
277a9f12690SJung-uk Kim 
278a9f12690SJung-uk Kim int
279a9f12690SJung-uk Kim AcpiUtMemcmp (
280a9f12690SJung-uk Kim     const char              *Buffer1,
281a9f12690SJung-uk Kim     const char              *Buffer2,
282a9f12690SJung-uk Kim     ACPI_SIZE               Count);
283a9f12690SJung-uk Kim 
284a9f12690SJung-uk Kim int
285a9f12690SJung-uk Kim AcpiUtStrncmp (
286a9f12690SJung-uk Kim     const char              *String1,
287a9f12690SJung-uk Kim     const char              *String2,
288a9f12690SJung-uk Kim     ACPI_SIZE               Count);
289a9f12690SJung-uk Kim 
290a9f12690SJung-uk Kim int
291a9f12690SJung-uk Kim AcpiUtStrcmp (
292a9f12690SJung-uk Kim     const char              *String1,
293a9f12690SJung-uk Kim     const char              *String2);
294a9f12690SJung-uk Kim 
295a9f12690SJung-uk Kim char *
296a9f12690SJung-uk Kim AcpiUtStrcat (
297a9f12690SJung-uk Kim     char                    *DstString,
298a9f12690SJung-uk Kim     const char              *SrcString);
299a9f12690SJung-uk Kim 
300a9f12690SJung-uk Kim char *
301a9f12690SJung-uk Kim AcpiUtStrncat (
302a9f12690SJung-uk Kim     char                    *DstString,
303a9f12690SJung-uk Kim     const char              *SrcString,
304a9f12690SJung-uk Kim     ACPI_SIZE               Count);
305a9f12690SJung-uk Kim 
306a9f12690SJung-uk Kim UINT32
307a9f12690SJung-uk Kim AcpiUtStrtoul (
308a9f12690SJung-uk Kim     const char              *String,
309a9f12690SJung-uk Kim     char                    **Terminator,
310a9f12690SJung-uk Kim     UINT32                  Base);
311a9f12690SJung-uk Kim 
312a9f12690SJung-uk Kim char *
313a9f12690SJung-uk Kim AcpiUtStrstr (
314a9f12690SJung-uk Kim     char                    *String1,
315a9f12690SJung-uk Kim     char                    *String2);
316a9f12690SJung-uk Kim 
317a9f12690SJung-uk Kim void *
318a9f12690SJung-uk Kim AcpiUtMemcpy (
319a9f12690SJung-uk Kim     void                    *Dest,
320a9f12690SJung-uk Kim     const void              *Src,
321a9f12690SJung-uk Kim     ACPI_SIZE               Count);
322a9f12690SJung-uk Kim 
323a9f12690SJung-uk Kim void *
324a9f12690SJung-uk Kim AcpiUtMemset (
325a9f12690SJung-uk Kim     void                    *Dest,
326a9f12690SJung-uk Kim     UINT8                   Value,
327a9f12690SJung-uk Kim     ACPI_SIZE               Count);
328a9f12690SJung-uk Kim 
329a9f12690SJung-uk Kim int
330a9f12690SJung-uk Kim AcpiUtToUpper (
331a9f12690SJung-uk Kim     int                     c);
332a9f12690SJung-uk Kim 
333a9f12690SJung-uk Kim int
334a9f12690SJung-uk Kim AcpiUtToLower (
335a9f12690SJung-uk Kim     int                     c);
336a9f12690SJung-uk Kim 
337a9f12690SJung-uk Kim extern const UINT8 _acpi_ctype[];
338a9f12690SJung-uk Kim 
339a9f12690SJung-uk Kim #define _ACPI_XA     0x00    /* extra alphabetic - not supported */
340a9f12690SJung-uk Kim #define _ACPI_XS     0x40    /* extra space */
341a9f12690SJung-uk Kim #define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
342a9f12690SJung-uk Kim #define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
343a9f12690SJung-uk Kim #define _ACPI_DI     0x04    /* '0'-'9' */
344a9f12690SJung-uk Kim #define _ACPI_LO     0x02    /* 'a'-'z' */
345a9f12690SJung-uk Kim #define _ACPI_PU     0x10    /* punctuation */
346a9f12690SJung-uk Kim #define _ACPI_SP     0x08    /* space */
347a9f12690SJung-uk Kim #define _ACPI_UP     0x01    /* 'A'-'Z' */
348a9f12690SJung-uk Kim #define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
349a9f12690SJung-uk Kim 
350a9f12690SJung-uk Kim #define ACPI_IS_DIGIT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
351a9f12690SJung-uk Kim #define ACPI_IS_SPACE(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
352a9f12690SJung-uk Kim #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
353a9f12690SJung-uk Kim #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
354a9f12690SJung-uk Kim #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
355a9f12690SJung-uk Kim #define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
356a9f12690SJung-uk Kim #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
357a9f12690SJung-uk Kim 
358a9f12690SJung-uk Kim #endif /* !ACPI_USE_SYSTEM_CLIBRARY */
359a9f12690SJung-uk Kim 
360a9f12690SJung-uk Kim #define ACPI_IS_ASCII(c)  ((c) < 0x80)
361a9f12690SJung-uk Kim 
362a9f12690SJung-uk Kim 
363a9f12690SJung-uk Kim /*
364a9f12690SJung-uk Kim  * utcopy - Object construction and conversion interfaces
365a9f12690SJung-uk Kim  */
366a9f12690SJung-uk Kim ACPI_STATUS
367a9f12690SJung-uk Kim AcpiUtBuildSimpleObject(
368a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Obj,
369a9f12690SJung-uk Kim     ACPI_OBJECT             *UserObj,
370a9f12690SJung-uk Kim     UINT8                   *DataSpace,
371a9f12690SJung-uk Kim     UINT32                  *BufferSpaceUsed);
372a9f12690SJung-uk Kim 
373a9f12690SJung-uk Kim ACPI_STATUS
374a9f12690SJung-uk Kim AcpiUtBuildPackageObject (
375a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Obj,
376a9f12690SJung-uk Kim     UINT8                   *Buffer,
377a9f12690SJung-uk Kim     UINT32                  *SpaceUsed);
378a9f12690SJung-uk Kim 
379a9f12690SJung-uk Kim ACPI_STATUS
380a9f12690SJung-uk Kim AcpiUtCopyIobjectToEobject (
381a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Obj,
382a9f12690SJung-uk Kim     ACPI_BUFFER             *RetBuffer);
383a9f12690SJung-uk Kim 
384a9f12690SJung-uk Kim ACPI_STATUS
385a9f12690SJung-uk Kim AcpiUtCopyEobjectToIobject (
386a9f12690SJung-uk Kim     ACPI_OBJECT             *Obj,
387a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     **InternalObj);
388a9f12690SJung-uk Kim 
389a9f12690SJung-uk Kim ACPI_STATUS
390a9f12690SJung-uk Kim AcpiUtCopyISimpleToIsimple (
391a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *SourceObj,
392a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *DestObj);
393a9f12690SJung-uk Kim 
394a9f12690SJung-uk Kim ACPI_STATUS
395a9f12690SJung-uk Kim AcpiUtCopyIobjectToIobject (
396a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *SourceDesc,
397a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     **DestDesc,
398a9f12690SJung-uk Kim     ACPI_WALK_STATE         *WalkState);
399a9f12690SJung-uk Kim 
400a9f12690SJung-uk Kim 
401a9f12690SJung-uk Kim /*
402a9f12690SJung-uk Kim  * utcreate - Object creation
403a9f12690SJung-uk Kim  */
404a9f12690SJung-uk Kim ACPI_STATUS
405a9f12690SJung-uk Kim AcpiUtUpdateObjectReference (
406a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object,
407a9f12690SJung-uk Kim     UINT16                  Action);
408a9f12690SJung-uk Kim 
409a9f12690SJung-uk Kim 
410a9f12690SJung-uk Kim /*
411a9f12690SJung-uk Kim  * utdebug - Debug interfaces
412a9f12690SJung-uk Kim  */
413a9f12690SJung-uk Kim void
414a9f12690SJung-uk Kim AcpiUtInitStackPtrTrace (
415a9f12690SJung-uk Kim     void);
416a9f12690SJung-uk Kim 
417a9f12690SJung-uk Kim void
418a9f12690SJung-uk Kim AcpiUtTrackStackPtr (
419a9f12690SJung-uk Kim     void);
420a9f12690SJung-uk Kim 
421a9f12690SJung-uk Kim void
422a9f12690SJung-uk Kim AcpiUtTrace (
423a9f12690SJung-uk Kim     UINT32                  LineNumber,
424a9f12690SJung-uk Kim     const char              *FunctionName,
425a9f12690SJung-uk Kim     const char              *ModuleName,
426a9f12690SJung-uk Kim     UINT32                  ComponentId);
427a9f12690SJung-uk Kim 
428a9f12690SJung-uk Kim void
429a9f12690SJung-uk Kim AcpiUtTracePtr (
430a9f12690SJung-uk Kim     UINT32                  LineNumber,
431a9f12690SJung-uk Kim     const char              *FunctionName,
432a9f12690SJung-uk Kim     const char              *ModuleName,
433a9f12690SJung-uk Kim     UINT32                  ComponentId,
434a9f12690SJung-uk Kim     void                    *Pointer);
435a9f12690SJung-uk Kim 
436a9f12690SJung-uk Kim void
437a9f12690SJung-uk Kim AcpiUtTraceU32 (
438a9f12690SJung-uk Kim     UINT32                  LineNumber,
439a9f12690SJung-uk Kim     const char              *FunctionName,
440a9f12690SJung-uk Kim     const char              *ModuleName,
441a9f12690SJung-uk Kim     UINT32                  ComponentId,
442a9f12690SJung-uk Kim     UINT32                  Integer);
443a9f12690SJung-uk Kim 
444a9f12690SJung-uk Kim void
445a9f12690SJung-uk Kim AcpiUtTraceStr (
446a9f12690SJung-uk Kim     UINT32                  LineNumber,
447a9f12690SJung-uk Kim     const char              *FunctionName,
448a9f12690SJung-uk Kim     const char              *ModuleName,
449a9f12690SJung-uk Kim     UINT32                  ComponentId,
450a9f12690SJung-uk Kim     char                    *String);
451a9f12690SJung-uk Kim 
452a9f12690SJung-uk Kim void
453a9f12690SJung-uk Kim AcpiUtExit (
454a9f12690SJung-uk Kim     UINT32                  LineNumber,
455a9f12690SJung-uk Kim     const char              *FunctionName,
456a9f12690SJung-uk Kim     const char              *ModuleName,
457a9f12690SJung-uk Kim     UINT32                  ComponentId);
458a9f12690SJung-uk Kim 
459a9f12690SJung-uk Kim void
460a9f12690SJung-uk Kim AcpiUtStatusExit (
461a9f12690SJung-uk Kim     UINT32                  LineNumber,
462a9f12690SJung-uk Kim     const char              *FunctionName,
463a9f12690SJung-uk Kim     const char              *ModuleName,
464a9f12690SJung-uk Kim     UINT32                  ComponentId,
465a9f12690SJung-uk Kim     ACPI_STATUS             Status);
466a9f12690SJung-uk Kim 
467a9f12690SJung-uk Kim void
468a9f12690SJung-uk Kim AcpiUtValueExit (
469a9f12690SJung-uk Kim     UINT32                  LineNumber,
470a9f12690SJung-uk Kim     const char              *FunctionName,
471a9f12690SJung-uk Kim     const char              *ModuleName,
472a9f12690SJung-uk Kim     UINT32                  ComponentId,
4739a179dd8SJung-uk Kim     UINT64                  Value);
474a9f12690SJung-uk Kim 
475a9f12690SJung-uk Kim void
476a9f12690SJung-uk Kim AcpiUtPtrExit (
477a9f12690SJung-uk Kim     UINT32                  LineNumber,
478a9f12690SJung-uk Kim     const char              *FunctionName,
479a9f12690SJung-uk Kim     const char              *ModuleName,
480a9f12690SJung-uk Kim     UINT32                  ComponentId,
481a9f12690SJung-uk Kim     UINT8                   *Ptr);
482a9f12690SJung-uk Kim 
483a9f12690SJung-uk Kim void
484a9f12690SJung-uk Kim AcpiUtDumpBuffer (
485a9f12690SJung-uk Kim     UINT8                   *Buffer,
486a9f12690SJung-uk Kim     UINT32                  Count,
487a9f12690SJung-uk Kim     UINT32                  Display,
488a9f12690SJung-uk Kim     UINT32                  componentId);
489a9f12690SJung-uk Kim 
490a9f12690SJung-uk Kim void
491a9f12690SJung-uk Kim AcpiUtDumpBuffer2 (
492a9f12690SJung-uk Kim     UINT8                   *Buffer,
493a9f12690SJung-uk Kim     UINT32                  Count,
494a9f12690SJung-uk Kim     UINT32                  Display);
495a9f12690SJung-uk Kim 
496a9f12690SJung-uk Kim void
497a9f12690SJung-uk Kim AcpiUtReportError (
498a9f12690SJung-uk Kim     char                    *ModuleName,
499a9f12690SJung-uk Kim     UINT32                  LineNumber);
500a9f12690SJung-uk Kim 
501a9f12690SJung-uk Kim void
502a9f12690SJung-uk Kim AcpiUtReportInfo (
503a9f12690SJung-uk Kim     char                    *ModuleName,
504a9f12690SJung-uk Kim     UINT32                  LineNumber);
505a9f12690SJung-uk Kim 
506a9f12690SJung-uk Kim void
507a9f12690SJung-uk Kim AcpiUtReportWarning (
508a9f12690SJung-uk Kim     char                    *ModuleName,
509a9f12690SJung-uk Kim     UINT32                  LineNumber);
510a9f12690SJung-uk Kim 
511a9f12690SJung-uk Kim /*
512a9f12690SJung-uk Kim  * utdelete - Object deletion and reference counts
513a9f12690SJung-uk Kim  */
514a9f12690SJung-uk Kim void
515a9f12690SJung-uk Kim AcpiUtAddReference (
516a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
517a9f12690SJung-uk Kim 
518a9f12690SJung-uk Kim void
519a9f12690SJung-uk Kim AcpiUtRemoveReference (
520a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
521a9f12690SJung-uk Kim 
522a9f12690SJung-uk Kim void
523a9f12690SJung-uk Kim AcpiUtDeleteInternalPackageObject (
524a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
525a9f12690SJung-uk Kim 
526a9f12690SJung-uk Kim void
527a9f12690SJung-uk Kim AcpiUtDeleteInternalSimpleObject (
528a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
529a9f12690SJung-uk Kim 
530a9f12690SJung-uk Kim void
531a9f12690SJung-uk Kim AcpiUtDeleteInternalObjectList (
532a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     **ObjList);
533a9f12690SJung-uk Kim 
534a9f12690SJung-uk Kim 
535a9f12690SJung-uk Kim /*
536a9f12690SJung-uk Kim  * uteval - object evaluation
537a9f12690SJung-uk Kim  */
538a9f12690SJung-uk Kim ACPI_STATUS
539a9f12690SJung-uk Kim AcpiUtEvaluateObject (
540a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *PrefixNode,
541a9f12690SJung-uk Kim     char                    *Path,
542a9f12690SJung-uk Kim     UINT32                  ExpectedReturnBtypes,
543a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     **ReturnDesc);
544a9f12690SJung-uk Kim 
545a9f12690SJung-uk Kim ACPI_STATUS
546a9f12690SJung-uk Kim AcpiUtEvaluateNumericObject (
547a9f12690SJung-uk Kim     char                    *ObjectName,
548a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
5499a179dd8SJung-uk Kim     UINT64                  *Value);
550a9f12690SJung-uk Kim 
551a9f12690SJung-uk Kim ACPI_STATUS
552a9f12690SJung-uk Kim AcpiUtExecute_STA (
553a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
554a9f12690SJung-uk Kim     UINT32                  *StatusFlags);
555a9f12690SJung-uk Kim 
556a9f12690SJung-uk Kim ACPI_STATUS
557d6dd1baeSJung-uk Kim AcpiUtExecutePowerMethods (
558a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
559d6dd1baeSJung-uk Kim     const char              **MethodNames,
560d6dd1baeSJung-uk Kim     UINT8                   MethodCount,
561d6dd1baeSJung-uk Kim     UINT8                   *OutValues);
562d6dd1baeSJung-uk Kim 
563d6dd1baeSJung-uk Kim 
564d6dd1baeSJung-uk Kim /*
565d6dd1baeSJung-uk Kim  * utids - device ID support
566d6dd1baeSJung-uk Kim  */
567d6dd1baeSJung-uk Kim ACPI_STATUS
568d6dd1baeSJung-uk Kim AcpiUtExecute_HID (
569d6dd1baeSJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
570d6dd1baeSJung-uk Kim     ACPI_DEVICE_ID          **ReturnId);
571a9f12690SJung-uk Kim 
572a9f12690SJung-uk Kim ACPI_STATUS
573d6dd1baeSJung-uk Kim AcpiUtExecute_UID (
574a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
575d6dd1baeSJung-uk Kim     ACPI_DEVICE_ID          **ReturnId);
576d6dd1baeSJung-uk Kim 
577d6dd1baeSJung-uk Kim ACPI_STATUS
578d6dd1baeSJung-uk Kim AcpiUtExecute_CID (
579d6dd1baeSJung-uk Kim     ACPI_NAMESPACE_NODE     *DeviceNode,
580d6dd1baeSJung-uk Kim     ACPI_DEVICE_ID_LIST     **ReturnCidList);
581d6dd1baeSJung-uk Kim 
582a9f12690SJung-uk Kim 
583a9f12690SJung-uk Kim /*
584a9f12690SJung-uk Kim  * utlock - reader/writer locks
585a9f12690SJung-uk Kim  */
586a9f12690SJung-uk Kim ACPI_STATUS
587a9f12690SJung-uk Kim AcpiUtCreateRwLock (
588a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
589a9f12690SJung-uk Kim 
590a9f12690SJung-uk Kim void
591a9f12690SJung-uk Kim AcpiUtDeleteRwLock (
592a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
593a9f12690SJung-uk Kim 
594a9f12690SJung-uk Kim ACPI_STATUS
595a9f12690SJung-uk Kim AcpiUtAcquireReadLock (
596a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
597a9f12690SJung-uk Kim 
598a9f12690SJung-uk Kim ACPI_STATUS
599a9f12690SJung-uk Kim AcpiUtReleaseReadLock (
600a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
601a9f12690SJung-uk Kim 
602a9f12690SJung-uk Kim ACPI_STATUS
603a9f12690SJung-uk Kim AcpiUtAcquireWriteLock (
604a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
605a9f12690SJung-uk Kim 
606a9f12690SJung-uk Kim void
607a9f12690SJung-uk Kim AcpiUtReleaseWriteLock (
608a9f12690SJung-uk Kim     ACPI_RW_LOCK            *Lock);
609a9f12690SJung-uk Kim 
610a9f12690SJung-uk Kim 
611a9f12690SJung-uk Kim /*
612a9f12690SJung-uk Kim  * utobject - internal object create/delete/cache routines
613a9f12690SJung-uk Kim  */
614a9f12690SJung-uk Kim ACPI_OPERAND_OBJECT  *
615a9f12690SJung-uk Kim AcpiUtCreateInternalObjectDbg (
616a9f12690SJung-uk Kim     const char              *ModuleName,
617a9f12690SJung-uk Kim     UINT32                  LineNumber,
618a9f12690SJung-uk Kim     UINT32                  ComponentId,
619a9f12690SJung-uk Kim     ACPI_OBJECT_TYPE        Type);
620a9f12690SJung-uk Kim 
621a9f12690SJung-uk Kim void *
622a9f12690SJung-uk Kim AcpiUtAllocateObjectDescDbg (
623a9f12690SJung-uk Kim     const char              *ModuleName,
624a9f12690SJung-uk Kim     UINT32                  LineNumber,
625a9f12690SJung-uk Kim     UINT32                  ComponentId);
626a9f12690SJung-uk Kim 
627a9f12690SJung-uk Kim #define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
628a9f12690SJung-uk Kim #define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
629a9f12690SJung-uk Kim 
630a9f12690SJung-uk Kim void
631a9f12690SJung-uk Kim AcpiUtDeleteObjectDesc (
632a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object);
633a9f12690SJung-uk Kim 
634a9f12690SJung-uk Kim BOOLEAN
635a9f12690SJung-uk Kim AcpiUtValidInternalObject (
636a9f12690SJung-uk Kim     void                    *Object);
637a9f12690SJung-uk Kim 
638a9f12690SJung-uk Kim ACPI_OPERAND_OBJECT *
639a9f12690SJung-uk Kim AcpiUtCreatePackageObject (
640a9f12690SJung-uk Kim     UINT32                  Count);
641a9f12690SJung-uk Kim 
642a9f12690SJung-uk Kim ACPI_OPERAND_OBJECT *
6432272d050SJung-uk Kim AcpiUtCreateIntegerObject (
6442272d050SJung-uk Kim     UINT64                  Value);
6452272d050SJung-uk Kim 
6462272d050SJung-uk Kim ACPI_OPERAND_OBJECT *
647a9f12690SJung-uk Kim AcpiUtCreateBufferObject (
648a9f12690SJung-uk Kim     ACPI_SIZE               BufferSize);
649a9f12690SJung-uk Kim 
650a9f12690SJung-uk Kim ACPI_OPERAND_OBJECT *
651a9f12690SJung-uk Kim AcpiUtCreateStringObject (
652a9f12690SJung-uk Kim     ACPI_SIZE               StringSize);
653a9f12690SJung-uk Kim 
654a9f12690SJung-uk Kim ACPI_STATUS
655a9f12690SJung-uk Kim AcpiUtGetObjectSize(
656a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Obj,
657a9f12690SJung-uk Kim     ACPI_SIZE               *ObjLength);
658a9f12690SJung-uk Kim 
659a9f12690SJung-uk Kim 
660a9f12690SJung-uk Kim /*
661*709fac06SJung-uk Kim  * utosi - Support for the _OSI predefined control method
662*709fac06SJung-uk Kim  */
663*709fac06SJung-uk Kim ACPI_STATUS
664*709fac06SJung-uk Kim AcpiUtInitializeInterfaces (
665*709fac06SJung-uk Kim     void);
666*709fac06SJung-uk Kim 
667*709fac06SJung-uk Kim void
668*709fac06SJung-uk Kim AcpiUtInterfaceTerminate (
669*709fac06SJung-uk Kim     void);
670*709fac06SJung-uk Kim 
671*709fac06SJung-uk Kim ACPI_STATUS
672*709fac06SJung-uk Kim AcpiUtInstallInterface (
673*709fac06SJung-uk Kim     ACPI_STRING             InterfaceName);
674*709fac06SJung-uk Kim 
675*709fac06SJung-uk Kim ACPI_STATUS
676*709fac06SJung-uk Kim AcpiUtRemoveInterface (
677*709fac06SJung-uk Kim     ACPI_STRING             InterfaceName);
678*709fac06SJung-uk Kim 
679*709fac06SJung-uk Kim ACPI_INTERFACE_INFO *
680*709fac06SJung-uk Kim AcpiUtGetInterface (
681*709fac06SJung-uk Kim     ACPI_STRING             InterfaceName);
682*709fac06SJung-uk Kim 
683*709fac06SJung-uk Kim ACPI_STATUS
684*709fac06SJung-uk Kim AcpiUtOsiImplementation (
685*709fac06SJung-uk Kim     ACPI_WALK_STATE         *WalkState);
686*709fac06SJung-uk Kim 
687*709fac06SJung-uk Kim 
688*709fac06SJung-uk Kim /*
689a9f12690SJung-uk Kim  * utstate - Generic state creation/cache routines
690a9f12690SJung-uk Kim  */
691a9f12690SJung-uk Kim void
692a9f12690SJung-uk Kim AcpiUtPushGenericState (
693a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      **ListHead,
694a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      *State);
695a9f12690SJung-uk Kim 
696a9f12690SJung-uk Kim ACPI_GENERIC_STATE *
697a9f12690SJung-uk Kim AcpiUtPopGenericState (
698a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      **ListHead);
699a9f12690SJung-uk Kim 
700a9f12690SJung-uk Kim 
701a9f12690SJung-uk Kim ACPI_GENERIC_STATE *
702a9f12690SJung-uk Kim AcpiUtCreateGenericState (
703a9f12690SJung-uk Kim     void);
704a9f12690SJung-uk Kim 
705a9f12690SJung-uk Kim ACPI_THREAD_STATE *
706a9f12690SJung-uk Kim AcpiUtCreateThreadState (
707a9f12690SJung-uk Kim     void);
708a9f12690SJung-uk Kim 
709a9f12690SJung-uk Kim ACPI_GENERIC_STATE *
710a9f12690SJung-uk Kim AcpiUtCreateUpdateState (
711a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object,
712a9f12690SJung-uk Kim     UINT16                  Action);
713a9f12690SJung-uk Kim 
714a9f12690SJung-uk Kim ACPI_GENERIC_STATE *
715a9f12690SJung-uk Kim AcpiUtCreatePkgState (
716a9f12690SJung-uk Kim     void                    *InternalObject,
717a9f12690SJung-uk Kim     void                    *ExternalObject,
718a9f12690SJung-uk Kim     UINT16                  Index);
719a9f12690SJung-uk Kim 
720a9f12690SJung-uk Kim ACPI_STATUS
721a9f12690SJung-uk Kim AcpiUtCreateUpdateStateAndPush (
722a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *Object,
723a9f12690SJung-uk Kim     UINT16                  Action,
724a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      **StateList);
725a9f12690SJung-uk Kim 
726a9f12690SJung-uk Kim ACPI_STATUS
727a9f12690SJung-uk Kim AcpiUtCreatePkgStateAndPush (
728a9f12690SJung-uk Kim     void                    *InternalObject,
729a9f12690SJung-uk Kim     void                    *ExternalObject,
730a9f12690SJung-uk Kim     UINT16                  Index,
731a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      **StateList);
732a9f12690SJung-uk Kim 
733a9f12690SJung-uk Kim ACPI_GENERIC_STATE *
734a9f12690SJung-uk Kim AcpiUtCreateControlState (
735a9f12690SJung-uk Kim     void);
736a9f12690SJung-uk Kim 
737a9f12690SJung-uk Kim void
738a9f12690SJung-uk Kim AcpiUtDeleteGenericState (
739a9f12690SJung-uk Kim     ACPI_GENERIC_STATE      *State);
740a9f12690SJung-uk Kim 
741a9f12690SJung-uk Kim 
742a9f12690SJung-uk Kim /*
743a9f12690SJung-uk Kim  * utmath
744a9f12690SJung-uk Kim  */
745a9f12690SJung-uk Kim ACPI_STATUS
746a9f12690SJung-uk Kim AcpiUtDivide (
7479a179dd8SJung-uk Kim     UINT64                  InDividend,
7489a179dd8SJung-uk Kim     UINT64                  InDivisor,
7499a179dd8SJung-uk Kim     UINT64                  *OutQuotient,
7509a179dd8SJung-uk Kim     UINT64                  *OutRemainder);
751a9f12690SJung-uk Kim 
752a9f12690SJung-uk Kim ACPI_STATUS
753a9f12690SJung-uk Kim AcpiUtShortDivide (
7549a179dd8SJung-uk Kim     UINT64                  InDividend,
755a9f12690SJung-uk Kim     UINT32                  Divisor,
7569a179dd8SJung-uk Kim     UINT64                  *OutQuotient,
757a9f12690SJung-uk Kim     UINT32                  *OutRemainder);
758a9f12690SJung-uk Kim 
759a9f12690SJung-uk Kim /*
760a9f12690SJung-uk Kim  * utmisc
761a9f12690SJung-uk Kim  */
762a9f12690SJung-uk Kim const char *
763a9f12690SJung-uk Kim AcpiUtValidateException (
764a9f12690SJung-uk Kim     ACPI_STATUS             Status);
765a9f12690SJung-uk Kim 
766a9f12690SJung-uk Kim BOOLEAN
767d6dd1baeSJung-uk Kim AcpiUtIsPciRootBridge (
768d6dd1baeSJung-uk Kim     char                    *Id);
769d6dd1baeSJung-uk Kim 
770d6dd1baeSJung-uk Kim BOOLEAN
771a9f12690SJung-uk Kim AcpiUtIsAmlTable (
772a9f12690SJung-uk Kim     ACPI_TABLE_HEADER       *Table);
773a9f12690SJung-uk Kim 
774a9f12690SJung-uk Kim ACPI_STATUS
775a9f12690SJung-uk Kim AcpiUtAllocateOwnerId (
776a9f12690SJung-uk Kim     ACPI_OWNER_ID           *OwnerId);
777a9f12690SJung-uk Kim 
778a9f12690SJung-uk Kim void
779a9f12690SJung-uk Kim AcpiUtReleaseOwnerId (
780a9f12690SJung-uk Kim     ACPI_OWNER_ID           *OwnerId);
781a9f12690SJung-uk Kim 
782a9f12690SJung-uk Kim ACPI_STATUS
783a9f12690SJung-uk Kim AcpiUtWalkPackageTree (
784a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *SourceObject,
785a9f12690SJung-uk Kim     void                    *TargetObject,
786a9f12690SJung-uk Kim     ACPI_PKG_CALLBACK       WalkCallback,
787a9f12690SJung-uk Kim     void                    *Context);
788a9f12690SJung-uk Kim 
789a9f12690SJung-uk Kim void
790a9f12690SJung-uk Kim AcpiUtStrupr (
791a9f12690SJung-uk Kim     char                    *SrcString);
792a9f12690SJung-uk Kim 
793a9f12690SJung-uk Kim void
794a88e22b7SJung-uk Kim AcpiUtStrlwr (
795a88e22b7SJung-uk Kim     char                    *SrcString);
796a88e22b7SJung-uk Kim 
797a88e22b7SJung-uk Kim void
798a9f12690SJung-uk Kim AcpiUtPrintString (
799a9f12690SJung-uk Kim     char                    *String,
800a9f12690SJung-uk Kim     UINT8                   MaxLength);
801a9f12690SJung-uk Kim 
802a9f12690SJung-uk Kim BOOLEAN
803a9f12690SJung-uk Kim AcpiUtValidAcpiName (
804a9f12690SJung-uk Kim     UINT32                  Name);
805a9f12690SJung-uk Kim 
806a9f12690SJung-uk Kim void
807a9f12690SJung-uk Kim AcpiUtRepairName (
808a9f12690SJung-uk Kim     char                    *Name);
809a9f12690SJung-uk Kim 
810a9f12690SJung-uk Kim BOOLEAN
811a9f12690SJung-uk Kim AcpiUtValidAcpiChar (
812a9f12690SJung-uk Kim     char                    Character,
813a9f12690SJung-uk Kim     UINT32                  Position);
814a9f12690SJung-uk Kim 
815a9f12690SJung-uk Kim ACPI_STATUS
816a9f12690SJung-uk Kim AcpiUtStrtoul64 (
817a9f12690SJung-uk Kim     char                    *String,
818a9f12690SJung-uk Kim     UINT32                  Base,
8199a179dd8SJung-uk Kim     UINT64                  *RetInteger);
820a9f12690SJung-uk Kim 
821d6dd1baeSJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
822d6dd1baeSJung-uk Kim AcpiUtPredefinedWarning (
823d6dd1baeSJung-uk Kim     const char              *ModuleName,
824d6dd1baeSJung-uk Kim     UINT32                  LineNumber,
825d6dd1baeSJung-uk Kim     char                    *Pathname,
826d6dd1baeSJung-uk Kim     UINT8                   NodeFlags,
827d6dd1baeSJung-uk Kim     const char              *Format,
828d6dd1baeSJung-uk Kim     ...);
829d6dd1baeSJung-uk Kim 
8302272d050SJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
8312272d050SJung-uk Kim AcpiUtPredefinedInfo (
8322272d050SJung-uk Kim     const char              *ModuleName,
8332272d050SJung-uk Kim     UINT32                  LineNumber,
8342272d050SJung-uk Kim     char                    *Pathname,
8352272d050SJung-uk Kim     UINT8                   NodeFlags,
8362272d050SJung-uk Kim     const char              *Format,
8372272d050SJung-uk Kim     ...);
8382272d050SJung-uk Kim 
839a9f12690SJung-uk Kim /* Values for Base above (16=Hex, 10=Decimal) */
840a9f12690SJung-uk Kim 
841a9f12690SJung-uk Kim #define ACPI_ANY_BASE        0
842a9f12690SJung-uk Kim 
843a9f12690SJung-uk Kim UINT32
844a9f12690SJung-uk Kim AcpiUtDwordByteSwap (
845a9f12690SJung-uk Kim     UINT32                  Value);
846a9f12690SJung-uk Kim 
847a9f12690SJung-uk Kim void
848a9f12690SJung-uk Kim AcpiUtSetIntegerWidth (
849a9f12690SJung-uk Kim     UINT8                   Revision);
850a9f12690SJung-uk Kim 
851a9f12690SJung-uk Kim #ifdef ACPI_DEBUG_OUTPUT
852a9f12690SJung-uk Kim void
853a9f12690SJung-uk Kim AcpiUtDisplayInitPathname (
854a9f12690SJung-uk Kim     UINT8                   Type,
855a9f12690SJung-uk Kim     ACPI_NAMESPACE_NODE     *ObjHandle,
856a9f12690SJung-uk Kim     char                    *Path);
857a9f12690SJung-uk Kim #endif
858a9f12690SJung-uk Kim 
859a9f12690SJung-uk Kim 
860a9f12690SJung-uk Kim /*
861a9f12690SJung-uk Kim  * utresrc
862a9f12690SJung-uk Kim  */
863a9f12690SJung-uk Kim ACPI_STATUS
864a9f12690SJung-uk Kim AcpiUtWalkAmlResources (
865a9f12690SJung-uk Kim     UINT8                   *Aml,
866a9f12690SJung-uk Kim     ACPI_SIZE               AmlLength,
867a9f12690SJung-uk Kim     ACPI_WALK_AML_CALLBACK  UserFunction,
868a9f12690SJung-uk Kim     void                    *Context);
869a9f12690SJung-uk Kim 
870a9f12690SJung-uk Kim ACPI_STATUS
871a9f12690SJung-uk Kim AcpiUtValidateResource (
872a9f12690SJung-uk Kim     void                    *Aml,
873a9f12690SJung-uk Kim     UINT8                   *ReturnIndex);
874a9f12690SJung-uk Kim 
875a9f12690SJung-uk Kim UINT32
876a9f12690SJung-uk Kim AcpiUtGetDescriptorLength (
877a9f12690SJung-uk Kim     void                    *Aml);
878a9f12690SJung-uk Kim 
879a9f12690SJung-uk Kim UINT16
880a9f12690SJung-uk Kim AcpiUtGetResourceLength (
881a9f12690SJung-uk Kim     void                    *Aml);
882a9f12690SJung-uk Kim 
883a9f12690SJung-uk Kim UINT8
884a9f12690SJung-uk Kim AcpiUtGetResourceHeaderLength (
885a9f12690SJung-uk Kim     void                    *Aml);
886a9f12690SJung-uk Kim 
887a9f12690SJung-uk Kim UINT8
888a9f12690SJung-uk Kim AcpiUtGetResourceType (
889a9f12690SJung-uk Kim     void                    *Aml);
890a9f12690SJung-uk Kim 
891a9f12690SJung-uk Kim ACPI_STATUS
892a9f12690SJung-uk Kim AcpiUtGetResourceEndTag (
893a9f12690SJung-uk Kim     ACPI_OPERAND_OBJECT     *ObjDesc,
894a9f12690SJung-uk Kim     UINT8                   **EndTag);
895a9f12690SJung-uk Kim 
896a9f12690SJung-uk Kim 
897a9f12690SJung-uk Kim /*
898a9f12690SJung-uk Kim  * utmutex - mutex support
899a9f12690SJung-uk Kim  */
900a9f12690SJung-uk Kim ACPI_STATUS
901a9f12690SJung-uk Kim AcpiUtMutexInitialize (
902a9f12690SJung-uk Kim     void);
903a9f12690SJung-uk Kim 
904a9f12690SJung-uk Kim void
905a9f12690SJung-uk Kim AcpiUtMutexTerminate (
906a9f12690SJung-uk Kim     void);
907a9f12690SJung-uk Kim 
908a9f12690SJung-uk Kim ACPI_STATUS
909a9f12690SJung-uk Kim AcpiUtAcquireMutex (
910a9f12690SJung-uk Kim     ACPI_MUTEX_HANDLE       MutexId);
911a9f12690SJung-uk Kim 
912a9f12690SJung-uk Kim ACPI_STATUS
913a9f12690SJung-uk Kim AcpiUtReleaseMutex (
914a9f12690SJung-uk Kim     ACPI_MUTEX_HANDLE       MutexId);
915a9f12690SJung-uk Kim 
916a9f12690SJung-uk Kim 
917a9f12690SJung-uk Kim /*
918a9f12690SJung-uk Kim  * utalloc - memory allocation and object caching
919a9f12690SJung-uk Kim  */
920a9f12690SJung-uk Kim ACPI_STATUS
921a9f12690SJung-uk Kim AcpiUtCreateCaches (
922a9f12690SJung-uk Kim     void);
923a9f12690SJung-uk Kim 
924a9f12690SJung-uk Kim ACPI_STATUS
925a9f12690SJung-uk Kim AcpiUtDeleteCaches (
926a9f12690SJung-uk Kim     void);
927a9f12690SJung-uk Kim 
928a9f12690SJung-uk Kim ACPI_STATUS
929a9f12690SJung-uk Kim AcpiUtValidateBuffer (
930a9f12690SJung-uk Kim     ACPI_BUFFER             *Buffer);
931a9f12690SJung-uk Kim 
932a9f12690SJung-uk Kim ACPI_STATUS
933a9f12690SJung-uk Kim AcpiUtInitializeBuffer (
934a9f12690SJung-uk Kim     ACPI_BUFFER             *Buffer,
935a9f12690SJung-uk Kim     ACPI_SIZE               RequiredLength);
936a9f12690SJung-uk Kim 
937a9f12690SJung-uk Kim void *
938a9f12690SJung-uk Kim AcpiUtAllocate (
939a9f12690SJung-uk Kim     ACPI_SIZE               Size,
940a9f12690SJung-uk Kim     UINT32                  Component,
941a9f12690SJung-uk Kim     const char              *Module,
942a9f12690SJung-uk Kim     UINT32                  Line);
943a9f12690SJung-uk Kim 
944a9f12690SJung-uk Kim void *
945a9f12690SJung-uk Kim AcpiUtAllocateZeroed (
946a9f12690SJung-uk Kim     ACPI_SIZE               Size,
947a9f12690SJung-uk Kim     UINT32                  Component,
948a9f12690SJung-uk Kim     const char              *Module,
949a9f12690SJung-uk Kim     UINT32                  Line);
950a9f12690SJung-uk Kim 
951a9f12690SJung-uk Kim #ifdef ACPI_DBG_TRACK_ALLOCATIONS
952a9f12690SJung-uk Kim void *
953a9f12690SJung-uk Kim AcpiUtAllocateAndTrack (
954a9f12690SJung-uk Kim     ACPI_SIZE               Size,
955a9f12690SJung-uk Kim     UINT32                  Component,
956a9f12690SJung-uk Kim     const char              *Module,
957a9f12690SJung-uk Kim     UINT32                  Line);
958a9f12690SJung-uk Kim 
959a9f12690SJung-uk Kim void *
960a9f12690SJung-uk Kim AcpiUtAllocateZeroedAndTrack (
961a9f12690SJung-uk Kim     ACPI_SIZE               Size,
962a9f12690SJung-uk Kim     UINT32                  Component,
963a9f12690SJung-uk Kim     const char              *Module,
964a9f12690SJung-uk Kim     UINT32                  Line);
965a9f12690SJung-uk Kim 
966a9f12690SJung-uk Kim void
967a9f12690SJung-uk Kim AcpiUtFreeAndTrack (
968a9f12690SJung-uk Kim     void                    *Address,
969a9f12690SJung-uk Kim     UINT32                  Component,
970a9f12690SJung-uk Kim     const char              *Module,
971a9f12690SJung-uk Kim     UINT32                  Line);
972a9f12690SJung-uk Kim 
973a9f12690SJung-uk Kim void
974a9f12690SJung-uk Kim AcpiUtDumpAllocationInfo (
975a9f12690SJung-uk Kim     void);
976a9f12690SJung-uk Kim 
977a9f12690SJung-uk Kim void
978a9f12690SJung-uk Kim AcpiUtDumpAllocations (
979a9f12690SJung-uk Kim     UINT32                  Component,
980a9f12690SJung-uk Kim     const char              *Module);
981a9f12690SJung-uk Kim 
982a9f12690SJung-uk Kim ACPI_STATUS
983a9f12690SJung-uk Kim AcpiUtCreateList (
984a9f12690SJung-uk Kim     char                    *ListName,
985a9f12690SJung-uk Kim     UINT16                  ObjectSize,
986a9f12690SJung-uk Kim     ACPI_MEMORY_LIST        **ReturnCache);
987a9f12690SJung-uk Kim 
988a9f12690SJung-uk Kim 
989a9f12690SJung-uk Kim #endif
990a9f12690SJung-uk Kim 
991a9f12690SJung-uk Kim #endif /* _ACUTILS_H */
992