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