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