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