acutils.h revision 99679
1255253Ssjg/******************************************************************************
2246149Ssjg *
3246149Ssjg * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4246149Ssjg *       $Revision: 139 $
5246149Ssjg *
6246149Ssjg *****************************************************************************/
7246149Ssjg
8246149Ssjg/******************************************************************************
9246149Ssjg *
10246149Ssjg * 1. Copyright Notice
11246149Ssjg *
12246149Ssjg * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
13246149Ssjg * All rights reserved.
14246149Ssjg *
15246149Ssjg * 2. License
16246149Ssjg *
17246149Ssjg * 2.1. This is your license from Intel Corp. under its intellectual property
18246149Ssjg * rights.  You may have additional license terms from the party that provided
19246149Ssjg * you this software, covering your right to use that party's intellectual
20255253Ssjg * property rights.
21255253Ssjg *
22255253Ssjg * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23255253Ssjg * copy of the source code appearing in this file ("Covered Code") an
24255253Ssjg * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25255253Ssjg * base code distributed originally by Intel ("Original Intel Code") to copy,
26255253Ssjg * make derivatives, distribute, use and display any portion of the Covered
27246149Ssjg * Code in any form, with the right to sublicense such rights; and
28255253Ssjg *
29246149Ssjg * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30246149Ssjg * license (with the right to sublicense), under only those claims of Intel
31246149Ssjg * patents that are infringed by the Original Intel Code, to make, use, sell,
32246149Ssjg * offer to sell, and import the Covered Code and derivative works thereof
33246149Ssjg * solely to the minimum extent necessary to exercise the above copyright
34246149Ssjg * license, and in no event shall the patent license extend to any additions
35246149Ssjg * to or modifications of the Original Intel Code.  No other license or right
36246149Ssjg * is granted directly or by implication, estoppel or otherwise;
37246149Ssjg *
38246149Ssjg * The above copyright and patent license is granted only if the following
39255253Ssjg * conditions are met:
40255253Ssjg *
41255253Ssjg * 3. Conditions
42255253Ssjg *
43255253Ssjg * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44255253Ssjg * Redistribution of source code of any substantial portion of the Covered
45255253Ssjg * Code or modification with rights to further distribute source must include
46255253Ssjg * the above Copyright Notice, the above License, this list of Conditions,
47255253Ssjg * and the following Disclaimer and Export Compliance provision.  In addition,
48255253Ssjg * Licensee must cause all Covered Code to which Licensee contributes to
49255253Ssjg * contain a file documenting the changes Licensee made to create that Covered
50255253Ssjg * Code and the date of any change.  Licensee must include in that file the
51255253Ssjg * documentation of any changes made by any predecessor Licensee.  Licensee
52255253Ssjg * must include a prominent statement that the modification is derived,
53255253Ssjg * directly or indirectly, from Original Intel Code.
54255253Ssjg *
55255253Ssjg * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56246149Ssjg * Redistribution of source code of any substantial portion of the Covered
57255253Ssjg * Code or modification without rights to further distribute source must
58255253Ssjg * include the following Disclaimer and Export Compliance provision in the
59255253Ssjg * documentation and/or other materials provided with distribution.  In
60255253Ssjg * addition, Licensee may not authorize further sublicense of source of any
61255253Ssjg * portion of the Covered Code, and must include terms to the effect that the
62255253Ssjg * license from Licensee to its licensee is limited to the intellectual
63255253Ssjg * property embodied in the software Licensee provides to its licensee, and
64246149Ssjg * not to intellectual property embodied in modifications its licensee may
65246149Ssjg * make.
66246149Ssjg *
67246149Ssjg * 3.3. Redistribution of Executable. Redistribution in executable form of any
68246149Ssjg * substantial portion of the Covered Code or modification must reproduce the
69255253Ssjg * above Copyright Notice, and the following Disclaimer and Export Compliance
70255253Ssjg * provision in the documentation and/or other materials provided with the
71255253Ssjg * distribution.
72255253Ssjg *
73255253Ssjg * 3.4. Intel retains all right, title, and interest in and to the Original
74246149Ssjg * Intel Code.
75246149Ssjg *
76246149Ssjg * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77246149Ssjg * Intel shall be used in advertising or otherwise to promote the sale, use or
78246149Ssjg * other dealings in products derived from or relating to the Covered Code
79246149Ssjg * without prior written authorization from Intel.
80246149Ssjg *
81255253Ssjg * 4. Disclaimer and Export Compliance
82255253Ssjg *
83246149Ssjg * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84255253Ssjg * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85255253Ssjg * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86255253Ssjg * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87255253Ssjg * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88255253Ssjg * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89255253Ssjg * PARTICULAR PURPOSE.
90255253Ssjg *
91246149Ssjg * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92255253Ssjg * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93246149Ssjg * 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} ACPI_PKG_INFO;
144
145#define REF_INCREMENT       (UINT16) 0
146#define REF_DECREMENT       (UINT16) 1
147#define REF_FORCE_DELETE    (UINT16) 2
148
149/* AcpiUtDumpBuffer */
150
151#define DB_BYTE_DISPLAY     1
152#define DB_WORD_DISPLAY     2
153#define DB_DWORD_DISPLAY    4
154#define DB_QWORD_DISPLAY    8
155
156
157/* Global initialization interfaces */
158
159void
160AcpiUtInitGlobals (
161    void);
162
163void
164AcpiUtTerminate (
165    void);
166
167
168/*
169 * UtInit - miscellaneous initialization and shutdown
170 */
171
172ACPI_STATUS
173AcpiUtHardwareInitialize (
174    void);
175
176void
177AcpiUtSubsystemShutdown (
178    void);
179
180ACPI_STATUS
181AcpiUtValidateFadt (
182    void);
183
184/*
185 * UtGlobal - Global data structures and procedures
186 */
187
188#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
189
190NATIVE_CHAR *
191AcpiUtGetMutexName (
192    UINT32                  MutexId);
193
194NATIVE_CHAR *
195AcpiUtGetTypeName (
196    ACPI_OBJECT_TYPE        Type);
197
198NATIVE_CHAR *
199AcpiUtGetObjectTypeName (
200    ACPI_OPERAND_OBJECT     *ObjDesc);
201
202#endif
203
204
205NATIVE_CHAR *
206AcpiUtGetRegionName (
207    UINT8                   SpaceId);
208
209NATIVE_CHAR *
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
233UINT32
234AcpiUtStrlen (
235    const NATIVE_CHAR       *String);
236
237NATIVE_CHAR *
238AcpiUtStrcpy (
239    NATIVE_CHAR             *DstString,
240    const NATIVE_CHAR       *SrcString);
241
242NATIVE_CHAR *
243AcpiUtStrncpy (
244    NATIVE_CHAR             *DstString,
245    const NATIVE_CHAR       *SrcString,
246    NATIVE_UINT             Count);
247
248int
249AcpiUtStrncmp (
250    const NATIVE_CHAR       *String1,
251    const NATIVE_CHAR       *String2,
252    NATIVE_UINT             Count);
253
254UINT32
255AcpiUtStrcmp (
256    const NATIVE_CHAR       *String1,
257    const NATIVE_CHAR       *String2);
258
259NATIVE_CHAR *
260AcpiUtStrcat (
261    NATIVE_CHAR             *DstString,
262    const NATIVE_CHAR       *SrcString);
263
264NATIVE_CHAR *
265AcpiUtStrncat (
266    NATIVE_CHAR             *DstString,
267    const NATIVE_CHAR       *SrcString,
268    NATIVE_UINT             Count);
269
270UINT32
271AcpiUtStrtoul (
272    const NATIVE_CHAR       *String,
273    NATIVE_CHAR             **Terminator,
274    UINT32                  Base);
275
276NATIVE_CHAR *
277AcpiUtStrstr (
278    NATIVE_CHAR             *String1,
279    NATIVE_CHAR             *String2);
280
281void *
282AcpiUtMemcpy (
283    void                    *Dest,
284    const void              *Src,
285    NATIVE_UINT             Count);
286
287void *
288AcpiUtMemset (
289    void                    *Dest,
290    NATIVE_UINT             Value,
291    NATIVE_UINT             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
320#endif /* ACPI_USE_SYSTEM_CLIBRARY */
321
322/*
323 * UtCopy - Object construction and conversion interfaces
324 */
325
326ACPI_STATUS
327AcpiUtBuildSimpleObject(
328    ACPI_OPERAND_OBJECT     *Obj,
329    ACPI_OBJECT             *UserObj,
330    UINT8                   *DataSpace,
331    UINT32                  *BufferSpaceUsed);
332
333ACPI_STATUS
334AcpiUtBuildPackageObject (
335    ACPI_OPERAND_OBJECT     *Obj,
336    UINT8                   *Buffer,
337    UINT32                  *SpaceUsed);
338
339ACPI_STATUS
340AcpiUtCopyIelementToEelement (
341    UINT8                   ObjectType,
342    ACPI_OPERAND_OBJECT     *SourceObject,
343    ACPI_GENERIC_STATE      *State,
344    void                    *Context);
345
346ACPI_STATUS
347AcpiUtCopyIelementToIelement (
348    UINT8                   ObjectType,
349    ACPI_OPERAND_OBJECT     *SourceObject,
350    ACPI_GENERIC_STATE      *State,
351    void                    *Context);
352
353ACPI_STATUS
354AcpiUtCopyIobjectToEobject (
355    ACPI_OPERAND_OBJECT     *Obj,
356    ACPI_BUFFER             *RetBuffer);
357
358ACPI_STATUS
359AcpiUtCopyEsimpleToIsimple(
360    ACPI_OBJECT             *UserObj,
361    ACPI_OPERAND_OBJECT     **ReturnObj);
362
363ACPI_STATUS
364AcpiUtCopyEobjectToIobject (
365    ACPI_OBJECT             *Obj,
366    ACPI_OPERAND_OBJECT     **InternalObj);
367
368ACPI_STATUS
369AcpiUtCopyISimpleToIsimple (
370    ACPI_OPERAND_OBJECT     *SourceObj,
371    ACPI_OPERAND_OBJECT     *DestObj);
372
373ACPI_STATUS
374AcpiUtCopyIpackageToIpackage (
375    ACPI_OPERAND_OBJECT     *SourceObj,
376    ACPI_OPERAND_OBJECT     *DestObj,
377    ACPI_WALK_STATE         *WalkState);
378
379ACPI_STATUS
380AcpiUtCopySimpleObject (
381    ACPI_OPERAND_OBJECT     *SourceDesc,
382    ACPI_OPERAND_OBJECT     *DestDesc);
383
384ACPI_STATUS
385AcpiUtCopyIobjectToIobject (
386    ACPI_OPERAND_OBJECT     *SourceDesc,
387    ACPI_OPERAND_OBJECT     **DestDesc,
388    ACPI_WALK_STATE         *WalkState);
389
390
391/*
392 * UtCreate - Object creation
393 */
394
395ACPI_STATUS
396AcpiUtUpdateObjectReference (
397    ACPI_OPERAND_OBJECT     *Object,
398    UINT16                  Action);
399
400
401/*
402 * UtDebug - Debug interfaces
403 */
404
405void
406AcpiUtInitStackPtrTrace (
407    void);
408
409void
410AcpiUtTrackStackPtr (
411    void);
412
413void
414AcpiUtTrace (
415    UINT32                  LineNumber,
416    ACPI_DEBUG_PRINT_INFO   *DbgInfo);
417
418void
419AcpiUtTracePtr (
420    UINT32                  LineNumber,
421    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
422    void                    *Pointer);
423
424void
425AcpiUtTraceU32 (
426    UINT32                  LineNumber,
427    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
428    UINT32                  Integer);
429
430void
431AcpiUtTraceStr (
432    UINT32                  LineNumber,
433    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
434    NATIVE_CHAR             *String);
435
436void
437AcpiUtExit (
438    UINT32                  LineNumber,
439    ACPI_DEBUG_PRINT_INFO   *DbgInfo);
440
441void
442AcpiUtStatusExit (
443    UINT32                  LineNumber,
444    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
445    ACPI_STATUS             Status);
446
447void
448AcpiUtValueExit (
449    UINT32                  LineNumber,
450    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
451    ACPI_INTEGER            Value);
452
453void
454AcpiUtPtrExit (
455    UINT32                  LineNumber,
456    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
457    UINT8                   *Ptr);
458
459void
460AcpiUtReportInfo (
461    NATIVE_CHAR             *ModuleName,
462    UINT32                  LineNumber,
463    UINT32                  ComponentId);
464
465void
466AcpiUtReportError (
467    NATIVE_CHAR             *ModuleName,
468    UINT32                  LineNumber,
469    UINT32                  ComponentId);
470
471void
472AcpiUtReportWarning (
473    NATIVE_CHAR             *ModuleName,
474    UINT32                  LineNumber,
475    UINT32                  ComponentId);
476
477void
478AcpiUtDumpBuffer (
479    UINT8                   *Buffer,
480    UINT32                  Count,
481    UINT32                  Display,
482    UINT32                  componentId);
483
484void ACPI_INTERNAL_VAR_XFACE
485AcpiUtDebugPrint (
486    UINT32                  RequestedDebugLevel,
487    UINT32                  LineNumber,
488    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
489    char                    *Format,
490    ...) ACPI_PRINTF_LIKE_FUNC;
491
492void ACPI_INTERNAL_VAR_XFACE
493AcpiUtDebugPrintRaw (
494    UINT32                  RequestedDebugLevel,
495    UINT32                  LineNumber,
496    ACPI_DEBUG_PRINT_INFO   *DbgInfo,
497    char                    *Format,
498    ...) ACPI_PRINTF_LIKE_FUNC;
499
500
501/*
502 * UtDelete - Object deletion
503 */
504
505void
506AcpiUtDeleteInternalObj (
507    ACPI_OPERAND_OBJECT     *Object);
508
509void
510AcpiUtDeleteInternalPackageObject (
511    ACPI_OPERAND_OBJECT     *Object);
512
513void
514AcpiUtDeleteInternalSimpleObject (
515    ACPI_OPERAND_OBJECT     *Object);
516
517void
518AcpiUtDeleteInternalObjectList (
519    ACPI_OPERAND_OBJECT     **ObjList);
520
521
522/*
523 * UtEval - object evaluation
524 */
525
526/* Method name strings */
527
528#define METHOD_NAME__HID        "_HID"
529#define METHOD_NAME__CID        "_CID"
530#define METHOD_NAME__UID        "_UID"
531#define METHOD_NAME__ADR        "_ADR"
532#define METHOD_NAME__STA        "_STA"
533#define METHOD_NAME__REG        "_REG"
534#define METHOD_NAME__SEG        "_SEG"
535#define METHOD_NAME__BBN        "_BBN"
536#define METHOD_NAME__PRT        "_PRT"
537
538
539ACPI_STATUS
540AcpiUtEvaluateNumericObject (
541    NATIVE_CHAR             *ObjectName,
542    ACPI_NAMESPACE_NODE     *DeviceNode,
543    ACPI_INTEGER            *Address);
544
545ACPI_STATUS
546AcpiUtExecute_HID (
547    ACPI_NAMESPACE_NODE     *DeviceNode,
548    ACPI_DEVICE_ID          *Hid);
549
550ACPI_STATUS
551AcpiUtExecute_CID (
552    ACPI_NAMESPACE_NODE     *DeviceNode,
553    ACPI_DEVICE_ID          *Cid);
554
555ACPI_STATUS
556AcpiUtExecute_STA (
557    ACPI_NAMESPACE_NODE     *DeviceNode,
558    UINT32                  *StatusFlags);
559
560ACPI_STATUS
561AcpiUtExecute_UID (
562    ACPI_NAMESPACE_NODE     *DeviceNode,
563    ACPI_DEVICE_ID          *Uid);
564
565
566/*
567 * UtMutex - mutual exclusion interfaces
568 */
569
570ACPI_STATUS
571AcpiUtMutexInitialize (
572    void);
573
574void
575AcpiUtMutexTerminate (
576    void);
577
578ACPI_STATUS
579AcpiUtCreateMutex (
580    ACPI_MUTEX_HANDLE       MutexId);
581
582ACPI_STATUS
583AcpiUtDeleteMutex (
584    ACPI_MUTEX_HANDLE       MutexId);
585
586ACPI_STATUS
587AcpiUtAcquireMutex (
588    ACPI_MUTEX_HANDLE       MutexId);
589
590ACPI_STATUS
591AcpiUtReleaseMutex (
592    ACPI_MUTEX_HANDLE       MutexId);
593
594
595/*
596 * UtObject - internal object create/delete/cache routines
597 */
598
599ACPI_OPERAND_OBJECT  *
600AcpiUtCreateInternalObjectDbg (
601    NATIVE_CHAR             *ModuleName,
602    UINT32                  LineNumber,
603    UINT32                  ComponentId,
604    ACPI_OBJECT_TYPE        Type);
605
606void *
607AcpiUtAllocateObjectDescDbg (
608    NATIVE_CHAR             *ModuleName,
609    UINT32                  LineNumber,
610    UINT32                  ComponentId);
611
612#define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_THIS_MODULE,__LINE__,_COMPONENT,t)
613#define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_THIS_MODULE,__LINE__,_COMPONENT)
614
615void
616AcpiUtDeleteObjectDesc (
617    ACPI_OPERAND_OBJECT     *Object);
618
619BOOLEAN
620AcpiUtValidInternalObject (
621    void                    *Object);
622
623
624/*
625 * UtRefCnt - Object reference count management
626 */
627
628void
629AcpiUtAddReference (
630    ACPI_OPERAND_OBJECT     *Object);
631
632void
633AcpiUtRemoveReference (
634    ACPI_OPERAND_OBJECT     *Object);
635
636/*
637 * UtSize - Object size routines
638 */
639
640ACPI_STATUS
641AcpiUtGetSimpleObjectSize (
642    ACPI_OPERAND_OBJECT     *Obj,
643    ACPI_SIZE               *ObjLength);
644
645ACPI_STATUS
646AcpiUtGetPackageObjectSize (
647    ACPI_OPERAND_OBJECT     *Obj,
648    ACPI_SIZE               *ObjLength);
649
650ACPI_STATUS
651AcpiUtGetObjectSize(
652    ACPI_OPERAND_OBJECT     *Obj,
653    ACPI_SIZE               *ObjLength);
654
655ACPI_STATUS
656AcpiUtGetElementLength (
657    UINT8                   ObjectType,
658    ACPI_OPERAND_OBJECT     *SourceObject,
659    ACPI_GENERIC_STATE      *State,
660    void                    *Context);
661
662
663/*
664 * UtState - Generic state creation/cache routines
665 */
666
667void
668AcpiUtPushGenericState (
669    ACPI_GENERIC_STATE      **ListHead,
670    ACPI_GENERIC_STATE      *State);
671
672ACPI_GENERIC_STATE *
673AcpiUtPopGenericState (
674    ACPI_GENERIC_STATE      **ListHead);
675
676
677ACPI_GENERIC_STATE *
678AcpiUtCreateGenericState (
679    void);
680
681ACPI_THREAD_STATE *
682AcpiUtCreateThreadState (
683    void);
684
685ACPI_GENERIC_STATE *
686AcpiUtCreateUpdateState (
687    ACPI_OPERAND_OBJECT     *Object,
688    UINT16                  Action);
689
690ACPI_GENERIC_STATE *
691AcpiUtCreatePkgState (
692    void                    *InternalObject,
693    void                    *ExternalObject,
694    UINT16                  Index);
695
696ACPI_STATUS
697AcpiUtCreateUpdateStateAndPush (
698    ACPI_OPERAND_OBJECT     *Object,
699    UINT16                  Action,
700    ACPI_GENERIC_STATE      **StateList);
701
702ACPI_STATUS
703AcpiUtCreatePkgStateAndPush (
704    void                    *InternalObject,
705    void                    *ExternalObject,
706    UINT16                  Index,
707    ACPI_GENERIC_STATE      **StateList);
708
709ACPI_GENERIC_STATE *
710AcpiUtCreateControlState (
711    void);
712
713void
714AcpiUtDeleteGenericState (
715    ACPI_GENERIC_STATE      *State);
716
717void
718AcpiUtDeleteGenericStateCache (
719    void);
720
721void
722AcpiUtDeleteObjectCache (
723    void);
724
725/*
726 * utmisc
727 */
728
729ACPI_STATUS
730AcpiUtDivide (
731    ACPI_INTEGER            *InDividend,
732    ACPI_INTEGER            *InDivisor,
733    ACPI_INTEGER            *OutQuotient,
734    ACPI_INTEGER            *OutRemainder);
735
736ACPI_STATUS
737AcpiUtShortDivide (
738    ACPI_INTEGER            *InDividend,
739    UINT32                  Divisor,
740    ACPI_INTEGER            *OutQuotient,
741    UINT32                  *OutRemainder);
742
743BOOLEAN
744AcpiUtValidAcpiName (
745    UINT32                  Name);
746
747BOOLEAN
748AcpiUtValidAcpiCharacter (
749    NATIVE_CHAR             Character);
750
751ACPI_STATUS
752AcpiUtStrtoul64 (
753    NATIVE_CHAR             *String,
754    UINT32                  Base,
755    ACPI_INTEGER            *RetInteger);
756
757NATIVE_CHAR *
758AcpiUtStrupr (
759    NATIVE_CHAR             *SrcString);
760
761UINT8 *
762AcpiUtGetResourceEndTag (
763    ACPI_OPERAND_OBJECT     *ObjDesc);
764
765UINT8
766AcpiUtGenerateChecksum (
767    UINT8                   *Buffer,
768    UINT32                  Length);
769
770UINT32
771AcpiUtDwordByteSwap (
772    UINT32                  Value);
773
774void
775AcpiUtSetIntegerWidth (
776    UINT8                   Revision);
777
778#ifdef ACPI_DEBUG
779void
780AcpiUtDisplayInitPathname (
781    ACPI_HANDLE             ObjHandle,
782    char                    *Path);
783
784#endif
785
786
787/*
788 * Utalloc - memory allocation and object caching
789 */
790
791void *
792AcpiUtAcquireFromCache (
793    UINT32                  ListId);
794
795void
796AcpiUtReleaseToCache (
797    UINT32                  ListId,
798    void                    *Object);
799
800void
801AcpiUtDeleteGenericCache (
802    UINT32                  ListId);
803
804ACPI_STATUS
805AcpiUtValidateBuffer (
806    ACPI_BUFFER             *Buffer);
807
808ACPI_STATUS
809AcpiUtInitializeBuffer (
810    ACPI_BUFFER             *Buffer,
811    ACPI_SIZE               RequiredLength);
812
813
814/* Memory allocation functions */
815
816void *
817AcpiUtAllocate (
818    ACPI_SIZE               Size,
819    UINT32                  Component,
820    NATIVE_CHAR             *Module,
821    UINT32                  Line);
822
823void *
824AcpiUtCallocate (
825    ACPI_SIZE               Size,
826    UINT32                  Component,
827    NATIVE_CHAR             *Module,
828    UINT32                  Line);
829
830
831#ifdef ACPI_DBG_TRACK_ALLOCATIONS
832
833void *
834AcpiUtAllocateAndTrack (
835    ACPI_SIZE               Size,
836    UINT32                  Component,
837    NATIVE_CHAR             *Module,
838    UINT32                  Line);
839
840void *
841AcpiUtCallocateAndTrack (
842    ACPI_SIZE               Size,
843    UINT32                  Component,
844    NATIVE_CHAR             *Module,
845    UINT32                  Line);
846
847void
848AcpiUtFreeAndTrack (
849    void                    *Address,
850    UINT32                  Component,
851    NATIVE_CHAR             *Module,
852    UINT32                  Line);
853
854ACPI_DEBUG_MEM_BLOCK *
855AcpiUtFindAllocation (
856    UINT32                  ListId,
857    void                    *Allocation);
858
859ACPI_STATUS
860AcpiUtTrackAllocation (
861    UINT32                  ListId,
862    ACPI_DEBUG_MEM_BLOCK    *Address,
863    ACPI_SIZE               Size,
864    UINT8                   AllocType,
865    UINT32                  Component,
866    NATIVE_CHAR             *Module,
867    UINT32                  Line);
868
869ACPI_STATUS
870AcpiUtRemoveAllocation (
871    UINT32                  ListId,
872    ACPI_DEBUG_MEM_BLOCK    *Address,
873    UINT32                  Component,
874    NATIVE_CHAR             *Module,
875    UINT32                  Line);
876
877void
878AcpiUtDumpAllocationInfo (
879    void);
880
881void
882AcpiUtDumpAllocations (
883    UINT32                  Component,
884    NATIVE_CHAR             *Module);
885#endif
886
887
888#endif /* _ACUTILS_H */
889