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