Merge from vendor branch GCC:
[dragonfly.git] / sys / contrib / dev / acpica-unix-20031203 / include / acutils.h
1 /******************************************************************************
2  *
3  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4  *       $Revision: 157 $
5  *
6  *****************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, 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
121 typedef
122 ACPI_STATUS (*ACPI_PKG_CALLBACK) (
123     UINT8                   ObjectType,
124     ACPI_OPERAND_OBJECT     *SourceObject,
125     ACPI_GENERIC_STATE      *State,
126     void                    *Context);
127
128
129 ACPI_STATUS
130 AcpiUtWalkPackageTree (
131     ACPI_OPERAND_OBJECT     *SourceObject,
132     void                    *TargetObject,
133     ACPI_PKG_CALLBACK       WalkCallback,
134     void                    *Context);
135
136
137 typedef 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
160 void
161 AcpiUtInitGlobals (
162     void);
163
164 void
165 AcpiUtTerminate (
166     void);
167
168
169 /*
170  * UtInit - miscellaneous initialization and shutdown
171  */
172
173 ACPI_STATUS
174 AcpiUtHardwareInitialize (
175     void);
176
177 void
178 AcpiUtSubsystemShutdown (
179     void);
180
181 ACPI_STATUS
182 AcpiUtValidateFadt (
183     void);
184
185 /*
186  * UtGlobal - Global data structures and procedures
187  */
188
189 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
190
191 char *
192 AcpiUtGetMutexName (
193     UINT32                  MutexId);
194
195 #endif
196
197 char *
198 AcpiUtGetTypeName (
199     ACPI_OBJECT_TYPE        Type);
200
201 char *
202 AcpiUtGetNodeName (
203     void                    *Object);
204
205 char *
206 AcpiUtGetDescriptorName (
207     void                    *Object);
208
209 char *
210 AcpiUtGetObjectTypeName (
211     ACPI_OPERAND_OBJECT     *ObjDesc);
212
213 char *
214 AcpiUtGetRegionName (
215     UINT8                   SpaceId);
216
217 char *
218 AcpiUtGetEventName (
219     UINT32                  EventId);
220
221 char
222 AcpiUtHexToAsciiChar (
223     ACPI_INTEGER            Integer,
224     UINT32                  Position);
225
226 BOOLEAN
227 AcpiUtValidObjectType (
228     ACPI_OBJECT_TYPE        Type);
229
230 ACPI_OWNER_ID
231 AcpiUtAllocateOwnerId (
232     UINT32                  IdType);
233
234
235 /*
236  * UtClib - Local implementations of C library functions
237  */
238
239 #ifndef ACPI_USE_SYSTEM_CLIBRARY
240
241 ACPI_SIZE
242 AcpiUtStrlen (
243     const char              *String);
244
245 char *
246 AcpiUtStrcpy (
247     char                    *DstString,
248     const char              *SrcString);
249
250 char *
251 AcpiUtStrncpy (
252     char                    *DstString,
253     const char              *SrcString,
254     ACPI_SIZE               Count);
255
256 int
257 AcpiUtStrncmp (
258     const char              *String1,
259     const char              *String2,
260     ACPI_SIZE               Count);
261
262 int
263 AcpiUtStrcmp (
264     const char              *String1,
265     const char              *String2);
266
267 char *
268 AcpiUtStrcat (
269     char                    *DstString,
270     const char              *SrcString);
271
272 char *
273 AcpiUtStrncat (
274     char                    *DstString,
275     const char              *SrcString,
276     ACPI_SIZE               Count);
277
278 UINT32
279 AcpiUtStrtoul (
280     const char              *String,
281     char                    **Terminator,
282     UINT32                  Base);
283
284 char *
285 AcpiUtStrstr (
286     char                    *String1,
287     char                    *String2);
288
289 void *
290 AcpiUtMemcpy (
291     void                    *Dest,
292     const void              *Src,
293     ACPI_SIZE               Count);
294
295 void *
296 AcpiUtMemset (
297     void                    *Dest,
298     ACPI_NATIVE_UINT        Value,
299     ACPI_SIZE               Count);
300
301 int
302 AcpiUtToUpper (
303     int                     c);
304
305 int
306 AcpiUtToLower (
307     int                     c);
308
309 extern 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
337 ACPI_STATUS
338 AcpiUtBuildSimpleObject(
339     ACPI_OPERAND_OBJECT     *Obj,
340     ACPI_OBJECT             *UserObj,
341     UINT8                   *DataSpace,
342     UINT32                  *BufferSpaceUsed);
343
344 ACPI_STATUS
345 AcpiUtBuildPackageObject (
346     ACPI_OPERAND_OBJECT     *Obj,
347     UINT8                   *Buffer,
348     UINT32                  *SpaceUsed);
349
350 ACPI_STATUS
351 AcpiUtCopyIelementToEelement (
352     UINT8                   ObjectType,
353     ACPI_OPERAND_OBJECT     *SourceObject,
354     ACPI_GENERIC_STATE      *State,
355     void                    *Context);
356
357 ACPI_STATUS
358 AcpiUtCopyIelementToIelement (
359     UINT8                   ObjectType,
360     ACPI_OPERAND_OBJECT     *SourceObject,
361     ACPI_GENERIC_STATE      *State,
362     void                    *Context);
363
364 ACPI_STATUS
365 AcpiUtCopyIobjectToEobject (
366     ACPI_OPERAND_OBJECT     *Obj,
367     ACPI_BUFFER             *RetBuffer);
368
369 ACPI_STATUS
370 AcpiUtCopyEsimpleToIsimple(
371     ACPI_OBJECT             *UserObj,
372     ACPI_OPERAND_OBJECT     **ReturnObj);
373
374 ACPI_STATUS
375 AcpiUtCopyEobjectToIobject (
376     ACPI_OBJECT             *Obj,
377     ACPI_OPERAND_OBJECT     **InternalObj);
378
379 ACPI_STATUS
380 AcpiUtCopyISimpleToIsimple (
381     ACPI_OPERAND_OBJECT     *SourceObj,
382     ACPI_OPERAND_OBJECT     *DestObj);
383
384 ACPI_STATUS
385 AcpiUtCopyIpackageToIpackage (
386     ACPI_OPERAND_OBJECT     *SourceObj,
387     ACPI_OPERAND_OBJECT     *DestObj,
388     ACPI_WALK_STATE         *WalkState);
389
390 ACPI_STATUS
391 AcpiUtCopySimpleObject (
392     ACPI_OPERAND_OBJECT     *SourceDesc,
393     ACPI_OPERAND_OBJECT     *DestDesc);
394
395 ACPI_STATUS
396 AcpiUtCopyIobjectToIobject (
397     ACPI_OPERAND_OBJECT     *SourceDesc,
398     ACPI_OPERAND_OBJECT     **DestDesc,
399     ACPI_WALK_STATE         *WalkState);
400
401
402 /*
403  * UtCreate - Object creation
404  */
405
406 ACPI_STATUS
407 AcpiUtUpdateObjectReference (
408     ACPI_OPERAND_OBJECT     *Object,
409     UINT16                  Action);
410
411
412 /*
413  * UtDebug - Debug interfaces
414  */
415
416 void
417 AcpiUtInitStackPtrTrace (
418     void);
419
420 void
421 AcpiUtTrackStackPtr (
422     void);
423
424 void
425 AcpiUtTrace (
426     UINT32                  LineNumber,
427     ACPI_DEBUG_PRINT_INFO   *DbgInfo);
428
429 void
430 AcpiUtTracePtr (
431     UINT32                  LineNumber,
432     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
433     void                    *Pointer);
434
435 void
436 AcpiUtTraceU32 (
437     UINT32                  LineNumber,
438     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
439     UINT32                  Integer);
440
441 void
442 AcpiUtTraceStr (
443     UINT32                  LineNumber,
444     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
445     char                    *String);
446
447 void
448 AcpiUtExit (
449     UINT32                  LineNumber,
450     ACPI_DEBUG_PRINT_INFO   *DbgInfo);
451
452 void
453 AcpiUtStatusExit (
454     UINT32                  LineNumber,
455     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
456     ACPI_STATUS             Status);
457
458 void
459 AcpiUtValueExit (
460     UINT32                  LineNumber,
461     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
462     ACPI_INTEGER            Value);
463
464 void
465 AcpiUtPtrExit (
466     UINT32                  LineNumber,
467     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
468     UINT8                   *Ptr);
469
470 void
471 AcpiUtReportInfo (
472     char                    *ModuleName,
473     UINT32                  LineNumber,
474     UINT32                  ComponentId);
475
476 void
477 AcpiUtReportError (
478     char                    *ModuleName,
479     UINT32                  LineNumber,
480     UINT32                  ComponentId);
481
482 void
483 AcpiUtReportWarning (
484     char                    *ModuleName,
485     UINT32                  LineNumber,
486     UINT32                  ComponentId);
487
488 void
489 AcpiUtDumpBuffer (
490     UINT8                   *Buffer,
491     UINT32                  Count,
492     UINT32                  Display,
493     UINT32                  componentId);
494
495 void ACPI_INTERNAL_VAR_XFACE
496 AcpiUtDebugPrint (
497     UINT32                  RequestedDebugLevel,
498     UINT32                  LineNumber,
499     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
500     char                    *Format,
501     ...) ACPI_PRINTF_LIKE_FUNC;
502
503 void ACPI_INTERNAL_VAR_XFACE
504 AcpiUtDebugPrintRaw (
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
516 void
517 AcpiUtDeleteInternalObj (
518     ACPI_OPERAND_OBJECT     *Object);
519
520 void
521 AcpiUtDeleteInternalPackageObject (
522     ACPI_OPERAND_OBJECT     *Object);
523
524 void
525 AcpiUtDeleteInternalSimpleObject (
526     ACPI_OPERAND_OBJECT     *Object);
527
528 void
529 AcpiUtDeleteInternalObjectList (
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
552 ACPI_STATUS
553 AcpiUtEvaluateObject (
554     ACPI_NAMESPACE_NODE     *PrefixNode,
555     char                    *Path,
556     UINT32                  ExpectedReturnBtypes,
557     ACPI_OPERAND_OBJECT     **ReturnDesc);
558
559 ACPI_STATUS
560 AcpiUtEvaluateNumericObject (
561     char                    *ObjectName,
562     ACPI_NAMESPACE_NODE     *DeviceNode,
563     ACPI_INTEGER            *Address);
564
565 ACPI_STATUS
566 AcpiUtExecute_HID (
567     ACPI_NAMESPACE_NODE     *DeviceNode,
568     ACPI_DEVICE_ID          *Hid);
569
570 ACPI_STATUS
571 AcpiUtExecute_CID (
572     ACPI_NAMESPACE_NODE     *DeviceNode,
573     ACPI_COMPATIBLE_ID_LIST **ReturnCidList);
574
575 ACPI_STATUS
576 AcpiUtExecute_STA (
577     ACPI_NAMESPACE_NODE     *DeviceNode,
578     UINT32                  *StatusFlags);
579
580 ACPI_STATUS
581 AcpiUtExecute_UID (
582     ACPI_NAMESPACE_NODE     *DeviceNode,
583     ACPI_DEVICE_ID          *Uid);
584
585
586 /*
587  * UtMutex - mutual exclusion interfaces
588  */
589
590 ACPI_STATUS
591 AcpiUtMutexInitialize (
592     void);
593
594 void
595 AcpiUtMutexTerminate (
596     void);
597
598 ACPI_STATUS
599 AcpiUtCreateMutex (
600     ACPI_MUTEX_HANDLE       MutexId);
601
602 ACPI_STATUS
603 AcpiUtDeleteMutex (
604     ACPI_MUTEX_HANDLE       MutexId);
605
606 ACPI_STATUS
607 AcpiUtAcquireMutex (
608     ACPI_MUTEX_HANDLE       MutexId);
609
610 ACPI_STATUS
611 AcpiUtReleaseMutex (
612     ACPI_MUTEX_HANDLE       MutexId);
613
614
615 /*
616  * UtObject - internal object create/delete/cache routines
617  */
618
619 ACPI_OPERAND_OBJECT  *
620 AcpiUtCreateInternalObjectDbg (
621     char                    *ModuleName,
622     UINT32                  LineNumber,
623     UINT32                  ComponentId,
624     ACPI_OBJECT_TYPE        Type);
625
626 void *
627 AcpiUtAllocateObjectDescDbg (
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
635 void
636 AcpiUtDeleteObjectDesc (
637     ACPI_OPERAND_OBJECT     *Object);
638
639 BOOLEAN
640 AcpiUtValidInternalObject (
641     void                    *Object);
642
643 ACPI_OPERAND_OBJECT *
644 AcpiUtCreateBufferObject (
645     ACPI_SIZE               BufferSize);
646
647
648 /*
649  * UtRefCnt - Object reference count management
650  */
651
652 void
653 AcpiUtAddReference (
654     ACPI_OPERAND_OBJECT     *Object);
655
656 void
657 AcpiUtRemoveReference (
658     ACPI_OPERAND_OBJECT     *Object);
659
660 /*
661  * UtSize - Object size routines
662  */
663
664 ACPI_STATUS
665 AcpiUtGetSimpleObjectSize (
666     ACPI_OPERAND_OBJECT     *Obj,
667     ACPI_SIZE               *ObjLength);
668
669 ACPI_STATUS
670 AcpiUtGetPackageObjectSize (
671     ACPI_OPERAND_OBJECT     *Obj,
672     ACPI_SIZE               *ObjLength);
673
674 ACPI_STATUS
675 AcpiUtGetObjectSize(
676     ACPI_OPERAND_OBJECT     *Obj,
677     ACPI_SIZE               *ObjLength);
678
679 ACPI_STATUS
680 AcpiUtGetElementLength (
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
691 void
692 AcpiUtPushGenericState (
693     ACPI_GENERIC_STATE      **ListHead,
694     ACPI_GENERIC_STATE      *State);
695
696 ACPI_GENERIC_STATE *
697 AcpiUtPopGenericState (
698     ACPI_GENERIC_STATE      **ListHead);
699
700
701 ACPI_GENERIC_STATE *
702 AcpiUtCreateGenericState (
703     void);
704
705 ACPI_THREAD_STATE *
706 AcpiUtCreateThreadState (
707     void);
708
709 ACPI_GENERIC_STATE *
710 AcpiUtCreateUpdateState (
711     ACPI_OPERAND_OBJECT     *Object,
712     UINT16                  Action);
713
714 ACPI_GENERIC_STATE *
715 AcpiUtCreatePkgState (
716     void                    *InternalObject,
717     void                    *ExternalObject,
718     UINT16                  Index);
719
720 ACPI_STATUS
721 AcpiUtCreateUpdateStateAndPush (
722     ACPI_OPERAND_OBJECT     *Object,
723     UINT16                  Action,
724     ACPI_GENERIC_STATE      **StateList);
725
726 ACPI_STATUS
727 AcpiUtCreatePkgStateAndPush (
728     void                    *InternalObject,
729     void                    *ExternalObject,
730     UINT16                  Index,
731     ACPI_GENERIC_STATE      **StateList);
732
733 ACPI_GENERIC_STATE *
734 AcpiUtCreateControlState (
735     void);
736
737 void
738 AcpiUtDeleteGenericState (
739     ACPI_GENERIC_STATE      *State);
740
741 void
742 AcpiUtDeleteGenericStateCache (
743     void);
744
745 void
746 AcpiUtDeleteObjectCache (
747     void);
748
749 /*
750  * utmisc
751  */
752
753 void
754 AcpiUtPrintString (
755     char                    *String,
756     UINT8                   MaxLength);
757
758 ACPI_STATUS
759 AcpiUtDivide (
760     ACPI_INTEGER            *InDividend,
761     ACPI_INTEGER            *InDivisor,
762     ACPI_INTEGER            *OutQuotient,
763     ACPI_INTEGER            *OutRemainder);
764
765 ACPI_STATUS
766 AcpiUtShortDivide (
767     ACPI_INTEGER            *InDividend,
768     UINT32                  Divisor,
769     ACPI_INTEGER            *OutQuotient,
770     UINT32                  *OutRemainder);
771
772 BOOLEAN
773 AcpiUtValidAcpiName (
774     UINT32                  Name);
775
776 BOOLEAN
777 AcpiUtValidAcpiCharacter (
778     char                    Character);
779
780 ACPI_STATUS
781 AcpiUtStrtoul64 (
782     char                    *String,
783     UINT32                  Base,
784     ACPI_INTEGER            *RetInteger);
785
786 char *
787 AcpiUtStrupr (
788     char                    *SrcString);
789
790 UINT8 *
791 AcpiUtGetResourceEndTag (
792     ACPI_OPERAND_OBJECT     *ObjDesc);
793
794 UINT8
795 AcpiUtGenerateChecksum (
796     UINT8                   *Buffer,
797     UINT32                  Length);
798
799 UINT32
800 AcpiUtDwordByteSwap (
801     UINT32                  Value);
802
803 void
804 AcpiUtSetIntegerWidth (
805     UINT8                   Revision);
806
807 #ifdef ACPI_DEBUG_OUTPUT
808 void
809 AcpiUtDisplayInitPathname (
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
821 void *
822 AcpiUtAcquireFromCache (
823     UINT32                  ListId);
824
825 void
826 AcpiUtReleaseToCache (
827     UINT32                  ListId,
828     void                    *Object);
829
830 void
831 AcpiUtDeleteGenericCache (
832     UINT32                  ListId);
833
834 ACPI_STATUS
835 AcpiUtValidateBuffer (
836     ACPI_BUFFER             *Buffer);
837
838 ACPI_STATUS
839 AcpiUtInitializeBuffer (
840     ACPI_BUFFER             *Buffer,
841     ACPI_SIZE               RequiredLength);
842
843
844 /* Memory allocation functions */
845
846 void *
847 AcpiUtAllocate (
848     ACPI_SIZE               Size,
849     UINT32                  Component,
850     char                    *Module,
851     UINT32                  Line);
852
853 void *
854 AcpiUtCallocate (
855     ACPI_SIZE               Size,
856     UINT32                  Component,
857     char                    *Module,
858     UINT32                  Line);
859
860
861 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
862
863 void *
864 AcpiUtAllocateAndTrack (
865     ACPI_SIZE               Size,
866     UINT32                  Component,
867     char                    *Module,
868     UINT32                  Line);
869
870 void *
871 AcpiUtCallocateAndTrack (
872     ACPI_SIZE               Size,
873     UINT32                  Component,
874     char                    *Module,
875     UINT32                  Line);
876
877 void
878 AcpiUtFreeAndTrack (
879     void                    *Address,
880     UINT32                  Component,
881     char                    *Module,
882     UINT32                  Line);
883
884 ACPI_DEBUG_MEM_BLOCK *
885 AcpiUtFindAllocation (
886     UINT32                  ListId,
887     void                    *Allocation);
888
889 ACPI_STATUS
890 AcpiUtTrackAllocation (
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
899 ACPI_STATUS
900 AcpiUtRemoveAllocation (
901     UINT32                  ListId,
902     ACPI_DEBUG_MEM_BLOCK    *Address,
903     UINT32                  Component,
904     char                    *Module,
905     UINT32                  Line);
906
907 void
908 AcpiUtDumpAllocationInfo (
909     void);
910
911 void
912 AcpiUtDumpAllocations (
913     UINT32                  Component,
914     char                    *Module);
915 #endif
916
917
918 #endif /* _ACUTILS_H */