xref: /titanic_51/usr/src/uts/intel/sys/acpi/acutils.h (revision 45e662eb8429b38c18931ebeed30f2e5287ae51b)
1 /******************************************************************************
2  *
3  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2011, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #ifndef _ACUTILS_H
45 #define _ACUTILS_H
46 
47 
48 extern const UINT8                      AcpiGbl_ResourceAmlSizes[];
49 
50 /* Strings used by the disassembler and debugger resource dump routines */
51 
52 #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
53 
54 extern const char                       *AcpiGbl_BmDecode[];
55 extern const char                       *AcpiGbl_ConfigDecode[];
56 extern const char                       *AcpiGbl_ConsumeDecode[];
57 extern const char                       *AcpiGbl_DecDecode[];
58 extern const char                       *AcpiGbl_HeDecode[];
59 extern const char                       *AcpiGbl_IoDecode[];
60 extern const char                       *AcpiGbl_LlDecode[];
61 extern const char                       *AcpiGbl_MaxDecode[];
62 extern const char                       *AcpiGbl_MemDecode[];
63 extern const char                       *AcpiGbl_MinDecode[];
64 extern const char                       *AcpiGbl_MtpDecode[];
65 extern const char                       *AcpiGbl_RngDecode[];
66 extern const char                       *AcpiGbl_RwDecode[];
67 extern const char                       *AcpiGbl_ShrDecode[];
68 extern const char                       *AcpiGbl_SizDecode[];
69 extern const char                       *AcpiGbl_TrsDecode[];
70 extern const char                       *AcpiGbl_TtpDecode[];
71 extern const char                       *AcpiGbl_TypDecode[];
72 #endif
73 
74 /* Types for Resource descriptor entries */
75 
76 #define ACPI_INVALID_RESOURCE           0
77 #define ACPI_FIXED_LENGTH               1
78 #define ACPI_VARIABLE_LENGTH            2
79 #define ACPI_SMALL_VARIABLE_LENGTH      3
80 
81 typedef
82 ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
83     UINT8                   *Aml,
84     UINT32                  Length,
85     UINT32                  Offset,
86     UINT8                   ResourceIndex,
87     void                    *Context);
88 
89 typedef
90 ACPI_STATUS (*ACPI_PKG_CALLBACK) (
91     UINT8                   ObjectType,
92     ACPI_OPERAND_OBJECT     *SourceObject,
93     ACPI_GENERIC_STATE      *State,
94     void                    *Context);
95 
96 typedef struct acpi_pkg_info
97 {
98     UINT8                   *FreeSpace;
99     ACPI_SIZE               Length;
100     UINT32                  ObjectSpace;
101     UINT32                  NumPackages;
102 
103 } ACPI_PKG_INFO;
104 
105 #define REF_INCREMENT       (UINT16) 0
106 #define REF_DECREMENT       (UINT16) 1
107 #define REF_FORCE_DELETE    (UINT16) 2
108 
109 /* AcpiUtDumpBuffer */
110 
111 #define DB_BYTE_DISPLAY     1
112 #define DB_WORD_DISPLAY     2
113 #define DB_DWORD_DISPLAY    4
114 #define DB_QWORD_DISPLAY    8
115 
116 
117 /*
118  * utglobal - Global data structures and procedures
119  */
120 ACPI_STATUS
121 AcpiUtInitGlobals (
122     void);
123 
124 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
125 
126 char *
127 AcpiUtGetMutexName (
128     UINT32                  MutexId);
129 
130 const char *
131 AcpiUtGetNotifyName (
132     UINT32                  NotifyValue);
133 
134 #endif
135 
136 char *
137 AcpiUtGetTypeName (
138     ACPI_OBJECT_TYPE        Type);
139 
140 char *
141 AcpiUtGetNodeName (
142     void                    *Object);
143 
144 char *
145 AcpiUtGetDescriptorName (
146     void                    *Object);
147 
148 const char *
149 AcpiUtGetReferenceName (
150     ACPI_OPERAND_OBJECT     *Object);
151 
152 char *
153 AcpiUtGetObjectTypeName (
154     ACPI_OPERAND_OBJECT     *ObjDesc);
155 
156 char *
157 AcpiUtGetRegionName (
158     UINT8                   SpaceId);
159 
160 char *
161 AcpiUtGetEventName (
162     UINT32                  EventId);
163 
164 char
165 AcpiUtHexToAsciiChar (
166     UINT64                  Integer,
167     UINT32                  Position);
168 
169 BOOLEAN
170 AcpiUtValidObjectType (
171     ACPI_OBJECT_TYPE        Type);
172 
173 
174 /*
175  * utinit - miscellaneous initialization and shutdown
176  */
177 ACPI_STATUS
178 AcpiUtHardwareInitialize (
179     void);
180 
181 void
182 AcpiUtSubsystemShutdown (
183     void);
184 
185 
186 /*
187  * utclib - Local implementations of C library functions
188  */
189 #ifndef ACPI_USE_SYSTEM_CLIBRARY
190 
191 ACPI_SIZE
192 AcpiUtStrlen (
193     const char              *String);
194 
195 char *
196 AcpiUtStrcpy (
197     char                    *DstString,
198     const char              *SrcString);
199 
200 char *
201 AcpiUtStrncpy (
202     char                    *DstString,
203     const char              *SrcString,
204     ACPI_SIZE               Count);
205 
206 int
207 AcpiUtMemcmp (
208     const char              *Buffer1,
209     const char              *Buffer2,
210     ACPI_SIZE               Count);
211 
212 int
213 AcpiUtStrncmp (
214     const char              *String1,
215     const char              *String2,
216     ACPI_SIZE               Count);
217 
218 int
219 AcpiUtStrcmp (
220     const char              *String1,
221     const char              *String2);
222 
223 char *
224 AcpiUtStrcat (
225     char                    *DstString,
226     const char              *SrcString);
227 
228 char *
229 AcpiUtStrncat (
230     char                    *DstString,
231     const char              *SrcString,
232     ACPI_SIZE               Count);
233 
234 UINT32
235 AcpiUtStrtoul (
236     const char              *String,
237     char                    **Terminator,
238     UINT32                  Base);
239 
240 char *
241 AcpiUtStrstr (
242     char                    *String1,
243     char                    *String2);
244 
245 void *
246 AcpiUtMemcpy (
247     void                    *Dest,
248     const void              *Src,
249     ACPI_SIZE               Count);
250 
251 void *
252 AcpiUtMemset (
253     void                    *Dest,
254     UINT8                   Value,
255     ACPI_SIZE               Count);
256 
257 int
258 AcpiUtToUpper (
259     int                     c);
260 
261 int
262 AcpiUtToLower (
263     int                     c);
264 
265 extern const UINT8 _acpi_ctype[];
266 
267 #define _ACPI_XA     0x00    /* extra alphabetic - not supported */
268 #define _ACPI_XS     0x40    /* extra space */
269 #define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
270 #define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
271 #define _ACPI_DI     0x04    /* '0'-'9' */
272 #define _ACPI_LO     0x02    /* 'a'-'z' */
273 #define _ACPI_PU     0x10    /* punctuation */
274 #define _ACPI_SP     0x08    /* space */
275 #define _ACPI_UP     0x01    /* 'A'-'Z' */
276 #define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
277 
278 #define ACPI_IS_DIGIT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
279 #define ACPI_IS_SPACE(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
280 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
281 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
282 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
283 #define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
284 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
285 
286 #endif /* !ACPI_USE_SYSTEM_CLIBRARY */
287 
288 #define ACPI_IS_ASCII(c)  ((c) < 0x80)
289 
290 
291 /*
292  * utcopy - Object construction and conversion interfaces
293  */
294 ACPI_STATUS
295 AcpiUtBuildSimpleObject(
296     ACPI_OPERAND_OBJECT     *Obj,
297     ACPI_OBJECT             *UserObj,
298     UINT8                   *DataSpace,
299     UINT32                  *BufferSpaceUsed);
300 
301 ACPI_STATUS
302 AcpiUtBuildPackageObject (
303     ACPI_OPERAND_OBJECT     *Obj,
304     UINT8                   *Buffer,
305     UINT32                  *SpaceUsed);
306 
307 ACPI_STATUS
308 AcpiUtCopyIobjectToEobject (
309     ACPI_OPERAND_OBJECT     *Obj,
310     ACPI_BUFFER             *RetBuffer);
311 
312 ACPI_STATUS
313 AcpiUtCopyEobjectToIobject (
314     ACPI_OBJECT             *Obj,
315     ACPI_OPERAND_OBJECT     **InternalObj);
316 
317 ACPI_STATUS
318 AcpiUtCopyISimpleToIsimple (
319     ACPI_OPERAND_OBJECT     *SourceObj,
320     ACPI_OPERAND_OBJECT     *DestObj);
321 
322 ACPI_STATUS
323 AcpiUtCopyIobjectToIobject (
324     ACPI_OPERAND_OBJECT     *SourceDesc,
325     ACPI_OPERAND_OBJECT     **DestDesc,
326     ACPI_WALK_STATE         *WalkState);
327 
328 
329 /*
330  * utcreate - Object creation
331  */
332 ACPI_STATUS
333 AcpiUtUpdateObjectReference (
334     ACPI_OPERAND_OBJECT     *Object,
335     UINT16                  Action);
336 
337 
338 /*
339  * utdebug - Debug interfaces
340  */
341 void
342 AcpiUtInitStackPtrTrace (
343     void);
344 
345 void
346 AcpiUtTrackStackPtr (
347     void);
348 
349 void
350 AcpiUtTrace (
351     UINT32                  LineNumber,
352     const char              *FunctionName,
353     const char              *ModuleName,
354     UINT32                  ComponentId);
355 
356 void
357 AcpiUtTracePtr (
358     UINT32                  LineNumber,
359     const char              *FunctionName,
360     const char              *ModuleName,
361     UINT32                  ComponentId,
362     void                    *Pointer);
363 
364 void
365 AcpiUtTraceU32 (
366     UINT32                  LineNumber,
367     const char              *FunctionName,
368     const char              *ModuleName,
369     UINT32                  ComponentId,
370     UINT32                  Integer);
371 
372 void
373 AcpiUtTraceStr (
374     UINT32                  LineNumber,
375     const char              *FunctionName,
376     const char              *ModuleName,
377     UINT32                  ComponentId,
378     char                    *String);
379 
380 void
381 AcpiUtExit (
382     UINT32                  LineNumber,
383     const char              *FunctionName,
384     const char              *ModuleName,
385     UINT32                  ComponentId);
386 
387 void
388 AcpiUtStatusExit (
389     UINT32                  LineNumber,
390     const char              *FunctionName,
391     const char              *ModuleName,
392     UINT32                  ComponentId,
393     ACPI_STATUS             Status);
394 
395 void
396 AcpiUtValueExit (
397     UINT32                  LineNumber,
398     const char              *FunctionName,
399     const char              *ModuleName,
400     UINT32                  ComponentId,
401     UINT64                  Value);
402 
403 void
404 AcpiUtPtrExit (
405     UINT32                  LineNumber,
406     const char              *FunctionName,
407     const char              *ModuleName,
408     UINT32                  ComponentId,
409     UINT8                   *Ptr);
410 
411 void
412 AcpiUtDumpBuffer (
413     UINT8                   *Buffer,
414     UINT32                  Count,
415     UINT32                  Display,
416     UINT32                  componentId);
417 
418 void
419 AcpiUtDumpBuffer2 (
420     UINT8                   *Buffer,
421     UINT32                  Count,
422     UINT32                  Display);
423 
424 void
425 AcpiUtReportError (
426     char                    *ModuleName,
427     UINT32                  LineNumber);
428 
429 void
430 AcpiUtReportInfo (
431     char                    *ModuleName,
432     UINT32                  LineNumber);
433 
434 void
435 AcpiUtReportWarning (
436     char                    *ModuleName,
437     UINT32                  LineNumber);
438 
439 /*
440  * utdelete - Object deletion and reference counts
441  */
442 void
443 AcpiUtAddReference (
444     ACPI_OPERAND_OBJECT     *Object);
445 
446 void
447 AcpiUtRemoveReference (
448     ACPI_OPERAND_OBJECT     *Object);
449 
450 void
451 AcpiUtDeleteInternalPackageObject (
452     ACPI_OPERAND_OBJECT     *Object);
453 
454 void
455 AcpiUtDeleteInternalSimpleObject (
456     ACPI_OPERAND_OBJECT     *Object);
457 
458 void
459 AcpiUtDeleteInternalObjectList (
460     ACPI_OPERAND_OBJECT     **ObjList);
461 
462 
463 /*
464  * uteval - object evaluation
465  */
466 ACPI_STATUS
467 AcpiUtEvaluateObject (
468     ACPI_NAMESPACE_NODE     *PrefixNode,
469     char                    *Path,
470     UINT32                  ExpectedReturnBtypes,
471     ACPI_OPERAND_OBJECT     **ReturnDesc);
472 
473 ACPI_STATUS
474 AcpiUtEvaluateNumericObject (
475     char                    *ObjectName,
476     ACPI_NAMESPACE_NODE     *DeviceNode,
477     UINT64                  *Value);
478 
479 ACPI_STATUS
480 AcpiUtExecute_STA (
481     ACPI_NAMESPACE_NODE     *DeviceNode,
482     UINT32                  *StatusFlags);
483 
484 ACPI_STATUS
485 AcpiUtExecutePowerMethods (
486     ACPI_NAMESPACE_NODE     *DeviceNode,
487     const char              **MethodNames,
488     UINT8                   MethodCount,
489     UINT8                   *OutValues);
490 
491 
492 /*
493  * utids - device ID support
494  */
495 ACPI_STATUS
496 AcpiUtExecute_HID (
497     ACPI_NAMESPACE_NODE     *DeviceNode,
498     ACPI_DEVICE_ID          **ReturnId);
499 
500 ACPI_STATUS
501 AcpiUtExecute_UID (
502     ACPI_NAMESPACE_NODE     *DeviceNode,
503     ACPI_DEVICE_ID          **ReturnId);
504 
505 ACPI_STATUS
506 AcpiUtExecute_CID (
507     ACPI_NAMESPACE_NODE     *DeviceNode,
508     ACPI_DEVICE_ID_LIST     **ReturnCidList);
509 
510 
511 /*
512  * utlock - reader/writer locks
513  */
514 ACPI_STATUS
515 AcpiUtCreateRwLock (
516     ACPI_RW_LOCK            *Lock);
517 
518 void
519 AcpiUtDeleteRwLock (
520     ACPI_RW_LOCK            *Lock);
521 
522 ACPI_STATUS
523 AcpiUtAcquireReadLock (
524     ACPI_RW_LOCK            *Lock);
525 
526 ACPI_STATUS
527 AcpiUtReleaseReadLock (
528     ACPI_RW_LOCK            *Lock);
529 
530 ACPI_STATUS
531 AcpiUtAcquireWriteLock (
532     ACPI_RW_LOCK            *Lock);
533 
534 void
535 AcpiUtReleaseWriteLock (
536     ACPI_RW_LOCK            *Lock);
537 
538 
539 /*
540  * utobject - internal object create/delete/cache routines
541  */
542 ACPI_OPERAND_OBJECT  *
543 AcpiUtCreateInternalObjectDbg (
544     const char              *ModuleName,
545     UINT32                  LineNumber,
546     UINT32                  ComponentId,
547     ACPI_OBJECT_TYPE        Type);
548 
549 void *
550 AcpiUtAllocateObjectDescDbg (
551     const char              *ModuleName,
552     UINT32                  LineNumber,
553     UINT32                  ComponentId);
554 
555 #define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
556 #define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
557 
558 void
559 AcpiUtDeleteObjectDesc (
560     ACPI_OPERAND_OBJECT     *Object);
561 
562 BOOLEAN
563 AcpiUtValidInternalObject (
564     void                    *Object);
565 
566 ACPI_OPERAND_OBJECT *
567 AcpiUtCreatePackageObject (
568     UINT32                  Count);
569 
570 ACPI_OPERAND_OBJECT *
571 AcpiUtCreateIntegerObject (
572     UINT64                  Value);
573 
574 ACPI_OPERAND_OBJECT *
575 AcpiUtCreateBufferObject (
576     ACPI_SIZE               BufferSize);
577 
578 ACPI_OPERAND_OBJECT *
579 AcpiUtCreateStringObject (
580     ACPI_SIZE               StringSize);
581 
582 ACPI_STATUS
583 AcpiUtGetObjectSize(
584     ACPI_OPERAND_OBJECT     *Obj,
585     ACPI_SIZE               *ObjLength);
586 
587 
588 /*
589  * utosi - Support for the _OSI predefined control method
590  */
591 ACPI_STATUS
592 AcpiUtInitializeInterfaces (
593     void);
594 
595 void
596 AcpiUtInterfaceTerminate (
597     void);
598 
599 ACPI_STATUS
600 AcpiUtInstallInterface (
601     ACPI_STRING             InterfaceName);
602 
603 ACPI_STATUS
604 AcpiUtRemoveInterface (
605     ACPI_STRING             InterfaceName);
606 
607 ACPI_INTERFACE_INFO *
608 AcpiUtGetInterface (
609     ACPI_STRING             InterfaceName);
610 
611 ACPI_STATUS
612 AcpiUtOsiImplementation (
613     ACPI_WALK_STATE         *WalkState);
614 
615 
616 /*
617  * utstate - Generic state creation/cache routines
618  */
619 void
620 AcpiUtPushGenericState (
621     ACPI_GENERIC_STATE      **ListHead,
622     ACPI_GENERIC_STATE      *State);
623 
624 ACPI_GENERIC_STATE *
625 AcpiUtPopGenericState (
626     ACPI_GENERIC_STATE      **ListHead);
627 
628 
629 ACPI_GENERIC_STATE *
630 AcpiUtCreateGenericState (
631     void);
632 
633 ACPI_THREAD_STATE *
634 AcpiUtCreateThreadState (
635     void);
636 
637 ACPI_GENERIC_STATE *
638 AcpiUtCreateUpdateState (
639     ACPI_OPERAND_OBJECT     *Object,
640     UINT16                  Action);
641 
642 ACPI_GENERIC_STATE *
643 AcpiUtCreatePkgState (
644     void                    *InternalObject,
645     void                    *ExternalObject,
646     UINT16                  Index);
647 
648 ACPI_STATUS
649 AcpiUtCreateUpdateStateAndPush (
650     ACPI_OPERAND_OBJECT     *Object,
651     UINT16                  Action,
652     ACPI_GENERIC_STATE      **StateList);
653 
654 ACPI_STATUS
655 AcpiUtCreatePkgStateAndPush (
656     void                    *InternalObject,
657     void                    *ExternalObject,
658     UINT16                  Index,
659     ACPI_GENERIC_STATE      **StateList);
660 
661 ACPI_GENERIC_STATE *
662 AcpiUtCreateControlState (
663     void);
664 
665 void
666 AcpiUtDeleteGenericState (
667     ACPI_GENERIC_STATE      *State);
668 
669 
670 /*
671  * utmath
672  */
673 ACPI_STATUS
674 AcpiUtDivide (
675     UINT64                  InDividend,
676     UINT64                  InDivisor,
677     UINT64                  *OutQuotient,
678     UINT64                  *OutRemainder);
679 
680 ACPI_STATUS
681 AcpiUtShortDivide (
682     UINT64                  InDividend,
683     UINT32                  Divisor,
684     UINT64                  *OutQuotient,
685     UINT32                  *OutRemainder);
686 
687 /*
688  * utmisc
689  */
690 const char *
691 AcpiUtValidateException (
692     ACPI_STATUS             Status);
693 
694 BOOLEAN
695 AcpiUtIsPciRootBridge (
696     char                    *Id);
697 
698 BOOLEAN
699 AcpiUtIsAmlTable (
700     ACPI_TABLE_HEADER       *Table);
701 
702 ACPI_STATUS
703 AcpiUtAllocateOwnerId (
704     ACPI_OWNER_ID           *OwnerId);
705 
706 void
707 AcpiUtReleaseOwnerId (
708     ACPI_OWNER_ID           *OwnerId);
709 
710 ACPI_STATUS
711 AcpiUtWalkPackageTree (
712     ACPI_OPERAND_OBJECT     *SourceObject,
713     void                    *TargetObject,
714     ACPI_PKG_CALLBACK       WalkCallback,
715     void                    *Context);
716 
717 void
718 AcpiUtStrupr (
719     char                    *SrcString);
720 
721 void
722 AcpiUtStrlwr (
723     char                    *SrcString);
724 
725 void
726 AcpiUtPrintString (
727     char                    *String,
728     UINT8                   MaxLength);
729 
730 BOOLEAN
731 AcpiUtValidAcpiName (
732     UINT32                  Name);
733 
734 void
735 AcpiUtRepairName (
736     char                    *Name);
737 
738 BOOLEAN
739 AcpiUtValidAcpiChar (
740     char                    Character,
741     UINT32                  Position);
742 
743 ACPI_STATUS
744 AcpiUtStrtoul64 (
745     char                    *String,
746     UINT32                  Base,
747     UINT64                  *RetInteger);
748 
749 /* Values for Base above (16=Hex, 10=Decimal) */
750 
751 #define ACPI_ANY_BASE        0
752 
753 UINT32
754 AcpiUtDwordByteSwap (
755     UINT32                  Value);
756 
757 void
758 AcpiUtSetIntegerWidth (
759     UINT8                   Revision);
760 
761 #ifdef ACPI_DEBUG_OUTPUT
762 void
763 AcpiUtDisplayInitPathname (
764     UINT8                   Type,
765     ACPI_NAMESPACE_NODE     *ObjHandle,
766     char                    *Path);
767 #endif
768 
769 
770 /*
771  * utresrc
772  */
773 ACPI_STATUS
774 AcpiUtWalkAmlResources (
775     UINT8                   *Aml,
776     ACPI_SIZE               AmlLength,
777     ACPI_WALK_AML_CALLBACK  UserFunction,
778     void                    *Context);
779 
780 ACPI_STATUS
781 AcpiUtValidateResource (
782     void                    *Aml,
783     UINT8                   *ReturnIndex);
784 
785 UINT32
786 AcpiUtGetDescriptorLength (
787     void                    *Aml);
788 
789 UINT16
790 AcpiUtGetResourceLength (
791     void                    *Aml);
792 
793 UINT8
794 AcpiUtGetResourceHeaderLength (
795     void                    *Aml);
796 
797 UINT8
798 AcpiUtGetResourceType (
799     void                    *Aml);
800 
801 ACPI_STATUS
802 AcpiUtGetResourceEndTag (
803     ACPI_OPERAND_OBJECT     *ObjDesc,
804     UINT8                   **EndTag);
805 
806 
807 /*
808  * utmutex - mutex support
809  */
810 ACPI_STATUS
811 AcpiUtMutexInitialize (
812     void);
813 
814 void
815 AcpiUtMutexTerminate (
816     void);
817 
818 ACPI_STATUS
819 AcpiUtAcquireMutex (
820     ACPI_MUTEX_HANDLE       MutexId);
821 
822 ACPI_STATUS
823 AcpiUtReleaseMutex (
824     ACPI_MUTEX_HANDLE       MutexId);
825 
826 
827 /*
828  * utalloc - memory allocation and object caching
829  */
830 ACPI_STATUS
831 AcpiUtCreateCaches (
832     void);
833 
834 ACPI_STATUS
835 AcpiUtDeleteCaches (
836     void);
837 
838 ACPI_STATUS
839 AcpiUtValidateBuffer (
840     ACPI_BUFFER             *Buffer);
841 
842 ACPI_STATUS
843 AcpiUtInitializeBuffer (
844     ACPI_BUFFER             *Buffer,
845     ACPI_SIZE               RequiredLength);
846 
847 void *
848 AcpiUtAllocate (
849     ACPI_SIZE               Size,
850     UINT32                  Component,
851     const char              *Module,
852     UINT32                  Line);
853 
854 void *
855 AcpiUtAllocateZeroed (
856     ACPI_SIZE               Size,
857     UINT32                  Component,
858     const char              *Module,
859     UINT32                  Line);
860 
861 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
862 void *
863 AcpiUtAllocateAndTrack (
864     ACPI_SIZE               Size,
865     UINT32                  Component,
866     const char              *Module,
867     UINT32                  Line);
868 
869 void *
870 AcpiUtAllocateZeroedAndTrack (
871     ACPI_SIZE               Size,
872     UINT32                  Component,
873     const char              *Module,
874     UINT32                  Line);
875 
876 void
877 AcpiUtFreeAndTrack (
878     void                    *Address,
879     UINT32                  Component,
880     const char              *Module,
881     UINT32                  Line);
882 
883 void
884 AcpiUtDumpAllocationInfo (
885     void);
886 
887 void
888 AcpiUtDumpAllocations (
889     UINT32                  Component,
890     const char              *Module);
891 
892 ACPI_STATUS
893 AcpiUtCreateList (
894     char                    *ListName,
895     UINT16                  ObjectSize,
896     ACPI_MEMORY_LIST        **ReturnCache);
897 
898 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
899 
900 
901 /*
902  * utxferror - various error/warning output functions
903  */
904 void ACPI_INTERNAL_VAR_XFACE
905 AcpiUtPredefinedWarning (
906     const char              *ModuleName,
907     UINT32                  LineNumber,
908     char                    *Pathname,
909     UINT8                   NodeFlags,
910     const char              *Format,
911     ...);
912 
913 void ACPI_INTERNAL_VAR_XFACE
914 AcpiUtPredefinedInfo (
915     const char              *ModuleName,
916     UINT32                  LineNumber,
917     char                    *Pathname,
918     UINT8                   NodeFlags,
919     const char              *Format,
920     ...);
921 
922 void
923 AcpiUtNamespaceError (
924     const char              *ModuleName,
925     UINT32                  LineNumber,
926     const char              *InternalName,
927     ACPI_STATUS             LookupStatus);
928 
929 void
930 AcpiUtMethodError (
931     const char              *ModuleName,
932     UINT32                  LineNumber,
933     const char              *Message,
934     ACPI_NAMESPACE_NODE     *Node,
935     const char              *Path,
936     ACPI_STATUS             LookupStatus);
937 
938 #endif /* _ACUTILS_H */
939