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