acutils.h revision 202771
167754Smsmith/****************************************************************************** 267754Smsmith * 377424Smsmith * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 467754Smsmith * 567754Smsmith *****************************************************************************/ 667754Smsmith 767754Smsmith/****************************************************************************** 867754Smsmith * 967754Smsmith * 1. Copyright Notice 1067754Smsmith * 11202771Sjkim * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. 1270243Smsmith * All rights reserved. 1367754Smsmith * 1467754Smsmith * 2. License 1567754Smsmith * 1667754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property 1767754Smsmith * rights. You may have additional license terms from the party that provided 1867754Smsmith * you this software, covering your right to use that party's intellectual 1967754Smsmith * property rights. 2067754Smsmith * 2167754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2267754Smsmith * copy of the source code appearing in this file ("Covered Code") an 2367754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2467754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy, 2567754Smsmith * make derivatives, distribute, use and display any portion of the Covered 2667754Smsmith * Code in any form, with the right to sublicense such rights; and 2767754Smsmith * 2867754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 2967754Smsmith * license (with the right to sublicense), under only those claims of Intel 3067754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell, 3167754Smsmith * offer to sell, and import the Covered Code and derivative works thereof 3267754Smsmith * solely to the minimum extent necessary to exercise the above copyright 3367754Smsmith * license, and in no event shall the patent license extend to any additions 3467754Smsmith * to or modifications of the Original Intel Code. No other license or right 3567754Smsmith * is granted directly or by implication, estoppel or otherwise; 3667754Smsmith * 3767754Smsmith * The above copyright and patent license is granted only if the following 3867754Smsmith * conditions are met: 3967754Smsmith * 4067754Smsmith * 3. Conditions 4167754Smsmith * 4267754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4367754Smsmith * Redistribution of source code of any substantial portion of the Covered 4467754Smsmith * Code or modification with rights to further distribute source must include 4567754Smsmith * the above Copyright Notice, the above License, this list of Conditions, 4667754Smsmith * and the following Disclaimer and Export Compliance provision. In addition, 4767754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to 4867754Smsmith * contain a file documenting the changes Licensee made to create that Covered 4967754Smsmith * Code and the date of any change. Licensee must include in that file the 5067754Smsmith * documentation of any changes made by any predecessor Licensee. Licensee 5167754Smsmith * must include a prominent statement that the modification is derived, 5267754Smsmith * directly or indirectly, from Original Intel Code. 5367754Smsmith * 5467754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5567754Smsmith * Redistribution of source code of any substantial portion of the Covered 5667754Smsmith * Code or modification without rights to further distribute source must 5767754Smsmith * include the following Disclaimer and Export Compliance provision in the 5867754Smsmith * documentation and/or other materials provided with distribution. In 5967754Smsmith * addition, Licensee may not authorize further sublicense of source of any 6067754Smsmith * portion of the Covered Code, and must include terms to the effect that the 6167754Smsmith * license from Licensee to its licensee is limited to the intellectual 6267754Smsmith * property embodied in the software Licensee provides to its licensee, and 6367754Smsmith * not to intellectual property embodied in modifications its licensee may 6467754Smsmith * make. 6567754Smsmith * 6667754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any 6767754Smsmith * substantial portion of the Covered Code or modification must reproduce the 6867754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance 6967754Smsmith * provision in the documentation and/or other materials provided with the 7067754Smsmith * distribution. 7167754Smsmith * 7267754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original 7367754Smsmith * Intel Code. 7467754Smsmith * 7567754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7667754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or 7767754Smsmith * other dealings in products derived from or relating to the Covered Code 7867754Smsmith * without prior written authorization from Intel. 7967754Smsmith * 8067754Smsmith * 4. Disclaimer and Export Compliance 8167754Smsmith * 8267754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8367754Smsmith * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8467754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8567754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8667754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8767754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8867754Smsmith * PARTICULAR PURPOSE. 8967754Smsmith * 9067754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9167754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9267754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9367754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9467754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9567754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9667754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9767754Smsmith * LIMITED REMEDY. 9867754Smsmith * 9967754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this 10067754Smsmith * software or system incorporating such software without first obtaining any 10167754Smsmith * required license or other approval from the U. S. Department of Commerce or 10267754Smsmith * any other agency or department of the United States Government. In the 10367754Smsmith * event Licensee exports any such software from the United States or 10467754Smsmith * re-exports any such software from a foreign destination, Licensee shall 10567754Smsmith * ensure that the distribution and export/re-export of the software is in 10667754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the 10767754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10867754Smsmith * any of its subsidiaries will export/re-export any technical data, process, 10967754Smsmith * software, or service, directly or indirectly, to any country for which the 11067754Smsmith * United States government or any agency thereof requires an export license, 11167754Smsmith * other governmental approval, or letter of assurance, without first obtaining 11267754Smsmith * such license, approval or letter. 11367754Smsmith * 11467754Smsmith *****************************************************************************/ 11567754Smsmith 11677424Smsmith#ifndef _ACUTILS_H 11777424Smsmith#define _ACUTILS_H 11867754Smsmith 11967754Smsmith 120167802Sjkimextern const UINT8 AcpiGbl_ResourceAmlSizes[]; 121167802Sjkim 122167802Sjkim/* Strings used by the disassembler and debugger resource dump routines */ 123167802Sjkim 124167802Sjkim#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 125167802Sjkim 126167802Sjkimextern const char *AcpiGbl_BmDecode[]; 127167802Sjkimextern const char *AcpiGbl_ConfigDecode[]; 128167802Sjkimextern const char *AcpiGbl_ConsumeDecode[]; 129167802Sjkimextern const char *AcpiGbl_DecDecode[]; 130167802Sjkimextern const char *AcpiGbl_HeDecode[]; 131167802Sjkimextern const char *AcpiGbl_IoDecode[]; 132167802Sjkimextern const char *AcpiGbl_LlDecode[]; 133167802Sjkimextern const char *AcpiGbl_MaxDecode[]; 134167802Sjkimextern const char *AcpiGbl_MemDecode[]; 135167802Sjkimextern const char *AcpiGbl_MinDecode[]; 136167802Sjkimextern const char *AcpiGbl_MtpDecode[]; 137167802Sjkimextern const char *AcpiGbl_RngDecode[]; 138167802Sjkimextern const char *AcpiGbl_RwDecode[]; 139167802Sjkimextern const char *AcpiGbl_ShrDecode[]; 140167802Sjkimextern const char *AcpiGbl_SizDecode[]; 141167802Sjkimextern const char *AcpiGbl_TrsDecode[]; 142167802Sjkimextern const char *AcpiGbl_TtpDecode[]; 143167802Sjkimextern const char *AcpiGbl_TypDecode[]; 144167802Sjkim#endif 145167802Sjkim 146167802Sjkim/* Types for Resource descriptor entries */ 147167802Sjkim 148167802Sjkim#define ACPI_INVALID_RESOURCE 0 149167802Sjkim#define ACPI_FIXED_LENGTH 1 150167802Sjkim#define ACPI_VARIABLE_LENGTH 2 151167802Sjkim#define ACPI_SMALL_VARIABLE_LENGTH 3 152167802Sjkim 15373561Smsmithtypedef 154167802SjkimACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( 155167802Sjkim UINT8 *Aml, 156167802Sjkim UINT32 Length, 157167802Sjkim UINT32 Offset, 158167802Sjkim UINT8 ResourceIndex, 159167802Sjkim void *Context); 160167802Sjkim 161167802Sjkimtypedef 16273561SmsmithACPI_STATUS (*ACPI_PKG_CALLBACK) ( 16373561Smsmith UINT8 ObjectType, 16473561Smsmith ACPI_OPERAND_OBJECT *SourceObject, 16573561Smsmith ACPI_GENERIC_STATE *State, 16673561Smsmith void *Context); 16773561Smsmith 16873561Smsmithtypedef struct acpi_pkg_info 16973561Smsmith{ 17073561Smsmith UINT8 *FreeSpace; 17191116Smsmith ACPI_SIZE Length; 17273561Smsmith UINT32 ObjectSpace; 17373561Smsmith UINT32 NumPackages; 174114237Snjl 17573561Smsmith} ACPI_PKG_INFO; 17673561Smsmith 17767754Smsmith#define REF_INCREMENT (UINT16) 0 17867754Smsmith#define REF_DECREMENT (UINT16) 1 17967754Smsmith#define REF_FORCE_DELETE (UINT16) 2 18067754Smsmith 18177424Smsmith/* AcpiUtDumpBuffer */ 18267754Smsmith 18367754Smsmith#define DB_BYTE_DISPLAY 1 18467754Smsmith#define DB_WORD_DISPLAY 2 18567754Smsmith#define DB_DWORD_DISPLAY 4 18667754Smsmith#define DB_QWORD_DISPLAY 8 18767754Smsmith 18867754Smsmith 18967754Smsmith/* 190151937Sjkim * utglobal - Global data structures and procedures 19167754Smsmith */ 192193267SjkimACPI_STATUS 193151937SjkimAcpiUtInitGlobals ( 19467754Smsmith void); 19567754Smsmith 196102550Siwasaki#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 19769746Smsmith 198114237Snjlchar * 19977424SmsmithAcpiUtGetMutexName ( 20067754Smsmith UINT32 MutexId); 20167754Smsmith 202193267Sjkimconst char * 203193267SjkimAcpiUtGetNotifyName ( 204193267Sjkim UINT32 NotifyValue); 205193267Sjkim 206100966Siwasaki#endif 207100966Siwasaki 208114237Snjlchar * 20977424SmsmithAcpiUtGetTypeName ( 21091116Smsmith ACPI_OBJECT_TYPE Type); 21167754Smsmith 212114237Snjlchar * 213123315SnjlAcpiUtGetNodeName ( 214123315Snjl void *Object); 215123315Snjl 216123315Snjlchar * 217123315SnjlAcpiUtGetDescriptorName ( 218123315Snjl void *Object); 219123315Snjl 220193267Sjkimconst char * 221193267SjkimAcpiUtGetReferenceName ( 222193267Sjkim ACPI_OPERAND_OBJECT *Object); 223193267Sjkim 224123315Snjlchar * 22599679SiwasakiAcpiUtGetObjectTypeName ( 22699679Siwasaki ACPI_OPERAND_OBJECT *ObjDesc); 22799679Siwasaki 228114237Snjlchar * 22977424SmsmithAcpiUtGetRegionName ( 23069746Smsmith UINT8 SpaceId); 23169746Smsmith 232114237Snjlchar * 23391116SmsmithAcpiUtGetEventName ( 23491116Smsmith UINT32 EventId); 23569746Smsmith 23699679Siwasakichar 23782367SmsmithAcpiUtHexToAsciiChar ( 238202771Sjkim UINT64 Integer, 23982367Smsmith UINT32 Position); 24082367Smsmith 24167754SmsmithBOOLEAN 24277424SmsmithAcpiUtValidObjectType ( 24391116Smsmith ACPI_OBJECT_TYPE Type); 24467754Smsmith 24567754Smsmith 246151937Sjkim/* 247151937Sjkim * utinit - miscellaneous initialization and shutdown 248151937Sjkim */ 249151937SjkimACPI_STATUS 250151937SjkimAcpiUtHardwareInitialize ( 251151937Sjkim void); 25267754Smsmith 253151937Sjkimvoid 254151937SjkimAcpiUtSubsystemShutdown ( 255151937Sjkim void); 256151937Sjkim 257151937Sjkim 25867754Smsmith/* 259151937Sjkim * utclib - Local implementations of C library functions 26067754Smsmith */ 26171867Smsmith#ifndef ACPI_USE_SYSTEM_CLIBRARY 26271867Smsmith 263104470SiwasakiACPI_SIZE 26477424SmsmithAcpiUtStrlen ( 265114237Snjl const char *String); 26667754Smsmith 267114237Snjlchar * 26877424SmsmithAcpiUtStrcpy ( 269114237Snjl char *DstString, 270114237Snjl const char *SrcString); 27167754Smsmith 272114237Snjlchar * 27377424SmsmithAcpiUtStrncpy ( 274114237Snjl char *DstString, 275114237Snjl const char *SrcString, 276104470Siwasaki ACPI_SIZE Count); 27767754Smsmith 27899679Siwasakiint 279138287SmarksAcpiUtMemcmp ( 280138287Smarks const char *Buffer1, 281138287Smarks const char *Buffer2, 282138287Smarks ACPI_SIZE Count); 283138287Smarks 284138287Smarksint 28577424SmsmithAcpiUtStrncmp ( 286114237Snjl const char *String1, 287114237Snjl const char *String2, 288104470Siwasaki ACPI_SIZE Count); 28967754Smsmith 290104470Siwasakiint 29177424SmsmithAcpiUtStrcmp ( 292114237Snjl const char *String1, 293114237Snjl const char *String2); 29467754Smsmith 295114237Snjlchar * 29677424SmsmithAcpiUtStrcat ( 297114237Snjl char *DstString, 298114237Snjl const char *SrcString); 29967754Smsmith 300114237Snjlchar * 30177424SmsmithAcpiUtStrncat ( 302114237Snjl char *DstString, 303114237Snjl const char *SrcString, 304104470Siwasaki ACPI_SIZE Count); 30567754Smsmith 30667754SmsmithUINT32 30777424SmsmithAcpiUtStrtoul ( 308114237Snjl const char *String, 309114237Snjl char **Terminator, 31077424Smsmith UINT32 Base); 31167754Smsmith 312114237Snjlchar * 31377424SmsmithAcpiUtStrstr ( 314114237Snjl char *String1, 315114237Snjl char *String2); 31667754Smsmith 31767754Smsmithvoid * 31877424SmsmithAcpiUtMemcpy ( 31967754Smsmith void *Dest, 32067754Smsmith const void *Src, 321104470Siwasaki ACPI_SIZE Count); 32267754Smsmith 32367754Smsmithvoid * 32477424SmsmithAcpiUtMemset ( 32567754Smsmith void *Dest, 326193267Sjkim UINT8 Value, 327104470Siwasaki ACPI_SIZE Count); 32867754Smsmith 32999679Siwasakiint 33077424SmsmithAcpiUtToUpper ( 33199679Siwasaki int c); 33267754Smsmith 33399679Siwasakiint 33477424SmsmithAcpiUtToLower ( 33599679Siwasaki int c); 33667754Smsmith 33799679Siwasakiextern const UINT8 _acpi_ctype[]; 33899679Siwasaki 33999679Siwasaki#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 34099679Siwasaki#define _ACPI_XS 0x40 /* extra space */ 34199679Siwasaki#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 34299679Siwasaki#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 34399679Siwasaki#define _ACPI_DI 0x04 /* '0'-'9' */ 34499679Siwasaki#define _ACPI_LO 0x02 /* 'a'-'z' */ 34599679Siwasaki#define _ACPI_PU 0x10 /* punctuation */ 34699679Siwasaki#define _ACPI_SP 0x08 /* space */ 34799679Siwasaki#define _ACPI_UP 0x01 /* 'A'-'Z' */ 34899679Siwasaki#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 34999679Siwasaki 35099679Siwasaki#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 35199679Siwasaki#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 35299679Siwasaki#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 35399679Siwasaki#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 35499679Siwasaki#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 355100966Siwasaki#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 356100966Siwasaki#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 35799679Siwasaki 358193267Sjkim#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ 35967754Smsmith 360193267Sjkim#define ACPI_IS_ASCII(c) ((c) < 0x80) 361151937Sjkim 362193267Sjkim 36367754Smsmith/* 364151937Sjkim * utcopy - Object construction and conversion interfaces 36567754Smsmith */ 36667754SmsmithACPI_STATUS 36777424SmsmithAcpiUtBuildSimpleObject( 36867754Smsmith ACPI_OPERAND_OBJECT *Obj, 36967754Smsmith ACPI_OBJECT *UserObj, 37067754Smsmith UINT8 *DataSpace, 37167754Smsmith UINT32 *BufferSpaceUsed); 37267754Smsmith 37367754SmsmithACPI_STATUS 37477424SmsmithAcpiUtBuildPackageObject ( 37567754Smsmith ACPI_OPERAND_OBJECT *Obj, 37667754Smsmith UINT8 *Buffer, 37767754Smsmith UINT32 *SpaceUsed); 37867754Smsmith 37967754SmsmithACPI_STATUS 38077424SmsmithAcpiUtCopyIobjectToEobject ( 38167754Smsmith ACPI_OPERAND_OBJECT *Obj, 38267754Smsmith ACPI_BUFFER *RetBuffer); 38367754Smsmith 38467754SmsmithACPI_STATUS 38577424SmsmithAcpiUtCopyEobjectToIobject ( 38667754Smsmith ACPI_OBJECT *Obj, 38784491Smsmith ACPI_OPERAND_OBJECT **InternalObj); 38867754Smsmith 38967754SmsmithACPI_STATUS 39077424SmsmithAcpiUtCopyISimpleToIsimple ( 39167754Smsmith ACPI_OPERAND_OBJECT *SourceObj, 39267754Smsmith ACPI_OPERAND_OBJECT *DestObj); 39367754Smsmith 39467754SmsmithACPI_STATUS 39591116SmsmithAcpiUtCopyIobjectToIobject ( 39691116Smsmith ACPI_OPERAND_OBJECT *SourceDesc, 39791116Smsmith ACPI_OPERAND_OBJECT **DestDesc, 39891116Smsmith ACPI_WALK_STATE *WalkState); 39991116Smsmith 40091116Smsmith 40167754Smsmith/* 402151937Sjkim * utcreate - Object creation 40367754Smsmith */ 40467754SmsmithACPI_STATUS 40577424SmsmithAcpiUtUpdateObjectReference ( 40667754Smsmith ACPI_OPERAND_OBJECT *Object, 40767754Smsmith UINT16 Action); 40867754Smsmith 40967754Smsmith 41067754Smsmith/* 411151937Sjkim * utdebug - Debug interfaces 41267754Smsmith */ 41383174Smsmithvoid 41483174SmsmithAcpiUtInitStackPtrTrace ( 41567754Smsmith void); 41667754Smsmith 41767754Smsmithvoid 41883174SmsmithAcpiUtTrackStackPtr ( 41983174Smsmith void); 42067754Smsmith 42167754Smsmithvoid 42283174SmsmithAcpiUtTrace ( 42367754Smsmith UINT32 LineNumber, 424151937Sjkim const char *FunctionName, 425193267Sjkim const char *ModuleName, 426151937Sjkim UINT32 ComponentId); 42767754Smsmith 42867754Smsmithvoid 42983174SmsmithAcpiUtTracePtr ( 43067754Smsmith UINT32 LineNumber, 431151937Sjkim const char *FunctionName, 432193267Sjkim const char *ModuleName, 433151937Sjkim UINT32 ComponentId, 43467754Smsmith void *Pointer); 43567754Smsmith 43667754Smsmithvoid 43783174SmsmithAcpiUtTraceU32 ( 43867754Smsmith UINT32 LineNumber, 439151937Sjkim const char *FunctionName, 440193267Sjkim const char *ModuleName, 441151937Sjkim UINT32 ComponentId, 44267754Smsmith UINT32 Integer); 44367754Smsmith 44467754Smsmithvoid 44583174SmsmithAcpiUtTraceStr ( 44667754Smsmith UINT32 LineNumber, 447151937Sjkim const char *FunctionName, 448193267Sjkim const char *ModuleName, 449151937Sjkim UINT32 ComponentId, 450114237Snjl char *String); 45167754Smsmith 45267754Smsmithvoid 45383174SmsmithAcpiUtExit ( 45467754Smsmith UINT32 LineNumber, 455151937Sjkim const char *FunctionName, 456193267Sjkim const char *ModuleName, 457151937Sjkim UINT32 ComponentId); 45867754Smsmith 45967754Smsmithvoid 46083174SmsmithAcpiUtStatusExit ( 46167754Smsmith UINT32 LineNumber, 462151937Sjkim const char *FunctionName, 463193267Sjkim const char *ModuleName, 464151937Sjkim UINT32 ComponentId, 46567754Smsmith ACPI_STATUS Status); 46667754Smsmith 46767754Smsmithvoid 46883174SmsmithAcpiUtValueExit ( 46967754Smsmith UINT32 LineNumber, 470151937Sjkim const char *FunctionName, 471193267Sjkim const char *ModuleName, 472151937Sjkim UINT32 ComponentId, 473202771Sjkim UINT64 Value); 47467754Smsmith 47567754Smsmithvoid 47683174SmsmithAcpiUtPtrExit ( 47767754Smsmith UINT32 LineNumber, 478151937Sjkim const char *FunctionName, 479193267Sjkim const char *ModuleName, 480151937Sjkim UINT32 ComponentId, 48167754Smsmith UINT8 *Ptr); 48267754Smsmith 48367754Smsmithvoid 484167802SjkimAcpiUtDumpBuffer ( 485167802Sjkim UINT8 *Buffer, 486167802Sjkim UINT32 Count, 487167802Sjkim UINT32 Display, 488167802Sjkim UINT32 componentId); 48967754Smsmith 49067754Smsmithvoid 491167802SjkimAcpiUtDumpBuffer2 ( 492167802Sjkim UINT8 *Buffer, 493167802Sjkim UINT32 Count, 494167802Sjkim UINT32 Display); 495167802Sjkim 496167802Sjkimvoid 49783174SmsmithAcpiUtReportError ( 498114237Snjl char *ModuleName, 499167802Sjkim UINT32 LineNumber); 50067754Smsmith 50167754Smsmithvoid 502167802SjkimAcpiUtReportInfo ( 503114237Snjl char *ModuleName, 504167802Sjkim UINT32 LineNumber); 50567754Smsmith 50667754Smsmithvoid 507167802SjkimAcpiUtReportWarning ( 508167802Sjkim char *ModuleName, 509167802Sjkim UINT32 LineNumber); 51067754Smsmith 51167754Smsmith/* 512151937Sjkim * utdelete - Object deletion and reference counts 51367754Smsmith */ 514151937Sjkimvoid 515151937SjkimAcpiUtAddReference ( 516151937Sjkim ACPI_OPERAND_OBJECT *Object); 51767754Smsmith 51867754Smsmithvoid 519151937SjkimAcpiUtRemoveReference ( 52067754Smsmith ACPI_OPERAND_OBJECT *Object); 52167754Smsmith 52267754Smsmithvoid 52377424SmsmithAcpiUtDeleteInternalPackageObject ( 52467754Smsmith ACPI_OPERAND_OBJECT *Object); 52567754Smsmith 52667754Smsmithvoid 52777424SmsmithAcpiUtDeleteInternalSimpleObject ( 52867754Smsmith ACPI_OPERAND_OBJECT *Object); 52967754Smsmith 53099679Siwasakivoid 53177424SmsmithAcpiUtDeleteInternalObjectList ( 53267754Smsmith ACPI_OPERAND_OBJECT **ObjList); 53367754Smsmith 53467754Smsmith 53567754Smsmith/* 536151937Sjkim * uteval - object evaluation 53767754Smsmith */ 53867754SmsmithACPI_STATUS 539127175SnjlAcpiUtOsiImplementation ( 540127175Snjl ACPI_WALK_STATE *WalkState); 541127175Snjl 542127175SnjlACPI_STATUS 543114237SnjlAcpiUtEvaluateObject ( 544114237Snjl ACPI_NAMESPACE_NODE *PrefixNode, 545114237Snjl char *Path, 546114237Snjl UINT32 ExpectedReturnBtypes, 547114237Snjl ACPI_OPERAND_OBJECT **ReturnDesc); 548114237Snjl 549114237SnjlACPI_STATUS 55077424SmsmithAcpiUtEvaluateNumericObject ( 551114237Snjl char *ObjectName, 55267754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 553202771Sjkim UINT64 *Value); 55467754Smsmith 55567754SmsmithACPI_STATUS 556197104SjkimAcpiUtExecute_STA ( 55767754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 558197104Sjkim UINT32 *StatusFlags); 55967754Smsmith 56067754SmsmithACPI_STATUS 561197104SjkimAcpiUtExecutePowerMethods ( 56287031Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 563197104Sjkim const char **MethodNames, 564197104Sjkim UINT8 MethodCount, 565197104Sjkim UINT8 *OutValues); 56687031Smsmith 567197104Sjkim 568197104Sjkim/* 569197104Sjkim * utids - device ID support 570197104Sjkim */ 57187031SmsmithACPI_STATUS 572197104SjkimAcpiUtExecute_HID ( 57367754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 574197104Sjkim ACPI_DEVICE_ID **ReturnId); 57567754Smsmith 57667754SmsmithACPI_STATUS 57777424SmsmithAcpiUtExecute_UID ( 57867754Smsmith ACPI_NAMESPACE_NODE *DeviceNode, 579197104Sjkim ACPI_DEVICE_ID **ReturnId); 58067754Smsmith 581126372SnjlACPI_STATUS 582197104SjkimAcpiUtExecute_CID ( 583126372Snjl ACPI_NAMESPACE_NODE *DeviceNode, 584197104Sjkim ACPI_DEVICE_ID_LIST **ReturnCidList); 58567754Smsmith 586197104Sjkim 587193267Sjkim/* 588193267Sjkim * utlock - reader/writer locks 589193267Sjkim */ 590193267SjkimACPI_STATUS 591193267SjkimAcpiUtCreateRwLock ( 592193267Sjkim ACPI_RW_LOCK *Lock); 59367754Smsmith 594193267Sjkimvoid 595193267SjkimAcpiUtDeleteRwLock ( 596193267Sjkim ACPI_RW_LOCK *Lock); 597193267Sjkim 598193267SjkimACPI_STATUS 599193267SjkimAcpiUtAcquireReadLock ( 600193267Sjkim ACPI_RW_LOCK *Lock); 601193267Sjkim 602193267SjkimACPI_STATUS 603193267SjkimAcpiUtReleaseReadLock ( 604193267Sjkim ACPI_RW_LOCK *Lock); 605193267Sjkim 606193267SjkimACPI_STATUS 607193267SjkimAcpiUtAcquireWriteLock ( 608193267Sjkim ACPI_RW_LOCK *Lock); 609193267Sjkim 610193267Sjkimvoid 611193267SjkimAcpiUtReleaseWriteLock ( 612193267Sjkim ACPI_RW_LOCK *Lock); 613193267Sjkim 614193267Sjkim 61567754Smsmith/* 616151937Sjkim * utobject - internal object create/delete/cache routines 61767754Smsmith */ 61883174SmsmithACPI_OPERAND_OBJECT * 61983174SmsmithAcpiUtCreateInternalObjectDbg ( 620193267Sjkim const char *ModuleName, 62183174Smsmith UINT32 LineNumber, 62283174Smsmith UINT32 ComponentId, 62391116Smsmith ACPI_OBJECT_TYPE Type); 62483174Smsmith 62567754Smsmithvoid * 62683174SmsmithAcpiUtAllocateObjectDescDbg ( 627193267Sjkim const char *ModuleName, 62867754Smsmith UINT32 LineNumber, 62967754Smsmith UINT32 ComponentId); 63067754Smsmith 631151937Sjkim#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) 632151937Sjkim#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) 63367754Smsmith 63467754Smsmithvoid 63577424SmsmithAcpiUtDeleteObjectDesc ( 63667754Smsmith ACPI_OPERAND_OBJECT *Object); 63767754Smsmith 63867754SmsmithBOOLEAN 63977424SmsmithAcpiUtValidInternalObject ( 64067754Smsmith void *Object); 64167754Smsmith 642107325SiwasakiACPI_OPERAND_OBJECT * 643193267SjkimAcpiUtCreatePackageObject ( 644193267Sjkim UINT32 Count); 645193267Sjkim 646193267SjkimACPI_OPERAND_OBJECT * 647199337SjkimAcpiUtCreateIntegerObject ( 648199337Sjkim UINT64 Value); 649199337Sjkim 650199337SjkimACPI_OPERAND_OBJECT * 651107325SiwasakiAcpiUtCreateBufferObject ( 652107325Siwasaki ACPI_SIZE BufferSize); 65367754Smsmith 654138287SmarksACPI_OPERAND_OBJECT * 655138287SmarksAcpiUtCreateStringObject ( 656138287Smarks ACPI_SIZE StringSize); 657107325Siwasaki 65867754SmsmithACPI_STATUS 65977424SmsmithAcpiUtGetObjectSize( 66067754Smsmith ACPI_OPERAND_OBJECT *Obj, 66191116Smsmith ACPI_SIZE *ObjLength); 66267754Smsmith 66367754Smsmith 66467754Smsmith/* 665151937Sjkim * utstate - Generic state creation/cache routines 66667754Smsmith */ 66767754Smsmithvoid 66877424SmsmithAcpiUtPushGenericState ( 66967754Smsmith ACPI_GENERIC_STATE **ListHead, 67067754Smsmith ACPI_GENERIC_STATE *State); 67167754Smsmith 67267754SmsmithACPI_GENERIC_STATE * 67377424SmsmithAcpiUtPopGenericState ( 67467754Smsmith ACPI_GENERIC_STATE **ListHead); 67567754Smsmith 67667754Smsmith 67767754SmsmithACPI_GENERIC_STATE * 67877424SmsmithAcpiUtCreateGenericState ( 67967754Smsmith void); 68067754Smsmith 68187031SmsmithACPI_THREAD_STATE * 68287031SmsmithAcpiUtCreateThreadState ( 68387031Smsmith void); 68487031Smsmith 68567754SmsmithACPI_GENERIC_STATE * 68677424SmsmithAcpiUtCreateUpdateState ( 68767754Smsmith ACPI_OPERAND_OBJECT *Object, 68867754Smsmith UINT16 Action); 68967754Smsmith 69073561SmsmithACPI_GENERIC_STATE * 69177424SmsmithAcpiUtCreatePkgState ( 69273561Smsmith void *InternalObject, 69373561Smsmith void *ExternalObject, 69473561Smsmith UINT16 Index); 69573561Smsmith 69667754SmsmithACPI_STATUS 69777424SmsmithAcpiUtCreateUpdateStateAndPush ( 69867754Smsmith ACPI_OPERAND_OBJECT *Object, 69967754Smsmith UINT16 Action, 70067754Smsmith ACPI_GENERIC_STATE **StateList); 70167754Smsmith 70273561SmsmithACPI_STATUS 70377424SmsmithAcpiUtCreatePkgStateAndPush ( 70473561Smsmith void *InternalObject, 70573561Smsmith void *ExternalObject, 70673561Smsmith UINT16 Index, 70773561Smsmith ACPI_GENERIC_STATE **StateList); 70873561Smsmith 70967754SmsmithACPI_GENERIC_STATE * 71077424SmsmithAcpiUtCreateControlState ( 71167754Smsmith void); 71267754Smsmith 71367754Smsmithvoid 71477424SmsmithAcpiUtDeleteGenericState ( 71567754Smsmith ACPI_GENERIC_STATE *State); 71667754Smsmith 71767754Smsmith 71867754Smsmith/* 719151937Sjkim * utmath 72067754Smsmith */ 72184491SmsmithACPI_STATUS 72284491SmsmithAcpiUtDivide ( 723202771Sjkim UINT64 InDividend, 724202771Sjkim UINT64 InDivisor, 725202771Sjkim UINT64 *OutQuotient, 726202771Sjkim UINT64 *OutRemainder); 72784491Smsmith 72884491SmsmithACPI_STATUS 72984491SmsmithAcpiUtShortDivide ( 730202771Sjkim UINT64 InDividend, 73184491Smsmith UINT32 Divisor, 732202771Sjkim UINT64 *OutQuotient, 73384491Smsmith UINT32 *OutRemainder); 73484491Smsmith 735151937Sjkim/* 736151937Sjkim * utmisc 737151937Sjkim */ 738167802Sjkimconst char * 739167802SjkimAcpiUtValidateException ( 740167802Sjkim ACPI_STATUS Status); 741167802Sjkim 742167802SjkimBOOLEAN 743197104SjkimAcpiUtIsPciRootBridge ( 744197104Sjkim char *Id); 745197104Sjkim 746197104SjkimBOOLEAN 747167802SjkimAcpiUtIsAmlTable ( 748167802Sjkim ACPI_TABLE_HEADER *Table); 749167802Sjkim 750151937SjkimACPI_STATUS 751151937SjkimAcpiUtAllocateOwnerId ( 752151937Sjkim ACPI_OWNER_ID *OwnerId); 753151937Sjkim 754151937Sjkimvoid 755151937SjkimAcpiUtReleaseOwnerId ( 756151937Sjkim ACPI_OWNER_ID *OwnerId); 757151937Sjkim 758151937SjkimACPI_STATUS 759151937SjkimAcpiUtWalkPackageTree ( 760151937Sjkim ACPI_OPERAND_OBJECT *SourceObject, 761151937Sjkim void *TargetObject, 762151937Sjkim ACPI_PKG_CALLBACK WalkCallback, 763151937Sjkim void *Context); 764151937Sjkim 765151937Sjkimvoid 766151937SjkimAcpiUtStrupr ( 767151937Sjkim char *SrcString); 768151937Sjkim 769151937Sjkimvoid 770151937SjkimAcpiUtPrintString ( 771151937Sjkim char *String, 772151937Sjkim UINT8 MaxLength); 773151937Sjkim 77467754SmsmithBOOLEAN 77577424SmsmithAcpiUtValidAcpiName ( 77667754Smsmith UINT32 Name); 77767754Smsmith 778193267Sjkimvoid 779167802SjkimAcpiUtRepairName ( 780167802Sjkim char *Name); 781167802Sjkim 78267754SmsmithBOOLEAN 783167802SjkimAcpiUtValidAcpiChar ( 784167802Sjkim char Character, 785193267Sjkim UINT32 Position); 78667754Smsmith 78799679SiwasakiACPI_STATUS 78899679SiwasakiAcpiUtStrtoul64 ( 789114237Snjl char *String, 79099679Siwasaki UINT32 Base, 791202771Sjkim UINT64 *RetInteger); 79299679Siwasaki 793197104Sjkimvoid ACPI_INTERNAL_VAR_XFACE 794197104SjkimAcpiUtPredefinedWarning ( 795197104Sjkim const char *ModuleName, 796197104Sjkim UINT32 LineNumber, 797197104Sjkim char *Pathname, 798197104Sjkim UINT8 NodeFlags, 799197104Sjkim const char *Format, 800197104Sjkim ...); 801197104Sjkim 802199337Sjkimvoid ACPI_INTERNAL_VAR_XFACE 803199337SjkimAcpiUtPredefinedInfo ( 804199337Sjkim const char *ModuleName, 805199337Sjkim UINT32 LineNumber, 806199337Sjkim char *Pathname, 807199337Sjkim UINT8 NodeFlags, 808199337Sjkim const char *Format, 809199337Sjkim ...); 810199337Sjkim 811138287Smarks/* Values for Base above (16=Hex, 10=Decimal) */ 812138287Smarks 813138287Smarks#define ACPI_ANY_BASE 0 814138287Smarks 815151937SjkimUINT32 81699679SiwasakiAcpiUtDwordByteSwap ( 81799679Siwasaki UINT32 Value); 81899679Siwasaki 81999679Siwasakivoid 82099679SiwasakiAcpiUtSetIntegerWidth ( 82199679Siwasaki UINT8 Revision); 82299679Siwasaki 823102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT 82473561Smsmithvoid 82577424SmsmithAcpiUtDisplayInitPathname ( 826114237Snjl UINT8 Type, 827114237Snjl ACPI_NAMESPACE_NODE *ObjHandle, 82873561Smsmith char *Path); 82973561Smsmith#endif 83073561Smsmith 83173561Smsmith 83267754Smsmith/* 833167802Sjkim * utresrc 834167802Sjkim */ 835167802SjkimACPI_STATUS 836167802SjkimAcpiUtWalkAmlResources ( 837167802Sjkim UINT8 *Aml, 838167802Sjkim ACPI_SIZE AmlLength, 839167802Sjkim ACPI_WALK_AML_CALLBACK UserFunction, 840167802Sjkim void *Context); 841167802Sjkim 842167802SjkimACPI_STATUS 843167802SjkimAcpiUtValidateResource ( 844167802Sjkim void *Aml, 845167802Sjkim UINT8 *ReturnIndex); 846167802Sjkim 847167802SjkimUINT32 848167802SjkimAcpiUtGetDescriptorLength ( 849167802Sjkim void *Aml); 850167802Sjkim 851167802SjkimUINT16 852167802SjkimAcpiUtGetResourceLength ( 853167802Sjkim void *Aml); 854167802Sjkim 855167802SjkimUINT8 856167802SjkimAcpiUtGetResourceHeaderLength ( 857167802Sjkim void *Aml); 858167802Sjkim 859167802SjkimUINT8 860167802SjkimAcpiUtGetResourceType ( 861167802Sjkim void *Aml); 862167802Sjkim 863167802SjkimACPI_STATUS 864167802SjkimAcpiUtGetResourceEndTag ( 865167802Sjkim ACPI_OPERAND_OBJECT *ObjDesc, 866167802Sjkim UINT8 **EndTag); 867167802Sjkim 868167802Sjkim 869167802Sjkim/* 870151937Sjkim * utmutex - mutex support 87167754Smsmith */ 872151937SjkimACPI_STATUS 873151937SjkimAcpiUtMutexInitialize ( 874151937Sjkim void); 87567754Smsmith 87682367Smsmithvoid 877151937SjkimAcpiUtMutexTerminate ( 878151937Sjkim void); 87982367Smsmith 880151937SjkimACPI_STATUS 881151937SjkimAcpiUtAcquireMutex ( 882151937Sjkim ACPI_MUTEX_HANDLE MutexId); 88382367Smsmith 88491116SmsmithACPI_STATUS 885151937SjkimAcpiUtReleaseMutex ( 886151937Sjkim ACPI_MUTEX_HANDLE MutexId); 887151937Sjkim 888151937Sjkim 889151937Sjkim/* 890151937Sjkim * utalloc - memory allocation and object caching 891151937Sjkim */ 892151937SjkimACPI_STATUS 893151937SjkimAcpiUtCreateCaches ( 894151937Sjkim void); 895151937Sjkim 896151937SjkimACPI_STATUS 897151937SjkimAcpiUtDeleteCaches ( 898151937Sjkim void); 899151937Sjkim 900151937SjkimACPI_STATUS 90191116SmsmithAcpiUtValidateBuffer ( 90291116Smsmith ACPI_BUFFER *Buffer); 90382367Smsmith 90491116SmsmithACPI_STATUS 90591116SmsmithAcpiUtInitializeBuffer ( 90691116Smsmith ACPI_BUFFER *Buffer, 90791116Smsmith ACPI_SIZE RequiredLength); 90882367Smsmith 90982367Smsmithvoid * 91080062SmsmithAcpiUtAllocate ( 91191116Smsmith ACPI_SIZE Size, 91267754Smsmith UINT32 Component, 913193267Sjkim const char *Module, 91467754Smsmith UINT32 Line); 91567754Smsmith 91667754Smsmithvoid * 917167802SjkimAcpiUtAllocateZeroed ( 91891116Smsmith ACPI_SIZE Size, 91967754Smsmith UINT32 Component, 920193267Sjkim const char *Module, 92167754Smsmith UINT32 Line); 92267754Smsmith 92391116Smsmith#ifdef ACPI_DBG_TRACK_ALLOCATIONS 92491116Smsmithvoid * 92591116SmsmithAcpiUtAllocateAndTrack ( 92691116Smsmith ACPI_SIZE Size, 92791116Smsmith UINT32 Component, 928193267Sjkim const char *Module, 92991116Smsmith UINT32 Line); 93091116Smsmith 93191116Smsmithvoid * 932167802SjkimAcpiUtAllocateZeroedAndTrack ( 93391116Smsmith ACPI_SIZE Size, 93491116Smsmith UINT32 Component, 935193267Sjkim const char *Module, 93691116Smsmith UINT32 Line); 93791116Smsmith 93867754Smsmithvoid 93991116SmsmithAcpiUtFreeAndTrack ( 94067754Smsmith void *Address, 94167754Smsmith UINT32 Component, 942193267Sjkim const char *Module, 94367754Smsmith UINT32 Line); 94499679Siwasaki 94567754Smsmithvoid 94677424SmsmithAcpiUtDumpAllocationInfo ( 94767754Smsmith void); 94867754Smsmith 94967754Smsmithvoid 95084491SmsmithAcpiUtDumpAllocations ( 95167754Smsmith UINT32 Component, 952193267Sjkim const char *Module); 953167802Sjkim 954167802SjkimACPI_STATUS 955167802SjkimAcpiUtCreateList ( 956167802Sjkim char *ListName, 957167802Sjkim UINT16 ObjectSize, 958167802Sjkim ACPI_MEMORY_LIST **ReturnCache); 959167802Sjkim 960167802Sjkim 96167754Smsmith#endif 96267754Smsmith 96377424Smsmith#endif /* _ACUTILS_H */ 964