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
120extern const UINT8                      AcpiGbl_ResourceAmlSizes[];
121extern 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
127extern const char                       *AcpiGbl_BmDecode[];
128extern const char                       *AcpiGbl_ConfigDecode[];
129extern const char                       *AcpiGbl_ConsumeDecode[];
130extern const char                       *AcpiGbl_DecDecode[];
131extern const char                       *AcpiGbl_HeDecode[];
132extern const char                       *AcpiGbl_IoDecode[];
133extern const char                       *AcpiGbl_LlDecode[];
134extern const char                       *AcpiGbl_MaxDecode[];
135extern const char                       *AcpiGbl_MemDecode[];
136extern const char                       *AcpiGbl_MinDecode[];
137extern const char                       *AcpiGbl_MtpDecode[];
138extern const char                       *AcpiGbl_RngDecode[];
139extern const char                       *AcpiGbl_RwDecode[];
140extern const char                       *AcpiGbl_ShrDecode[];
141extern const char                       *AcpiGbl_SizDecode[];
142extern const char                       *AcpiGbl_TrsDecode[];
143extern const char                       *AcpiGbl_TtpDecode[];
144extern const char                       *AcpiGbl_TypDecode[];
145extern const char                       *AcpiGbl_PpcDecode[];
146extern const char                       *AcpiGbl_IorDecode[];
147extern const char                       *AcpiGbl_DtsDecode[];
148extern const char                       *AcpiGbl_CtDecode[];
149extern const char                       *AcpiGbl_SbtDecode[];
150extern const char                       *AcpiGbl_AmDecode[];
151extern const char                       *AcpiGbl_SmDecode[];
152extern const char                       *AcpiGbl_WmDecode[];
153extern const char                       *AcpiGbl_CphDecode[];
154extern const char                       *AcpiGbl_CpoDecode[];
155extern const char                       *AcpiGbl_DpDecode[];
156extern const char                       *AcpiGbl_EdDecode[];
157extern const char                       *AcpiGbl_BpbDecode[];
158extern const char                       *AcpiGbl_SbDecode[];
159extern const char                       *AcpiGbl_FcDecode[];
160extern 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
170typedef
171ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
172    UINT8                   *Aml,
173    UINT32                  Length,
174    UINT32                  Offset,
175    UINT8                   ResourceIndex,
176    void                    *Context);
177
178typedef
179ACPI_STATUS (*ACPI_PKG_CALLBACK) (
180    UINT8                   ObjectType,
181    ACPI_OPERAND_OBJECT     *SourceObject,
182    ACPI_GENERIC_STATE      *State,
183    void                    *Context);
184
185typedef 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 */
208ACPI_STATUS
209AcpiUtInitGlobals (
210    void);
211
212#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
213
214char *
215AcpiUtGetMutexName (
216    UINT32                  MutexId);
217
218const char *
219AcpiUtGetNotifyName (
220    UINT32                  NotifyValue);
221
222#endif
223
224char *
225AcpiUtGetTypeName (
226    ACPI_OBJECT_TYPE        Type);
227
228char *
229AcpiUtGetNodeName (
230    void                    *Object);
231
232char *
233AcpiUtGetDescriptorName (
234    void                    *Object);
235
236const char *
237AcpiUtGetReferenceName (
238    ACPI_OPERAND_OBJECT     *Object);
239
240char *
241AcpiUtGetObjectTypeName (
242    ACPI_OPERAND_OBJECT     *ObjDesc);
243
244char *
245AcpiUtGetRegionName (
246    UINT8                   SpaceId);
247
248char *
249AcpiUtGetEventName (
250    UINT32                  EventId);
251
252char
253AcpiUtHexToAsciiChar (
254    UINT64                  Integer,
255    UINT32                  Position);
256
257BOOLEAN
258AcpiUtValidObjectType (
259    ACPI_OBJECT_TYPE        Type);
260
261
262/*
263 * utinit - miscellaneous initialization and shutdown
264 */
265ACPI_STATUS
266AcpiUtHardwareInitialize (
267    void);
268
269void
270AcpiUtSubsystemShutdown (
271    void);
272
273
274/*
275 * utclib - Local implementations of C library functions
276 */
277#ifndef ACPI_USE_SYSTEM_CLIBRARY
278
279ACPI_SIZE
280AcpiUtStrlen (
281    const char              *String);
282
283char *
284AcpiUtStrcpy (
285    char                    *DstString,
286    const char              *SrcString);
287
288char *
289AcpiUtStrncpy (
290    char                    *DstString,
291    const char              *SrcString,
292    ACPI_SIZE               Count);
293
294int
295AcpiUtMemcmp (
296    const char              *Buffer1,
297    const char              *Buffer2,
298    ACPI_SIZE               Count);
299
300int
301AcpiUtStrncmp (
302    const char              *String1,
303    const char              *String2,
304    ACPI_SIZE               Count);
305
306int
307AcpiUtStrcmp (
308    const char              *String1,
309    const char              *String2);
310
311char *
312AcpiUtStrcat (
313    char                    *DstString,
314    const char              *SrcString);
315
316char *
317AcpiUtStrncat (
318    char                    *DstString,
319    const char              *SrcString,
320    ACPI_SIZE               Count);
321
322UINT32
323AcpiUtStrtoul (
324    const char              *String,
325    char                    **Terminator,
326    UINT32                  Base);
327
328char *
329AcpiUtStrstr (
330    char                    *String1,
331    char                    *String2);
332
333void *
334AcpiUtMemcpy (
335    void                    *Dest,
336    const void              *Src,
337    ACPI_SIZE               Count);
338
339void *
340AcpiUtMemset (
341    void                    *Dest,
342    UINT8                   Value,
343    ACPI_SIZE               Count);
344
345int
346AcpiUtToUpper (
347    int                     c);
348
349int
350AcpiUtToLower (
351    int                     c);
352
353extern 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 */
382ACPI_STATUS
383AcpiUtBuildSimpleObject(
384    ACPI_OPERAND_OBJECT     *Obj,
385    ACPI_OBJECT             *UserObj,
386    UINT8                   *DataSpace,
387    UINT32                  *BufferSpaceUsed);
388
389ACPI_STATUS
390AcpiUtBuildPackageObject (
391    ACPI_OPERAND_OBJECT     *Obj,
392    UINT8                   *Buffer,
393    UINT32                  *SpaceUsed);
394
395ACPI_STATUS
396AcpiUtCopyIobjectToEobject (
397    ACPI_OPERAND_OBJECT     *Obj,
398    ACPI_BUFFER             *RetBuffer);
399
400ACPI_STATUS
401AcpiUtCopyEobjectToIobject (
402    ACPI_OBJECT             *Obj,
403    ACPI_OPERAND_OBJECT     **InternalObj);
404
405ACPI_STATUS
406AcpiUtCopyISimpleToIsimple (
407    ACPI_OPERAND_OBJECT     *SourceObj,
408    ACPI_OPERAND_OBJECT     *DestObj);
409
410ACPI_STATUS
411AcpiUtCopyIobjectToIobject (
412    ACPI_OPERAND_OBJECT     *SourceDesc,
413    ACPI_OPERAND_OBJECT     **DestDesc,
414    ACPI_WALK_STATE         *WalkState);
415
416
417/*
418 * utcreate - Object creation
419 */
420ACPI_STATUS
421AcpiUtUpdateObjectReference (
422    ACPI_OPERAND_OBJECT     *Object,
423    UINT16                  Action);
424
425
426/*
427 * utdebug - Debug interfaces
428 */
429void
430AcpiUtInitStackPtrTrace (
431    void);
432
433void
434AcpiUtTrackStackPtr (
435    void);
436
437void
438AcpiUtTrace (
439    UINT32                  LineNumber,
440    const char              *FunctionName,
441    const char              *ModuleName,
442    UINT32                  ComponentId);
443
444void
445AcpiUtTracePtr (
446    UINT32                  LineNumber,
447    const char              *FunctionName,
448    const char              *ModuleName,
449    UINT32                  ComponentId,
450    void                    *Pointer);
451
452void
453AcpiUtTraceU32 (
454    UINT32                  LineNumber,
455    const char              *FunctionName,
456    const char              *ModuleName,
457    UINT32                  ComponentId,
458    UINT32                  Integer);
459
460void
461AcpiUtTraceStr (
462    UINT32                  LineNumber,
463    const char              *FunctionName,
464    const char              *ModuleName,
465    UINT32                  ComponentId,
466    char                    *String);
467
468void
469AcpiUtExit (
470    UINT32                  LineNumber,
471    const char              *FunctionName,
472    const char              *ModuleName,
473    UINT32                  ComponentId);
474
475void
476AcpiUtStatusExit (
477    UINT32                  LineNumber,
478    const char              *FunctionName,
479    const char              *ModuleName,
480    UINT32                  ComponentId,
481    ACPI_STATUS             Status);
482
483void
484AcpiUtValueExit (
485    UINT32                  LineNumber,
486    const char              *FunctionName,
487    const char              *ModuleName,
488    UINT32                  ComponentId,
489    UINT64                  Value);
490
491void
492AcpiUtPtrExit (
493    UINT32                  LineNumber,
494    const char              *FunctionName,
495    const char              *ModuleName,
496    UINT32                  ComponentId,
497    UINT8                   *Ptr);
498
499void
500AcpiUtDebugDumpBuffer (
501    UINT8                   *Buffer,
502    UINT32                  Count,
503    UINT32                  Display,
504    UINT32                  ComponentId);
505
506void
507AcpiUtDumpBuffer (
508    UINT8                   *Buffer,
509    UINT32                  Count,
510    UINT32                  Display,
511    UINT32                  Offset);
512
513void
514AcpiUtReportError (
515    char                    *ModuleName,
516    UINT32                  LineNumber);
517
518void
519AcpiUtReportInfo (
520    char                    *ModuleName,
521    UINT32                  LineNumber);
522
523void
524AcpiUtReportWarning (
525    char                    *ModuleName,
526    UINT32                  LineNumber);
527
528/*
529 * utdelete - Object deletion and reference counts
530 */
531void
532AcpiUtAddReference (
533    ACPI_OPERAND_OBJECT     *Object);
534
535void
536AcpiUtRemoveReference (
537    ACPI_OPERAND_OBJECT     *Object);
538
539void
540AcpiUtDeleteInternalPackageObject (
541    ACPI_OPERAND_OBJECT     *Object);
542
543void
544AcpiUtDeleteInternalSimpleObject (
545    ACPI_OPERAND_OBJECT     *Object);
546
547void
548AcpiUtDeleteInternalObjectList (
549    ACPI_OPERAND_OBJECT     **ObjList);
550
551
552/*
553 * uteval - object evaluation
554 */
555ACPI_STATUS
556AcpiUtEvaluateObject (
557    ACPI_NAMESPACE_NODE     *PrefixNode,
558    char                    *Path,
559    UINT32                  ExpectedReturnBtypes,
560    ACPI_OPERAND_OBJECT     **ReturnDesc);
561
562ACPI_STATUS
563AcpiUtEvaluateNumericObject (
564    char                    *ObjectName,
565    ACPI_NAMESPACE_NODE     *DeviceNode,
566    UINT64                  *Value);
567
568ACPI_STATUS
569AcpiUtExecute_STA (
570    ACPI_NAMESPACE_NODE     *DeviceNode,
571    UINT32                  *StatusFlags);
572
573ACPI_STATUS
574AcpiUtExecutePowerMethods (
575    ACPI_NAMESPACE_NODE     *DeviceNode,
576    const char              **MethodNames,
577    UINT8                   MethodCount,
578    UINT8                   *OutValues);
579
580
581/*
582 * utids - device ID support
583 */
584ACPI_STATUS
585AcpiUtExecute_HID (
586    ACPI_NAMESPACE_NODE     *DeviceNode,
587    ACPI_PNP_DEVICE_ID      **ReturnId);
588
589ACPI_STATUS
590AcpiUtExecute_UID (
591    ACPI_NAMESPACE_NODE     *DeviceNode,
592    ACPI_PNP_DEVICE_ID      **ReturnId);
593
594ACPI_STATUS
595AcpiUtExecute_SUB (
596    ACPI_NAMESPACE_NODE     *DeviceNode,
597    ACPI_PNP_DEVICE_ID      **ReturnId);
598
599ACPI_STATUS
600AcpiUtExecute_CID (
601    ACPI_NAMESPACE_NODE     *DeviceNode,
602    ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
603
604
605/*
606 * utlock - reader/writer locks
607 */
608ACPI_STATUS
609AcpiUtCreateRwLock (
610    ACPI_RW_LOCK            *Lock);
611
612void
613AcpiUtDeleteRwLock (
614    ACPI_RW_LOCK            *Lock);
615
616ACPI_STATUS
617AcpiUtAcquireReadLock (
618    ACPI_RW_LOCK            *Lock);
619
620ACPI_STATUS
621AcpiUtReleaseReadLock (
622    ACPI_RW_LOCK            *Lock);
623
624ACPI_STATUS
625AcpiUtAcquireWriteLock (
626    ACPI_RW_LOCK            *Lock);
627
628void
629AcpiUtReleaseWriteLock (
630    ACPI_RW_LOCK            *Lock);
631
632
633/*
634 * utobject - internal object create/delete/cache routines
635 */
636ACPI_OPERAND_OBJECT  *
637AcpiUtCreateInternalObjectDbg (
638    const char              *ModuleName,
639    UINT32                  LineNumber,
640    UINT32                  ComponentId,
641    ACPI_OBJECT_TYPE        Type);
642
643void *
644AcpiUtAllocateObjectDescDbg (
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
652void
653AcpiUtDeleteObjectDesc (
654    ACPI_OPERAND_OBJECT     *Object);
655
656BOOLEAN
657AcpiUtValidInternalObject (
658    void                    *Object);
659
660ACPI_OPERAND_OBJECT *
661AcpiUtCreatePackageObject (
662    UINT32                  Count);
663
664ACPI_OPERAND_OBJECT *
665AcpiUtCreateIntegerObject (
666    UINT64                  Value);
667
668ACPI_OPERAND_OBJECT *
669AcpiUtCreateBufferObject (
670    ACPI_SIZE               BufferSize);
671
672ACPI_OPERAND_OBJECT *
673AcpiUtCreateStringObject (
674    ACPI_SIZE               StringSize);
675
676ACPI_STATUS
677AcpiUtGetObjectSize(
678    ACPI_OPERAND_OBJECT     *Obj,
679    ACPI_SIZE               *ObjLength);
680
681
682/*
683 * utosi - Support for the _OSI predefined control method
684 */
685ACPI_STATUS
686AcpiUtInitializeInterfaces (
687    void);
688
689void
690AcpiUtInterfaceTerminate (
691    void);
692
693ACPI_STATUS
694AcpiUtInstallInterface (
695    ACPI_STRING             InterfaceName);
696
697ACPI_STATUS
698AcpiUtRemoveInterface (
699    ACPI_STRING             InterfaceName);
700
701ACPI_INTERFACE_INFO *
702AcpiUtGetInterface (
703    ACPI_STRING             InterfaceName);
704
705ACPI_STATUS
706AcpiUtOsiImplementation (
707    ACPI_WALK_STATE         *WalkState);
708
709
710/*
711 * utstate - Generic state creation/cache routines
712 */
713void
714AcpiUtPushGenericState (
715    ACPI_GENERIC_STATE      **ListHead,
716    ACPI_GENERIC_STATE      *State);
717
718ACPI_GENERIC_STATE *
719AcpiUtPopGenericState (
720    ACPI_GENERIC_STATE      **ListHead);
721
722
723ACPI_GENERIC_STATE *
724AcpiUtCreateGenericState (
725    void);
726
727ACPI_THREAD_STATE *
728AcpiUtCreateThreadState (
729    void);
730
731ACPI_GENERIC_STATE *
732AcpiUtCreateUpdateState (
733    ACPI_OPERAND_OBJECT     *Object,
734    UINT16                  Action);
735
736ACPI_GENERIC_STATE *
737AcpiUtCreatePkgState (
738    void                    *InternalObject,
739    void                    *ExternalObject,
740    UINT16                  Index);
741
742ACPI_STATUS
743AcpiUtCreateUpdateStateAndPush (
744    ACPI_OPERAND_OBJECT     *Object,
745    UINT16                  Action,
746    ACPI_GENERIC_STATE      **StateList);
747
748ACPI_STATUS
749AcpiUtCreatePkgStateAndPush (
750    void                    *InternalObject,
751    void                    *ExternalObject,
752    UINT16                  Index,
753    ACPI_GENERIC_STATE      **StateList);
754
755ACPI_GENERIC_STATE *
756AcpiUtCreateControlState (
757    void);
758
759void
760AcpiUtDeleteGenericState (
761    ACPI_GENERIC_STATE      *State);
762
763
764/*
765 * utmath
766 */
767ACPI_STATUS
768AcpiUtDivide (
769    UINT64                  InDividend,
770    UINT64                  InDivisor,
771    UINT64                  *OutQuotient,
772    UINT64                  *OutRemainder);
773
774ACPI_STATUS
775AcpiUtShortDivide (
776    UINT64                  InDividend,
777    UINT32                  Divisor,
778    UINT64                  *OutQuotient,
779    UINT32                  *OutRemainder);
780
781/*
782 * utmisc
783 */
784void
785UtConvertBackslashes (
786    char                    *Pathname);
787
788const char *
789AcpiUtValidateException (
790    ACPI_STATUS             Status);
791
792BOOLEAN
793AcpiUtIsPciRootBridge (
794    char                    *Id);
795
796BOOLEAN
797AcpiUtIsAmlTable (
798    ACPI_TABLE_HEADER       *Table);
799
800ACPI_STATUS
801AcpiUtAllocateOwnerId (
802    ACPI_OWNER_ID           *OwnerId);
803
804void
805AcpiUtReleaseOwnerId (
806    ACPI_OWNER_ID           *OwnerId);
807
808ACPI_STATUS
809AcpiUtWalkPackageTree (
810    ACPI_OPERAND_OBJECT     *SourceObject,
811    void                    *TargetObject,
812    ACPI_PKG_CALLBACK       WalkCallback,
813    void                    *Context);
814
815void
816AcpiUtStrupr (
817    char                    *SrcString);
818
819void
820AcpiUtStrlwr (
821    char                    *SrcString);
822
823int
824AcpiUtStricmp (
825    char                    *String1,
826    char                    *String2);
827
828void
829AcpiUtPrintString (
830    char                    *String,
831    UINT8                   MaxLength);
832
833BOOLEAN
834AcpiUtValidAcpiName (
835    UINT32                  Name);
836
837void
838AcpiUtRepairName (
839    char                    *Name);
840
841BOOLEAN
842AcpiUtValidAcpiChar (
843    char                    Character,
844    UINT32                  Position);
845
846ACPI_STATUS
847AcpiUtStrtoul64 (
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
856UINT32
857AcpiUtDwordByteSwap (
858    UINT32                  Value);
859
860void
861AcpiUtSetIntegerWidth (
862    UINT8                   Revision);
863
864#ifdef ACPI_DEBUG_OUTPUT
865void
866AcpiUtDisplayInitPathname (
867    UINT8                   Type,
868    ACPI_NAMESPACE_NODE     *ObjHandle,
869    char                    *Path);
870#endif
871
872
873/*
874 * utresrc
875 */
876ACPI_STATUS
877AcpiUtWalkAmlResources (
878    UINT8                   *Aml,
879    ACPI_SIZE               AmlLength,
880    ACPI_WALK_AML_CALLBACK  UserFunction,
881    void                    *Context);
882
883ACPI_STATUS
884AcpiUtValidateResource (
885    void                    *Aml,
886    UINT8                   *ReturnIndex);
887
888UINT32
889AcpiUtGetDescriptorLength (
890    void                    *Aml);
891
892UINT16
893AcpiUtGetResourceLength (
894    void                    *Aml);
895
896UINT8
897AcpiUtGetResourceHeaderLength (
898    void                    *Aml);
899
900UINT8
901AcpiUtGetResourceType (
902    void                    *Aml);
903
904ACPI_STATUS
905AcpiUtGetResourceEndTag (
906    ACPI_OPERAND_OBJECT     *ObjDesc,
907    UINT8                   **EndTag);
908
909
910/*
911 * utmutex - mutex support
912 */
913ACPI_STATUS
914AcpiUtMutexInitialize (
915    void);
916
917void
918AcpiUtMutexTerminate (
919    void);
920
921ACPI_STATUS
922AcpiUtAcquireMutex (
923    ACPI_MUTEX_HANDLE       MutexId);
924
925ACPI_STATUS
926AcpiUtReleaseMutex (
927    ACPI_MUTEX_HANDLE       MutexId);
928
929
930/*
931 * utalloc - memory allocation and object caching
932 */
933ACPI_STATUS
934AcpiUtCreateCaches (
935    void);
936
937ACPI_STATUS
938AcpiUtDeleteCaches (
939    void);
940
941ACPI_STATUS
942AcpiUtValidateBuffer (
943    ACPI_BUFFER             *Buffer);
944
945ACPI_STATUS
946AcpiUtInitializeBuffer (
947    ACPI_BUFFER             *Buffer,
948    ACPI_SIZE               RequiredLength);
949
950void *
951AcpiUtAllocate (
952    ACPI_SIZE               Size,
953    UINT32                  Component,
954    const char              *Module,
955    UINT32                  Line);
956
957void *
958AcpiUtAllocateZeroed (
959    ACPI_SIZE               Size,
960    UINT32                  Component,
961    const char              *Module,
962    UINT32                  Line);
963
964#ifdef ACPI_DBG_TRACK_ALLOCATIONS
965void *
966AcpiUtAllocateAndTrack (
967    ACPI_SIZE               Size,
968    UINT32                  Component,
969    const char              *Module,
970    UINT32                  Line);
971
972void *
973AcpiUtAllocateZeroedAndTrack (
974    ACPI_SIZE               Size,
975    UINT32                  Component,
976    const char              *Module,
977    UINT32                  Line);
978
979void
980AcpiUtFreeAndTrack (
981    void                    *Address,
982    UINT32                  Component,
983    const char              *Module,
984    UINT32                  Line);
985
986void
987AcpiUtDumpAllocationInfo (
988    void);
989
990void
991AcpiUtDumpAllocations (
992    UINT32                  Component,
993    const char              *Module);
994
995ACPI_STATUS
996AcpiUtCreateList (
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 */
1006ACPI_STATUS
1007AcpiUtAddAddressRange (
1008    ACPI_ADR_SPACE_TYPE     SpaceId,
1009    ACPI_PHYSICAL_ADDRESS   Address,
1010    UINT32                  Length,
1011    ACPI_NAMESPACE_NODE     *RegionNode);
1012
1013void
1014AcpiUtRemoveAddressRange (
1015    ACPI_ADR_SPACE_TYPE     SpaceId,
1016    ACPI_NAMESPACE_NODE     *RegionNode);
1017
1018UINT32
1019AcpiUtCheckAddressRange (
1020    ACPI_ADR_SPACE_TYPE     SpaceId,
1021    ACPI_PHYSICAL_ADDRESS   Address,
1022    UINT32                  Length,
1023    BOOLEAN                 Warn);
1024
1025void
1026AcpiUtDeleteAddressLists (
1027    void);
1028
1029/*
1030 * utxferror - various error/warning output functions
1031 */
1032void ACPI_INTERNAL_VAR_XFACE
1033AcpiUtPredefinedWarning (
1034    const char              *ModuleName,
1035    UINT32                  LineNumber,
1036    char                    *Pathname,
1037    UINT8                   NodeFlags,
1038    const char              *Format,
1039    ...);
1040
1041void ACPI_INTERNAL_VAR_XFACE
1042AcpiUtPredefinedInfo (
1043    const char              *ModuleName,
1044    UINT32                  LineNumber,
1045    char                    *Pathname,
1046    UINT8                   NodeFlags,
1047    const char              *Format,
1048    ...);
1049
1050void
1051AcpiUtNamespaceError (
1052    const char              *ModuleName,
1053    UINT32                  LineNumber,
1054    const char              *InternalName,
1055    ACPI_STATUS             LookupStatus);
1056
1057void
1058AcpiUtMethodError (
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