xref: /titanic_44/usr/src/uts/intel/sys/acpi/acutils.h (revision 587032cf0967234b39ccb50adca936a367841063)
1 /******************************************************************************
2  *
3  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4  *       $Revision: 1.189 $
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 
117 #ifndef _ACUTILS_H
118 #define _ACUTILS_H
119 
120 
121 extern const UINT8                      AcpiGbl_ResourceAmlSizes[];
122 
123 /* Strings used by the disassembler and debugger resource dump routines */
124 
125 #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
126 
127 extern const char                       *AcpiGbl_BMDecode[2];
128 extern const char                       *AcpiGbl_ConfigDecode[4];
129 extern const char                       *AcpiGbl_ConsumeDecode[2];
130 extern const char                       *AcpiGbl_DECDecode[2];
131 extern const char                       *AcpiGbl_HEDecode[2];
132 extern const char                       *AcpiGbl_IoDecode[2];
133 extern const char                       *AcpiGbl_LLDecode[2];
134 extern const char                       *AcpiGbl_MaxDecode[2];
135 extern const char                       *AcpiGbl_MEMDecode[4];
136 extern const char                       *AcpiGbl_MinDecode[2];
137 extern const char                       *AcpiGbl_MTPDecode[4];
138 extern const char                       *AcpiGbl_RNGDecode[4];
139 extern const char                       *AcpiGbl_RWDecode[2];
140 extern const char                       *AcpiGbl_SHRDecode[2];
141 extern const char                       *AcpiGbl_SIZDecode[4];
142 extern const char                       *AcpiGbl_TRSDecode[2];
143 extern const char                       *AcpiGbl_TTPDecode[2];
144 extern const char                       *AcpiGbl_TYPDecode[4];
145 #endif
146 
147 /* Types for Resource descriptor entries */
148 
149 #define ACPI_INVALID_RESOURCE           0
150 #define ACPI_FIXED_LENGTH               1
151 #define ACPI_VARIABLE_LENGTH            2
152 #define ACPI_SMALL_VARIABLE_LENGTH      3
153 
154 typedef
155 ACPI_STATUS (*ACPI_PKG_CALLBACK) (
156     UINT8                   ObjectType,
157     ACPI_OPERAND_OBJECT     *SourceObject,
158     ACPI_GENERIC_STATE      *State,
159     void                    *Context);
160 
161 typedef struct acpi_pkg_info
162 {
163     UINT8                   *FreeSpace;
164     ACPI_SIZE               Length;
165     UINT32                  ObjectSpace;
166     UINT32                  NumPackages;
167 
168 } ACPI_PKG_INFO;
169 
170 #define REF_INCREMENT       (UINT16) 0
171 #define REF_DECREMENT       (UINT16) 1
172 #define REF_FORCE_DELETE    (UINT16) 2
173 
174 /* AcpiUtDumpBuffer */
175 
176 #define DB_BYTE_DISPLAY     1
177 #define DB_WORD_DISPLAY     2
178 #define DB_DWORD_DISPLAY    4
179 #define DB_QWORD_DISPLAY    8
180 
181 
182 /*
183  * utglobal - Global data structures and procedures
184  */
185 void
186 AcpiUtInitGlobals (
187     void);
188 
189 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
190 
191 char *
192 AcpiUtGetMutexName (
193     UINT32                  MutexId);
194 
195 #endif
196 
197 char *
198 AcpiUtGetTypeName (
199     ACPI_OBJECT_TYPE        Type);
200 
201 char *
202 AcpiUtGetNodeName (
203     void                    *Object);
204 
205 char *
206 AcpiUtGetDescriptorName (
207     void                    *Object);
208 
209 char *
210 AcpiUtGetObjectTypeName (
211     ACPI_OPERAND_OBJECT     *ObjDesc);
212 
213 char *
214 AcpiUtGetRegionName (
215     UINT8                   SpaceId);
216 
217 char *
218 AcpiUtGetEventName (
219     UINT32                  EventId);
220 
221 char
222 AcpiUtHexToAsciiChar (
223     ACPI_INTEGER            Integer,
224     UINT32                  Position);
225 
226 BOOLEAN
227 AcpiUtValidObjectType (
228     ACPI_OBJECT_TYPE        Type);
229 
230 
231 /*
232  * utinit - miscellaneous initialization and shutdown
233  */
234 ACPI_STATUS
235 AcpiUtHardwareInitialize (
236     void);
237 
238 void
239 AcpiUtSubsystemShutdown (
240     void);
241 
242 ACPI_STATUS
243 AcpiUtValidateFadt (
244     void);
245 
246 
247 /*
248  * utclib - Local implementations of C library functions
249  */
250 #ifndef ACPI_USE_SYSTEM_CLIBRARY
251 
252 ACPI_SIZE
253 AcpiUtStrlen (
254     const char              *String);
255 
256 char *
257 AcpiUtStrcpy (
258     char                    *DstString,
259     const char              *SrcString);
260 
261 char *
262 AcpiUtStrncpy (
263     char                    *DstString,
264     const char              *SrcString,
265     ACPI_SIZE               Count);
266 
267 int
268 AcpiUtMemcmp (
269     const char              *Buffer1,
270     const char              *Buffer2,
271     ACPI_SIZE               Count);
272 
273 int
274 AcpiUtStrncmp (
275     const char              *String1,
276     const char              *String2,
277     ACPI_SIZE               Count);
278 
279 int
280 AcpiUtStrcmp (
281     const char              *String1,
282     const char              *String2);
283 
284 char *
285 AcpiUtStrcat (
286     char                    *DstString,
287     const char              *SrcString);
288 
289 char *
290 AcpiUtStrncat (
291     char                    *DstString,
292     const char              *SrcString,
293     ACPI_SIZE               Count);
294 
295 UINT32
296 AcpiUtStrtoul (
297     const char              *String,
298     char                    **Terminator,
299     UINT32                  Base);
300 
301 char *
302 AcpiUtStrstr (
303     char                    *String1,
304     char                    *String2);
305 
306 void *
307 AcpiUtMemcpy (
308     void                    *Dest,
309     const void              *Src,
310     ACPI_SIZE               Count);
311 
312 void *
313 AcpiUtMemset (
314     void                    *Dest,
315     ACPI_NATIVE_UINT        Value,
316     ACPI_SIZE               Count);
317 
318 int
319 AcpiUtToUpper (
320     int                     c);
321 
322 int
323 AcpiUtToLower (
324     int                     c);
325 
326 extern const UINT8 _acpi_ctype[];
327 
328 #define _ACPI_XA     0x00    /* extra alphabetic - not supported */
329 #define _ACPI_XS     0x40    /* extra space */
330 #define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
331 #define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
332 #define _ACPI_DI     0x04    /* '0'-'9' */
333 #define _ACPI_LO     0x02    /* 'a'-'z' */
334 #define _ACPI_PU     0x10    /* punctuation */
335 #define _ACPI_SP     0x08    /* space */
336 #define _ACPI_UP     0x01    /* 'A'-'Z' */
337 #define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
338 
339 #define ACPI_IS_DIGIT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
340 #define ACPI_IS_SPACE(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
341 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
342 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
343 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
344 #define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
345 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
346 
347 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
348 
349 
350 /*
351  * utcopy - Object construction and conversion interfaces
352  */
353 ACPI_STATUS
354 AcpiUtBuildSimpleObject(
355     ACPI_OPERAND_OBJECT     *Obj,
356     ACPI_OBJECT             *UserObj,
357     UINT8                   *DataSpace,
358     UINT32                  *BufferSpaceUsed);
359 
360 ACPI_STATUS
361 AcpiUtBuildPackageObject (
362     ACPI_OPERAND_OBJECT     *Obj,
363     UINT8                   *Buffer,
364     UINT32                  *SpaceUsed);
365 
366 ACPI_STATUS
367 AcpiUtCopyIobjectToEobject (
368     ACPI_OPERAND_OBJECT     *Obj,
369     ACPI_BUFFER             *RetBuffer);
370 
371 ACPI_STATUS
372 AcpiUtCopyEobjectToIobject (
373     ACPI_OBJECT             *Obj,
374     ACPI_OPERAND_OBJECT     **InternalObj);
375 
376 ACPI_STATUS
377 AcpiUtCopyISimpleToIsimple (
378     ACPI_OPERAND_OBJECT     *SourceObj,
379     ACPI_OPERAND_OBJECT     *DestObj);
380 
381 ACPI_STATUS
382 AcpiUtCopyIobjectToIobject (
383     ACPI_OPERAND_OBJECT     *SourceDesc,
384     ACPI_OPERAND_OBJECT     **DestDesc,
385     ACPI_WALK_STATE         *WalkState);
386 
387 
388 /*
389  * utcreate - Object creation
390  */
391 ACPI_STATUS
392 AcpiUtUpdateObjectReference (
393     ACPI_OPERAND_OBJECT     *Object,
394     UINT16                  Action);
395 
396 
397 /*
398  * utdebug - Debug interfaces
399  */
400 void
401 AcpiUtInitStackPtrTrace (
402     void);
403 
404 void
405 AcpiUtTrackStackPtr (
406     void);
407 
408 void
409 AcpiUtTrace (
410     UINT32                  LineNumber,
411     const char              *FunctionName,
412     char                    *ModuleName,
413     UINT32                  ComponentId);
414 
415 void
416 AcpiUtTracePtr (
417     UINT32                  LineNumber,
418     const char              *FunctionName,
419     char                    *ModuleName,
420     UINT32                  ComponentId,
421     void                    *Pointer);
422 
423 void
424 AcpiUtTraceU32 (
425     UINT32                  LineNumber,
426     const char              *FunctionName,
427     char                    *ModuleName,
428     UINT32                  ComponentId,
429     UINT32                  Integer);
430 
431 void
432 AcpiUtTraceStr (
433     UINT32                  LineNumber,
434     const char              *FunctionName,
435     char                    *ModuleName,
436     UINT32                  ComponentId,
437     char                    *String);
438 
439 void
440 AcpiUtExit (
441     UINT32                  LineNumber,
442     const char              *FunctionName,
443     char                    *ModuleName,
444     UINT32                  ComponentId);
445 
446 void
447 AcpiUtStatusExit (
448     UINT32                  LineNumber,
449     const char              *FunctionName,
450     char                    *ModuleName,
451     UINT32                  ComponentId,
452     ACPI_STATUS             Status);
453 
454 void
455 AcpiUtValueExit (
456     UINT32                  LineNumber,
457     const char              *FunctionName,
458     char                    *ModuleName,
459     UINT32                  ComponentId,
460     ACPI_INTEGER            Value);
461 
462 void
463 AcpiUtPtrExit (
464     UINT32                  LineNumber,
465     const char              *FunctionName,
466     char                    *ModuleName,
467     UINT32                  ComponentId,
468     UINT8                   *Ptr);
469 
470 void
471 AcpiUtDumpBuffer (
472     UINT8                   *Buffer,
473     UINT32                  Count,
474     UINT32                  Display,
475     UINT32                  componentId);
476 
477 void
478 AcpiUtReportError (
479     char                    *ModuleName,
480     UINT32                  LineNumber);
481 
482 void
483 AcpiUtReportInfo (
484     char                    *ModuleName,
485     UINT32                  LineNumber);
486 
487 void
488 AcpiUtReportWarning (
489     char                    *ModuleName,
490     UINT32                  LineNumber);
491 
492 /* Error and message reporting interfaces */
493 
494 void ACPI_INTERNAL_VAR_XFACE
495 AcpiUtDebugPrint (
496     UINT32                  RequestedDebugLevel,
497     UINT32                  LineNumber,
498     const char              *FunctionName,
499     char                    *ModuleName,
500     UINT32                  ComponentId,
501     char                    *Format,
502     ...) ACPI_PRINTF_LIKE(6);
503 
504 void ACPI_INTERNAL_VAR_XFACE
505 AcpiUtDebugPrintRaw (
506     UINT32                  RequestedDebugLevel,
507     UINT32                  LineNumber,
508     const char              *FunctionName,
509     char                    *ModuleName,
510     UINT32                  ComponentId,
511     char                    *Format,
512     ...) ACPI_PRINTF_LIKE(6);
513 
514 void ACPI_INTERNAL_VAR_XFACE
515 AcpiUtError (
516     char                    *ModuleName,
517     UINT32                  LineNumber,
518     char                    *Format,
519     ...) ACPI_PRINTF_LIKE(3);
520 
521 void  ACPI_INTERNAL_VAR_XFACE
522 AcpiUtException (
523     char                    *ModuleName,
524     UINT32                  LineNumber,
525     ACPI_STATUS             Status,
526     char                    *Format,
527     ...) ACPI_PRINTF_LIKE(4);
528 
529 void ACPI_INTERNAL_VAR_XFACE
530 AcpiUtWarning (
531     char                    *ModuleName,
532     UINT32                  LineNumber,
533     char                    *Format,
534     ...) ACPI_PRINTF_LIKE(3);
535 
536 void ACPI_INTERNAL_VAR_XFACE
537 AcpiUtInfo (
538     char                    *ModuleName,
539     UINT32                  LineNumber,
540     char                    *Format,
541     ...) ACPI_PRINTF_LIKE(3);
542 
543 
544 /*
545  * utdelete - Object deletion and reference counts
546  */
547 void
548 AcpiUtAddReference (
549     ACPI_OPERAND_OBJECT     *Object);
550 
551 void
552 AcpiUtRemoveReference (
553     ACPI_OPERAND_OBJECT     *Object);
554 
555 void
556 AcpiUtDeleteInternalPackageObject (
557     ACPI_OPERAND_OBJECT     *Object);
558 
559 void
560 AcpiUtDeleteInternalSimpleObject (
561     ACPI_OPERAND_OBJECT     *Object);
562 
563 void
564 AcpiUtDeleteInternalObjectList (
565     ACPI_OPERAND_OBJECT     **ObjList);
566 
567 
568 /*
569  * uteval - object evaluation
570  */
571 ACPI_STATUS
572 AcpiUtOsiImplementation (
573     ACPI_WALK_STATE         *WalkState);
574 
575 ACPI_STATUS
576 AcpiUtEvaluateObject (
577     ACPI_NAMESPACE_NODE     *PrefixNode,
578     char                    *Path,
579     UINT32                  ExpectedReturnBtypes,
580     ACPI_OPERAND_OBJECT     **ReturnDesc);
581 
582 ACPI_STATUS
583 AcpiUtEvaluateNumericObject (
584     char                    *ObjectName,
585     ACPI_NAMESPACE_NODE     *DeviceNode,
586     ACPI_INTEGER            *Address);
587 
588 ACPI_STATUS
589 AcpiUtExecute_HID (
590     ACPI_NAMESPACE_NODE     *DeviceNode,
591     ACPI_DEVICE_ID          *Hid);
592 
593 ACPI_STATUS
594 AcpiUtExecute_CID (
595     ACPI_NAMESPACE_NODE     *DeviceNode,
596     ACPI_COMPATIBLE_ID_LIST **ReturnCidList);
597 
598 ACPI_STATUS
599 AcpiUtExecute_STA (
600     ACPI_NAMESPACE_NODE     *DeviceNode,
601     UINT32                  *StatusFlags);
602 
603 ACPI_STATUS
604 AcpiUtExecute_UID (
605     ACPI_NAMESPACE_NODE     *DeviceNode,
606     ACPI_DEVICE_ID          *Uid);
607 
608 ACPI_STATUS
609 AcpiUtExecute_Sxds (
610     ACPI_NAMESPACE_NODE     *DeviceNode,
611     UINT8                   *Highest);
612 
613 
614 /*
615  * utobject - internal object create/delete/cache routines
616  */
617 ACPI_OPERAND_OBJECT  *
618 AcpiUtCreateInternalObjectDbg (
619     char                    *ModuleName,
620     UINT32                  LineNumber,
621     UINT32                  ComponentId,
622     ACPI_OBJECT_TYPE        Type);
623 
624 void *
625 AcpiUtAllocateObjectDescDbg (
626     char                    *ModuleName,
627     UINT32                  LineNumber,
628     UINT32                  ComponentId);
629 
630 #define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
631 #define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
632 
633 void
634 AcpiUtDeleteObjectDesc (
635     ACPI_OPERAND_OBJECT     *Object);
636 
637 BOOLEAN
638 AcpiUtValidInternalObject (
639     void                    *Object);
640 
641 ACPI_OPERAND_OBJECT *
642 AcpiUtCreateBufferObject (
643     ACPI_SIZE               BufferSize);
644 
645 ACPI_OPERAND_OBJECT *
646 AcpiUtCreateStringObject (
647     ACPI_SIZE               StringSize);
648 
649 ACPI_STATUS
650 AcpiUtGetObjectSize(
651     ACPI_OPERAND_OBJECT     *Obj,
652     ACPI_SIZE               *ObjLength);
653 
654 
655 /*
656  * utstate - Generic state creation/cache routines
657  */
658 void
659 AcpiUtPushGenericState (
660     ACPI_GENERIC_STATE      **ListHead,
661     ACPI_GENERIC_STATE      *State);
662 
663 ACPI_GENERIC_STATE *
664 AcpiUtPopGenericState (
665     ACPI_GENERIC_STATE      **ListHead);
666 
667 
668 ACPI_GENERIC_STATE *
669 AcpiUtCreateGenericState (
670     void);
671 
672 ACPI_THREAD_STATE *
673 AcpiUtCreateThreadState (
674     void);
675 
676 ACPI_GENERIC_STATE *
677 AcpiUtCreateUpdateState (
678     ACPI_OPERAND_OBJECT     *Object,
679     UINT16                  Action);
680 
681 ACPI_GENERIC_STATE *
682 AcpiUtCreatePkgState (
683     void                    *InternalObject,
684     void                    *ExternalObject,
685     UINT16                  Index);
686 
687 ACPI_STATUS
688 AcpiUtCreateUpdateStateAndPush (
689     ACPI_OPERAND_OBJECT     *Object,
690     UINT16                  Action,
691     ACPI_GENERIC_STATE      **StateList);
692 
693 ACPI_STATUS
694 AcpiUtCreatePkgStateAndPush (
695     void                    *InternalObject,
696     void                    *ExternalObject,
697     UINT16                  Index,
698     ACPI_GENERIC_STATE      **StateList);
699 
700 ACPI_GENERIC_STATE *
701 AcpiUtCreateControlState (
702     void);
703 
704 void
705 AcpiUtDeleteGenericState (
706     ACPI_GENERIC_STATE      *State);
707 
708 
709 /*
710  * utmath
711  */
712 ACPI_STATUS
713 AcpiUtDivide (
714     ACPI_INTEGER            InDividend,
715     ACPI_INTEGER            InDivisor,
716     ACPI_INTEGER            *OutQuotient,
717     ACPI_INTEGER            *OutRemainder);
718 
719 ACPI_STATUS
720 AcpiUtShortDivide (
721     ACPI_INTEGER            InDividend,
722     UINT32                  Divisor,
723     ACPI_INTEGER            *OutQuotient,
724     UINT32                  *OutRemainder);
725 
726 /*
727  * utmisc
728  */
729 ACPI_STATUS
730 AcpiUtAllocateOwnerId (
731     ACPI_OWNER_ID           *OwnerId);
732 
733 void
734 AcpiUtReleaseOwnerId (
735     ACPI_OWNER_ID           *OwnerId);
736 
737 ACPI_STATUS
738 AcpiUtWalkPackageTree (
739     ACPI_OPERAND_OBJECT     *SourceObject,
740     void                    *TargetObject,
741     ACPI_PKG_CALLBACK       WalkCallback,
742     void                    *Context);
743 
744 void
745 AcpiUtStrupr (
746     char                    *SrcString);
747 
748 void
749 AcpiUtPrintString (
750     char                    *String,
751     UINT8                   MaxLength);
752 
753 BOOLEAN
754 AcpiUtValidAcpiName (
755     UINT32                  Name);
756 
757 BOOLEAN
758 AcpiUtValidAcpiCharacter (
759     char                    Character);
760 
761 ACPI_STATUS
762 AcpiUtStrtoul64 (
763     char                    *String,
764     UINT32                  Base,
765     ACPI_INTEGER            *RetInteger);
766 
767 /* Values for Base above (16=Hex, 10=Decimal) */
768 
769 #define ACPI_ANY_BASE        0
770 
771 ACPI_STATUS
772 AcpiUtValidateResource (
773     void                    *Aml,
774     UINT8                   *ReturnIndex);
775 
776 UINT32
777 AcpiUtGetDescriptorLength (
778     void                    *Aml);
779 
780 UINT16
781 AcpiUtGetResourceLength (
782     void                    *Aml);
783 
784 UINT8
785 AcpiUtGetResourceHeaderLength (
786     void                    *Aml);
787 
788 UINT8
789 AcpiUtGetResourceType (
790     void                    *Aml);
791 
792 ACPI_STATUS
793 AcpiUtGetResourceEndTag (
794     ACPI_OPERAND_OBJECT     *ObjDesc,
795     UINT8                   **EndTag);
796 
797 UINT32
798 AcpiUtDwordByteSwap (
799     UINT32                  Value);
800 
801 void
802 AcpiUtSetIntegerWidth (
803     UINT8                   Revision);
804 
805 #ifdef ACPI_DEBUG_OUTPUT
806 void
807 AcpiUtDisplayInitPathname (
808     UINT8                   Type,
809     ACPI_NAMESPACE_NODE     *ObjHandle,
810     char                    *Path);
811 
812 #endif
813 
814 
815 /*
816  * utmutex - mutex support
817  */
818 ACPI_STATUS
819 AcpiUtMutexInitialize (
820     void);
821 
822 void
823 AcpiUtMutexTerminate (
824     void);
825 
826 ACPI_STATUS
827 AcpiUtAcquireMutex (
828     ACPI_MUTEX_HANDLE       MutexId);
829 
830 ACPI_STATUS
831 AcpiUtReleaseMutex (
832     ACPI_MUTEX_HANDLE       MutexId);
833 
834 
835 /*
836  * utalloc - memory allocation and object caching
837  */
838 ACPI_STATUS
839 AcpiUtCreateCaches (
840     void);
841 
842 ACPI_STATUS
843 AcpiUtDeleteCaches (
844     void);
845 
846 ACPI_STATUS
847 AcpiUtValidateBuffer (
848     ACPI_BUFFER             *Buffer);
849 
850 ACPI_STATUS
851 AcpiUtInitializeBuffer (
852     ACPI_BUFFER             *Buffer,
853     ACPI_SIZE               RequiredLength);
854 
855 void *
856 AcpiUtAllocate (
857     ACPI_SIZE               Size,
858     UINT32                  Component,
859     char                    *Module,
860     UINT32                  Line);
861 
862 void *
863 AcpiUtCallocate (
864     ACPI_SIZE               Size,
865     UINT32                  Component,
866     char                    *Module,
867     UINT32                  Line);
868 
869 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
870 void *
871 AcpiUtAllocateAndTrack (
872     ACPI_SIZE               Size,
873     UINT32                  Component,
874     char                    *Module,
875     UINT32                  Line);
876 
877 void *
878 AcpiUtCallocateAndTrack (
879     ACPI_SIZE               Size,
880     UINT32                  Component,
881     char                    *Module,
882     UINT32                  Line);
883 
884 void
885 AcpiUtFreeAndTrack (
886     void                    *Address,
887     UINT32                  Component,
888     char                    *Module,
889     UINT32                  Line);
890 
891 void
892 AcpiUtDumpAllocationInfo (
893     void);
894 
895 void
896 AcpiUtDumpAllocations (
897     UINT32                  Component,
898     char                    *Module);
899 #endif
900 
901 #endif /* _ACUTILS_H */
902