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