Raise WARNS to 6:
[dragonfly.git] / sys / contrib / dev / acpica / acutils.h
1 /******************************************************************************
2  *
3  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4  *       $Revision: 154 $
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 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/acutils.h,v 1.1 2003/09/24 03:32:15 drhodus Exp $                                                               */
117
118 #ifndef _ACUTILS_H
119 #define _ACUTILS_H
120
121
122 typedef
123 ACPI_STATUS (*ACPI_PKG_CALLBACK) (
124     UINT8                   ObjectType,
125     ACPI_OPERAND_OBJECT     *SourceObject,
126     ACPI_GENERIC_STATE      *State,
127     void                    *Context);
128
129
130 ACPI_STATUS
131 AcpiUtWalkPackageTree (
132     ACPI_OPERAND_OBJECT     *SourceObject,
133     void                    *TargetObject,
134     ACPI_PKG_CALLBACK       WalkCallback,
135     void                    *Context);
136
137
138 typedef struct acpi_pkg_info
139 {
140     UINT8                   *FreeSpace;
141     ACPI_SIZE               Length;
142     UINT32                  ObjectSpace;
143     UINT32                  NumPackages;
144
145 } ACPI_PKG_INFO;
146
147 #define REF_INCREMENT       (UINT16) 0
148 #define REF_DECREMENT       (UINT16) 1
149 #define REF_FORCE_DELETE    (UINT16) 2
150
151 /* AcpiUtDumpBuffer */
152
153 #define DB_BYTE_DISPLAY     1
154 #define DB_WORD_DISPLAY     2
155 #define DB_DWORD_DISPLAY    4
156 #define DB_QWORD_DISPLAY    8
157
158
159 /* Global initialization interfaces */
160
161 void
162 AcpiUtInitGlobals (
163     void);
164
165 void
166 AcpiUtTerminate (
167     void);
168
169
170 /*
171  * UtInit - miscellaneous initialization and shutdown
172  */
173
174 ACPI_STATUS
175 AcpiUtHardwareInitialize (
176     void);
177
178 void
179 AcpiUtSubsystemShutdown (
180     void);
181
182 ACPI_STATUS
183 AcpiUtValidateFadt (
184     void);
185
186 /*
187  * UtGlobal - Global data structures and procedures
188  */
189
190 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
191
192 char *
193 AcpiUtGetMutexName (
194     UINT32                  MutexId);
195
196 #endif
197
198 char *
199 AcpiUtGetTypeName (
200     ACPI_OBJECT_TYPE        Type);
201
202 char *
203 AcpiUtGetObjectTypeName (
204     ACPI_OPERAND_OBJECT     *ObjDesc);
205
206 char *
207 AcpiUtGetRegionName (
208     UINT8                   SpaceId);
209
210 char *
211 AcpiUtGetEventName (
212     UINT32                  EventId);
213
214 char
215 AcpiUtHexToAsciiChar (
216     ACPI_INTEGER            Integer,
217     UINT32                  Position);
218
219 BOOLEAN
220 AcpiUtValidObjectType (
221     ACPI_OBJECT_TYPE        Type);
222
223 ACPI_OWNER_ID
224 AcpiUtAllocateOwnerId (
225     UINT32                  IdType);
226
227
228 /*
229  * UtClib - Local implementations of C library functions
230  */
231
232 #ifndef ACPI_USE_SYSTEM_CLIBRARY
233
234 ACPI_SIZE
235 AcpiUtStrlen (
236     const char              *String);
237
238 char *
239 AcpiUtStrcpy (
240     char                    *DstString,
241     const char              *SrcString);
242
243 char *
244 AcpiUtStrncpy (
245     char                    *DstString,
246     const char              *SrcString,
247     ACPI_SIZE               Count);
248
249 int
250 AcpiUtStrncmp (
251     const char              *String1,
252     const char              *String2,
253     ACPI_SIZE               Count);
254
255 int
256 AcpiUtStrcmp (
257     const char              *String1,
258     const char              *String2);
259
260 char *
261 AcpiUtStrcat (
262     char                    *DstString,
263     const char              *SrcString);
264
265 char *
266 AcpiUtStrncat (
267     char                    *DstString,
268     const char              *SrcString,
269     ACPI_SIZE               Count);
270
271 UINT32
272 AcpiUtStrtoul (
273     const char              *String,
274     char                    **Terminator,
275     UINT32                  Base);
276
277 char *
278 AcpiUtStrstr (
279     char                    *String1,
280     char                    *String2);
281
282 void *
283 AcpiUtMemcpy (
284     void                    *Dest,
285     const void              *Src,
286     ACPI_SIZE               Count);
287
288 void *
289 AcpiUtMemset (
290     void                    *Dest,
291     ACPI_NATIVE_UINT        Value,
292     ACPI_SIZE               Count);
293
294 int
295 AcpiUtToUpper (
296     int                     c);
297
298 int
299 AcpiUtToLower (
300     int                     c);
301
302 extern const UINT8 _acpi_ctype[];
303
304 #define _ACPI_XA     0x00    /* extra alphabetic - not supported */
305 #define _ACPI_XS     0x40    /* extra space */
306 #define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
307 #define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
308 #define _ACPI_DI     0x04    /* '0'-'9' */
309 #define _ACPI_LO     0x02    /* 'a'-'z' */
310 #define _ACPI_PU     0x10    /* punctuation */
311 #define _ACPI_SP     0x08    /* space */
312 #define _ACPI_UP     0x01    /* 'A'-'Z' */
313 #define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
314
315 #define ACPI_IS_DIGIT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
316 #define ACPI_IS_SPACE(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
317 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
318 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
319 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
320 #define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
321 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
322 #define ACPI_IS_ASCII(c)  ((c) < 0x80)
323
324 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
325
326 /*
327  * UtCopy - Object construction and conversion interfaces
328  */
329
330 ACPI_STATUS
331 AcpiUtBuildSimpleObject(
332     ACPI_OPERAND_OBJECT     *Obj,
333     ACPI_OBJECT             *UserObj,
334     UINT8                   *DataSpace,
335     UINT32                  *BufferSpaceUsed);
336
337 ACPI_STATUS
338 AcpiUtBuildPackageObject (
339     ACPI_OPERAND_OBJECT     *Obj,
340     UINT8                   *Buffer,
341     UINT32                  *SpaceUsed);
342
343 ACPI_STATUS
344 AcpiUtCopyIelementToEelement (
345     UINT8                   ObjectType,
346     ACPI_OPERAND_OBJECT     *SourceObject,
347     ACPI_GENERIC_STATE      *State,
348     void                    *Context);
349
350 ACPI_STATUS
351 AcpiUtCopyIelementToIelement (
352     UINT8                   ObjectType,
353     ACPI_OPERAND_OBJECT     *SourceObject,
354     ACPI_GENERIC_STATE      *State,
355     void                    *Context);
356
357 ACPI_STATUS
358 AcpiUtCopyIobjectToEobject (
359     ACPI_OPERAND_OBJECT     *Obj,
360     ACPI_BUFFER             *RetBuffer);
361
362 ACPI_STATUS
363 AcpiUtCopyEsimpleToIsimple(
364     ACPI_OBJECT             *UserObj,
365     ACPI_OPERAND_OBJECT     **ReturnObj);
366
367 ACPI_STATUS
368 AcpiUtCopyEobjectToIobject (
369     ACPI_OBJECT             *Obj,
370     ACPI_OPERAND_OBJECT     **InternalObj);
371
372 ACPI_STATUS
373 AcpiUtCopyISimpleToIsimple (
374     ACPI_OPERAND_OBJECT     *SourceObj,
375     ACPI_OPERAND_OBJECT     *DestObj);
376
377 ACPI_STATUS
378 AcpiUtCopyIpackageToIpackage (
379     ACPI_OPERAND_OBJECT     *SourceObj,
380     ACPI_OPERAND_OBJECT     *DestObj,
381     ACPI_WALK_STATE         *WalkState);
382
383 ACPI_STATUS
384 AcpiUtCopySimpleObject (
385     ACPI_OPERAND_OBJECT     *SourceDesc,
386     ACPI_OPERAND_OBJECT     *DestDesc);
387
388 ACPI_STATUS
389 AcpiUtCopyIobjectToIobject (
390     ACPI_OPERAND_OBJECT     *SourceDesc,
391     ACPI_OPERAND_OBJECT     **DestDesc,
392     ACPI_WALK_STATE         *WalkState);
393
394
395 /*
396  * UtCreate - Object creation
397  */
398
399 ACPI_STATUS
400 AcpiUtUpdateObjectReference (
401     ACPI_OPERAND_OBJECT     *Object,
402     UINT16                  Action);
403
404
405 /*
406  * UtDebug - Debug interfaces
407  */
408
409 void
410 AcpiUtInitStackPtrTrace (
411     void);
412
413 void
414 AcpiUtTrackStackPtr (
415     void);
416
417 void
418 AcpiUtTrace (
419     UINT32                  LineNumber,
420     ACPI_DEBUG_PRINT_INFO   *DbgInfo);
421
422 void
423 AcpiUtTracePtr (
424     UINT32                  LineNumber,
425     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
426     void                    *Pointer);
427
428 void
429 AcpiUtTraceU32 (
430     UINT32                  LineNumber,
431     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
432     UINT32                  Integer);
433
434 void
435 AcpiUtTraceStr (
436     UINT32                  LineNumber,
437     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
438     char                    *String);
439
440 void
441 AcpiUtExit (
442     UINT32                  LineNumber,
443     ACPI_DEBUG_PRINT_INFO   *DbgInfo);
444
445 void
446 AcpiUtStatusExit (
447     UINT32                  LineNumber,
448     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
449     ACPI_STATUS             Status);
450
451 void
452 AcpiUtValueExit (
453     UINT32                  LineNumber,
454     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
455     ACPI_INTEGER            Value);
456
457 void
458 AcpiUtPtrExit (
459     UINT32                  LineNumber,
460     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
461     UINT8                   *Ptr);
462
463 void
464 AcpiUtReportInfo (
465     char                    *ModuleName,
466     UINT32                  LineNumber,
467     UINT32                  ComponentId);
468
469 void
470 AcpiUtReportError (
471     char                    *ModuleName,
472     UINT32                  LineNumber,
473     UINT32                  ComponentId);
474
475 void
476 AcpiUtReportWarning (
477     char                    *ModuleName,
478     UINT32                  LineNumber,
479     UINT32                  ComponentId);
480
481 void
482 AcpiUtDumpBuffer (
483     UINT8                   *Buffer,
484     UINT32                  Count,
485     UINT32                  Display,
486     UINT32                  componentId);
487
488 void ACPI_INTERNAL_VAR_XFACE
489 AcpiUtDebugPrint (
490     UINT32                  RequestedDebugLevel,
491     UINT32                  LineNumber,
492     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
493     char                    *Format,
494     ...) ACPI_PRINTF_LIKE_FUNC;
495
496 void ACPI_INTERNAL_VAR_XFACE
497 AcpiUtDebugPrintRaw (
498     UINT32                  RequestedDebugLevel,
499     UINT32                  LineNumber,
500     ACPI_DEBUG_PRINT_INFO   *DbgInfo,
501     char                    *Format,
502     ...) ACPI_PRINTF_LIKE_FUNC;
503
504
505 /*
506  * UtDelete - Object deletion
507  */
508
509 void
510 AcpiUtDeleteInternalObj (
511     ACPI_OPERAND_OBJECT     *Object);
512
513 void
514 AcpiUtDeleteInternalPackageObject (
515     ACPI_OPERAND_OBJECT     *Object);
516
517 void
518 AcpiUtDeleteInternalSimpleObject (
519     ACPI_OPERAND_OBJECT     *Object);
520
521 void
522 AcpiUtDeleteInternalObjectList (
523     ACPI_OPERAND_OBJECT     **ObjList);
524
525
526 /*
527  * UtEval - object evaluation
528  */
529
530 /* Method name strings */
531
532 #define METHOD_NAME__HID        "_HID"
533 #define METHOD_NAME__CID        "_CID"
534 #define METHOD_NAME__UID        "_UID"
535 #define METHOD_NAME__ADR        "_ADR"
536 #define METHOD_NAME__STA        "_STA"
537 #define METHOD_NAME__REG        "_REG"
538 #define METHOD_NAME__SEG        "_SEG"
539 #define METHOD_NAME__BBN        "_BBN"
540 #define METHOD_NAME__PRT        "_PRT"
541 #define METHOD_NAME__CRS        "_CRS"
542 #define METHOD_NAME__PRS        "_PRS"
543
544
545 ACPI_STATUS
546 AcpiUtEvaluateObject (
547     ACPI_NAMESPACE_NODE     *PrefixNode,
548     char                    *Path,
549     UINT32                  ExpectedReturnBtypes,
550     ACPI_OPERAND_OBJECT     **ReturnDesc);
551
552 ACPI_STATUS
553 AcpiUtEvaluateNumericObject (
554     char                    *ObjectName,
555     ACPI_NAMESPACE_NODE     *DeviceNode,
556     ACPI_INTEGER            *Address);
557
558 ACPI_STATUS
559 AcpiUtExecute_HID (
560     ACPI_NAMESPACE_NODE     *DeviceNode,
561     ACPI_DEVICE_ID          *Hid);
562
563 ACPI_STATUS
564 AcpiUtExecute_CID (
565     ACPI_NAMESPACE_NODE     *DeviceNode,
566     ACPI_DEVICE_ID          *Cid);
567
568 ACPI_STATUS
569 AcpiUtExecute_STA (
570     ACPI_NAMESPACE_NODE     *DeviceNode,
571     UINT32                  *StatusFlags);
572
573 ACPI_STATUS
574 AcpiUtExecute_UID (
575     ACPI_NAMESPACE_NODE     *DeviceNode,
576     ACPI_DEVICE_ID          *Uid);
577
578
579 /*
580  * UtMutex - mutual exclusion interfaces
581  */
582
583 ACPI_STATUS
584 AcpiUtMutexInitialize (
585     void);
586
587 void
588 AcpiUtMutexTerminate (
589     void);
590
591 ACPI_STATUS
592 AcpiUtCreateMutex (
593     ACPI_MUTEX_HANDLE       MutexId);
594
595 ACPI_STATUS
596 AcpiUtDeleteMutex (
597     ACPI_MUTEX_HANDLE       MutexId);
598
599 ACPI_STATUS
600 AcpiUtAcquireMutex (
601     ACPI_MUTEX_HANDLE       MutexId);
602
603 ACPI_STATUS
604 AcpiUtReleaseMutex (
605     ACPI_MUTEX_HANDLE       MutexId);
606
607
608 /*
609  * UtObject - internal object create/delete/cache routines
610  */
611
612 ACPI_OPERAND_OBJECT  *
613 AcpiUtCreateInternalObjectDbg (
614     char                    *ModuleName,
615     UINT32                  LineNumber,
616     UINT32                  ComponentId,
617     ACPI_OBJECT_TYPE        Type);
618
619 void *
620 AcpiUtAllocateObjectDescDbg (
621     char                    *ModuleName,
622     UINT32                  LineNumber,
623     UINT32                  ComponentId);
624
625 #define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_THIS_MODULE,__LINE__,_COMPONENT,t)
626 #define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_THIS_MODULE,__LINE__,_COMPONENT)
627
628 void
629 AcpiUtDeleteObjectDesc (
630     ACPI_OPERAND_OBJECT     *Object);
631
632 BOOLEAN
633 AcpiUtValidInternalObject (
634     void                    *Object);
635
636 ACPI_OPERAND_OBJECT *
637 AcpiUtCreateBufferObject (
638     ACPI_SIZE               BufferSize);
639
640
641 /*
642  * UtRefCnt - Object reference count management
643  */
644
645 void
646 AcpiUtAddReference (
647     ACPI_OPERAND_OBJECT     *Object);
648
649 void
650 AcpiUtRemoveReference (
651     ACPI_OPERAND_OBJECT     *Object);
652
653 /*
654  * UtSize - Object size routines
655  */
656
657 ACPI_STATUS
658 AcpiUtGetSimpleObjectSize (
659     ACPI_OPERAND_OBJECT     *Obj,
660     ACPI_SIZE               *ObjLength);
661
662 ACPI_STATUS
663 AcpiUtGetPackageObjectSize (
664     ACPI_OPERAND_OBJECT     *Obj,
665     ACPI_SIZE               *ObjLength);
666
667 ACPI_STATUS
668 AcpiUtGetObjectSize(
669     ACPI_OPERAND_OBJECT     *Obj,
670     ACPI_SIZE               *ObjLength);
671
672 ACPI_STATUS
673 AcpiUtGetElementLength (
674     UINT8                   ObjectType,
675     ACPI_OPERAND_OBJECT     *SourceObject,
676     ACPI_GENERIC_STATE      *State,
677     void                    *Context);
678
679
680 /*
681  * UtState - Generic state creation/cache routines
682  */
683
684 void
685 AcpiUtPushGenericState (
686     ACPI_GENERIC_STATE      **ListHead,
687     ACPI_GENERIC_STATE      *State);
688
689 ACPI_GENERIC_STATE *
690 AcpiUtPopGenericState (
691     ACPI_GENERIC_STATE      **ListHead);
692
693
694 ACPI_GENERIC_STATE *
695 AcpiUtCreateGenericState (
696     void);
697
698 ACPI_THREAD_STATE *
699 AcpiUtCreateThreadState (
700     void);
701
702 ACPI_GENERIC_STATE *
703 AcpiUtCreateUpdateState (
704     ACPI_OPERAND_OBJECT     *Object,
705     UINT16                  Action);
706
707 ACPI_GENERIC_STATE *
708 AcpiUtCreatePkgState (
709     void                    *InternalObject,
710     void                    *ExternalObject,
711     UINT16                  Index);
712
713 ACPI_STATUS
714 AcpiUtCreateUpdateStateAndPush (
715     ACPI_OPERAND_OBJECT     *Object,
716     UINT16                  Action,
717     ACPI_GENERIC_STATE      **StateList);
718
719 ACPI_STATUS
720 AcpiUtCreatePkgStateAndPush (
721     void                    *InternalObject,
722     void                    *ExternalObject,
723     UINT16                  Index,
724     ACPI_GENERIC_STATE      **StateList);
725
726 ACPI_GENERIC_STATE *
727 AcpiUtCreateControlState (
728     void);
729
730 void
731 AcpiUtDeleteGenericState (
732     ACPI_GENERIC_STATE      *State);
733
734 void
735 AcpiUtDeleteGenericStateCache (
736     void);
737
738 void
739 AcpiUtDeleteObjectCache (
740     void);
741
742 /*
743  * utmisc
744  */
745
746 void
747 AcpiUtPrintString (
748     char                    *String,
749     UINT8                   MaxLength);
750
751 ACPI_STATUS
752 AcpiUtDivide (
753     ACPI_INTEGER            *InDividend,
754     ACPI_INTEGER            *InDivisor,
755     ACPI_INTEGER            *OutQuotient,
756     ACPI_INTEGER            *OutRemainder);
757
758 ACPI_STATUS
759 AcpiUtShortDivide (
760     ACPI_INTEGER            *InDividend,
761     UINT32                  Divisor,
762     ACPI_INTEGER            *OutQuotient,
763     UINT32                  *OutRemainder);
764
765 BOOLEAN
766 AcpiUtValidAcpiName (
767     UINT32                  Name);
768
769 BOOLEAN
770 AcpiUtValidAcpiCharacter (
771     char                    Character);
772
773 ACPI_STATUS
774 AcpiUtStrtoul64 (
775     char                    *String,
776     UINT32                  Base,
777     ACPI_INTEGER            *RetInteger);
778
779 char *
780 AcpiUtStrupr (
781     char                    *SrcString);
782
783 UINT8 *
784 AcpiUtGetResourceEndTag (
785     ACPI_OPERAND_OBJECT     *ObjDesc);
786
787 UINT8
788 AcpiUtGenerateChecksum (
789     UINT8                   *Buffer,
790     UINT32                  Length);
791
792 UINT32
793 AcpiUtDwordByteSwap (
794     UINT32                  Value);
795
796 void
797 AcpiUtSetIntegerWidth (
798     UINT8                   Revision);
799
800 #ifdef ACPI_DEBUG_OUTPUT
801 void
802 AcpiUtDisplayInitPathname (
803     UINT8                   Type,
804     ACPI_NAMESPACE_NODE     *ObjHandle,
805     char                    *Path);
806
807 #endif
808
809
810 /*
811  * Utalloc - memory allocation and object caching
812  */
813
814 void *
815 AcpiUtAcquireFromCache (
816     UINT32                  ListId);
817
818 void
819 AcpiUtReleaseToCache (
820     UINT32                  ListId,
821     void                    *Object);
822
823 void
824 AcpiUtDeleteGenericCache (
825     UINT32                  ListId);
826
827 ACPI_STATUS
828 AcpiUtValidateBuffer (
829     ACPI_BUFFER             *Buffer);
830
831 ACPI_STATUS
832 AcpiUtInitializeBuffer (
833     ACPI_BUFFER             *Buffer,
834     ACPI_SIZE               RequiredLength);
835
836
837 /* Memory allocation functions */
838
839 void *
840 AcpiUtAllocate (
841     ACPI_SIZE               Size,
842     UINT32                  Component,
843     char                    *Module,
844     UINT32                  Line);
845
846 void *
847 AcpiUtCallocate (
848     ACPI_SIZE               Size,
849     UINT32                  Component,
850     char                    *Module,
851     UINT32                  Line);
852
853
854 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
855
856 void *
857 AcpiUtAllocateAndTrack (
858     ACPI_SIZE               Size,
859     UINT32                  Component,
860     char                    *Module,
861     UINT32                  Line);
862
863 void *
864 AcpiUtCallocateAndTrack (
865     ACPI_SIZE               Size,
866     UINT32                  Component,
867     char                    *Module,
868     UINT32                  Line);
869
870 void
871 AcpiUtFreeAndTrack (
872     void                    *Address,
873     UINT32                  Component,
874     char                    *Module,
875     UINT32                  Line);
876
877 ACPI_DEBUG_MEM_BLOCK *
878 AcpiUtFindAllocation (
879     UINT32                  ListId,
880     void                    *Allocation);
881
882 ACPI_STATUS
883 AcpiUtTrackAllocation (
884     UINT32                  ListId,
885     ACPI_DEBUG_MEM_BLOCK    *Address,
886     ACPI_SIZE               Size,
887     UINT8                   AllocType,
888     UINT32                  Component,
889     char                    *Module,
890     UINT32                  Line);
891
892 ACPI_STATUS
893 AcpiUtRemoveAllocation (
894     UINT32                  ListId,
895     ACPI_DEBUG_MEM_BLOCK    *Address,
896     UINT32                  Component,
897     char                    *Module,
898     UINT32                  Line);
899
900 void
901 AcpiUtDumpAllocationInfo (
902     void);
903
904 void
905 AcpiUtDumpAllocations (
906     UINT32                  Component,
907     char                    *Module);
908 #endif
909
910
911 #endif /* _ACUTILS_H */