Path: blob/main/sys/contrib/dev/acpica/include/acutils.h
48287 views
/******************************************************************************1*2* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#ifndef _ACUTILS_H152#define _ACUTILS_H153154155extern const UINT8 AcpiGbl_ResourceAmlSizes[];156extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];157158/* Strings used by the disassembler and debugger resource dump routines */159160#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)161162extern const char *AcpiGbl_BmDecode[];163extern const char *AcpiGbl_ConfigDecode[];164extern const char *AcpiGbl_ConsumeDecode[];165extern const char *AcpiGbl_DecDecode[];166extern const char *AcpiGbl_HeDecode[];167extern const char *AcpiGbl_IoDecode[];168extern const char *AcpiGbl_LlDecode[];169extern const char *AcpiGbl_MaxDecode[];170extern const char *AcpiGbl_MemDecode[];171extern const char *AcpiGbl_MinDecode[];172extern const char *AcpiGbl_MtpDecode[];173extern const char *AcpiGbl_PhyDecode[];174extern const char *AcpiGbl_RngDecode[];175extern const char *AcpiGbl_RwDecode[];176extern const char *AcpiGbl_ShrDecode[];177extern const char *AcpiGbl_SizDecode[];178extern const char *AcpiGbl_TrsDecode[];179extern const char *AcpiGbl_TtpDecode[];180extern const char *AcpiGbl_TypDecode[];181extern const char *AcpiGbl_PpcDecode[];182extern const char *AcpiGbl_IorDecode[];183extern const char *AcpiGbl_DtsDecode[];184extern const char *AcpiGbl_CtDecode[];185extern const char *AcpiGbl_SbtDecode[];186extern const char *AcpiGbl_AmDecode[];187extern const char *AcpiGbl_SmDecode[];188extern const char *AcpiGbl_WmDecode[];189extern const char *AcpiGbl_CphDecode[];190extern const char *AcpiGbl_CpoDecode[];191extern const char *AcpiGbl_DpDecode[];192extern const char *AcpiGbl_EdDecode[];193extern const char *AcpiGbl_BpbDecode[];194extern const char *AcpiGbl_SbDecode[];195extern const char *AcpiGbl_FcDecode[];196extern const char *AcpiGbl_PtDecode[];197extern const char *AcpiGbl_PtypDecode[];198extern const char *AcpiGbl_ClockInputMode[];199extern const char *AcpiGbl_ClockInputScale[];200#endif201202/*203* For the iASL compiler case, the output is redirected to stderr so that204* any of the various ACPI errors and warnings do not appear in the output205* files, for either the compiler or disassembler portions of the tool.206*/207#ifdef ACPI_ASL_COMPILER208209#include <stdio.h>210211#define ACPI_MSG_REDIRECT_BEGIN \212FILE *OutputFile = AcpiGbl_OutputFile; \213AcpiOsRedirectOutput (stderr);214215#define ACPI_MSG_REDIRECT_END \216AcpiOsRedirectOutput (OutputFile);217218#else219/*220* non-iASL case - no redirection, nothing to do221*/222#define ACPI_MSG_REDIRECT_BEGIN223#define ACPI_MSG_REDIRECT_END224#endif225226/*227* Common error message prefixes228*/229#ifndef ACPI_MSG_ERROR230#define ACPI_MSG_ERROR "ACPI Error: "231#endif232#ifndef ACPI_MSG_WARNING233#define ACPI_MSG_WARNING "ACPI Warning: "234#endif235#ifndef ACPI_MSG_INFO236#define ACPI_MSG_INFO "ACPI: "237#endif238239#ifndef ACPI_MSG_BIOS_ERROR240#define ACPI_MSG_BIOS_ERROR "Firmware Error (ACPI): "241#endif242#ifndef ACPI_MSG_BIOS_WARNING243#define ACPI_MSG_BIOS_WARNING "Firmware Warning (ACPI): "244#endif245246/*247* Common message suffix248*/249#define ACPI_MSG_SUFFIX \250AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)251252/* Flags to indicate implicit or explicit string-to-integer conversion */253254#define ACPI_IMPLICIT_CONVERSION TRUE255#define ACPI_NO_IMPLICIT_CONVERSION FALSE256257/* Types for Resource descriptor entries */258259#define ACPI_INVALID_RESOURCE 0260#define ACPI_FIXED_LENGTH 1261#define ACPI_VARIABLE_LENGTH 2262#define ACPI_SMALL_VARIABLE_LENGTH 3263264typedef265ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (266UINT8 *Aml,267UINT32 Length,268UINT32 Offset,269UINT8 ResourceIndex,270void **Context);271272typedef273ACPI_STATUS (*ACPI_PKG_CALLBACK) (274UINT8 ObjectType,275ACPI_OPERAND_OBJECT *SourceObject,276ACPI_GENERIC_STATE *State,277void *Context);278279typedef struct acpi_pkg_info280{281UINT8 *FreeSpace;282ACPI_SIZE Length;283UINT32 ObjectSpace;284UINT32 NumPackages;285286} ACPI_PKG_INFO;287288/* Object reference counts */289290#define REF_INCREMENT (UINT16) 0291#define REF_DECREMENT (UINT16) 1292293/* AcpiUtDumpBuffer */294295#define DB_BYTE_DISPLAY 0x01296#define DB_WORD_DISPLAY 0x02297#define DB_DWORD_DISPLAY 0x04298#define DB_QWORD_DISPLAY 0x08299#define DB_DISPLAY_DATA_ONLY 0x10300301302/*303* utascii - ASCII utilities304*/305BOOLEAN306AcpiUtValidNameseg (307char *Signature);308309BOOLEAN310AcpiUtValidNameChar (311char Character,312UINT32 Position);313314void315AcpiUtCheckAndRepairAscii (316UINT8 *Name,317char *RepairedName,318UINT32 Count);319320321/*322* utcksum - Checksum utilities323*/324UINT8325AcpiUtGenerateChecksum (326void *Table,327UINT32 Length,328UINT8 OriginalChecksum);329330UINT8331AcpiUtChecksum (332UINT8 *Buffer,333UINT32 Length);334335ACPI_STATUS336AcpiUtVerifyCdatChecksum (337ACPI_TABLE_CDAT *CdatTable,338UINT32 Length);339340ACPI_STATUS341AcpiUtVerifyChecksum (342ACPI_TABLE_HEADER *Table,343UINT32 Length);344345346/*347* utnonansi - Non-ANSI C library functions348*/349void350AcpiUtStrupr (351char *SrcString);352353void354AcpiUtStrlwr (355char *SrcString);356357int358AcpiUtStricmp (359char *String1,360char *String2);361362363/*364* utstrsuppt - string-to-integer conversion support functions365*/366ACPI_STATUS367AcpiUtConvertOctalString (368char *String,369UINT64 *ReturnValue);370371ACPI_STATUS372AcpiUtConvertDecimalString (373char *String,374UINT64 *ReturnValuePtr);375376ACPI_STATUS377AcpiUtConvertHexString (378char *String,379UINT64 *ReturnValuePtr);380381char382AcpiUtRemoveWhitespace (383char **String);384385char386AcpiUtRemoveLeadingZeros (387char **String);388389BOOLEAN390AcpiUtDetectHexPrefix (391char **String);392393void394AcpiUtRemoveHexPrefix (395char **String);396397BOOLEAN398AcpiUtDetectOctalPrefix (399char **String);400401402/*403* utstrtoul64 - string-to-integer conversion functions404*/405ACPI_STATUS406AcpiUtStrtoul64 (407char *String,408UINT64 *RetInteger);409410UINT64411AcpiUtExplicitStrtoul64 (412char *String);413414UINT64415AcpiUtImplicitStrtoul64 (416char *String);417418419/*420* utglobal - Global data structures and procedures421*/422ACPI_STATUS423AcpiUtInitGlobals (424void);425426const char *427AcpiUtGetMutexName (428UINT32 MutexId);429430#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)431432const char *433AcpiUtGetNotifyName (434UINT32 NotifyValue,435ACPI_OBJECT_TYPE Type);436#endif437438const char *439AcpiUtGetTypeName (440ACPI_OBJECT_TYPE Type);441442const char *443AcpiUtGetNodeName (444void *Object);445446const char *447AcpiUtGetDescriptorName (448void *Object);449450const char *451AcpiUtGetReferenceName (452ACPI_OPERAND_OBJECT *Object);453454const char *455AcpiUtGetObjectTypeName (456ACPI_OPERAND_OBJECT *ObjDesc);457458const char *459AcpiUtGetRegionName (460UINT8 SpaceId);461462const char *463AcpiUtGetEventName (464UINT32 EventId);465466const char *467AcpiUtGetArgumentTypeName (468UINT32 ArgType);469470char471AcpiUtHexToAsciiChar (472UINT64 Integer,473UINT32 Position);474475ACPI_STATUS476AcpiUtAsciiToHexByte (477char *TwoAsciiChars,478UINT8 *ReturnByte);479480UINT8481AcpiUtAsciiCharToHex (482int HexChar);483484BOOLEAN485AcpiUtValidObjectType (486ACPI_OBJECT_TYPE Type);487488489/*490* utinit - miscellaneous initialization and shutdown491*/492ACPI_STATUS493AcpiUtHardwareInitialize (494void);495496void497AcpiUtSubsystemShutdown (498void);499500501/*502* utcopy - Object construction and conversion interfaces503*/504ACPI_STATUS505AcpiUtBuildSimpleObject(506ACPI_OPERAND_OBJECT *Obj,507ACPI_OBJECT *UserObj,508UINT8 *DataSpace,509UINT32 *BufferSpaceUsed);510511ACPI_STATUS512AcpiUtBuildPackageObject (513ACPI_OPERAND_OBJECT *Obj,514UINT8 *Buffer,515UINT32 *SpaceUsed);516517ACPI_STATUS518AcpiUtCopyIobjectToEobject (519ACPI_OPERAND_OBJECT *Obj,520ACPI_BUFFER *RetBuffer);521522ACPI_STATUS523AcpiUtCopyEobjectToIobject (524ACPI_OBJECT *Obj,525ACPI_OPERAND_OBJECT **InternalObj);526527ACPI_STATUS528AcpiUtCopyISimpleToIsimple (529ACPI_OPERAND_OBJECT *SourceObj,530ACPI_OPERAND_OBJECT *DestObj);531532ACPI_STATUS533AcpiUtCopyIobjectToIobject (534ACPI_OPERAND_OBJECT *SourceDesc,535ACPI_OPERAND_OBJECT **DestDesc,536ACPI_WALK_STATE *WalkState);537538539/*540* utcreate - Object creation541*/542ACPI_STATUS543AcpiUtUpdateObjectReference (544ACPI_OPERAND_OBJECT *Object,545UINT16 Action);546547548/*549* utdebug - Debug interfaces550*/551void552AcpiUtInitStackPtrTrace (553void);554555void556AcpiUtTrackStackPtr (557void);558559void560AcpiUtTrace (561UINT32 LineNumber,562const char *FunctionName,563const char *ModuleName,564UINT32 ComponentId);565566void567AcpiUtTracePtr (568UINT32 LineNumber,569const char *FunctionName,570const char *ModuleName,571UINT32 ComponentId,572const void *Pointer);573574void575AcpiUtTraceU32 (576UINT32 LineNumber,577const char *FunctionName,578const char *ModuleName,579UINT32 ComponentId,580UINT32 Integer);581582void583AcpiUtTraceStr (584UINT32 LineNumber,585const char *FunctionName,586const char *ModuleName,587UINT32 ComponentId,588const char *String);589590void591AcpiUtExit (592UINT32 LineNumber,593const char *FunctionName,594const char *ModuleName,595UINT32 ComponentId);596597void598AcpiUtStatusExit (599UINT32 LineNumber,600const char *FunctionName,601const char *ModuleName,602UINT32 ComponentId,603ACPI_STATUS Status);604605void606AcpiUtValueExit (607UINT32 LineNumber,608const char *FunctionName,609const char *ModuleName,610UINT32 ComponentId,611UINT64 Value);612613void614AcpiUtPtrExit (615UINT32 LineNumber,616const char *FunctionName,617const char *ModuleName,618UINT32 ComponentId,619UINT8 *Ptr);620621void622AcpiUtStrExit (623UINT32 LineNumber,624const char *FunctionName,625const char *ModuleName,626UINT32 ComponentId,627const char *String);628629void630AcpiUtDebugDumpBuffer (631UINT8 *Buffer,632UINT32 Count,633UINT32 Display,634UINT32 ComponentId);635636void637AcpiUtDumpBuffer (638UINT8 *Buffer,639UINT32 Count,640UINT32 Display,641UINT32 Offset);642643#ifdef ACPI_APPLICATION644void645AcpiUtDumpBufferToFile (646ACPI_FILE File,647UINT8 *Buffer,648UINT32 Count,649UINT32 Display,650UINT32 BaseOffset);651#endif652653void654AcpiUtReportError (655char *ModuleName,656UINT32 LineNumber);657658void659AcpiUtReportInfo (660char *ModuleName,661UINT32 LineNumber);662663void664AcpiUtReportWarning (665char *ModuleName,666UINT32 LineNumber);667668669/*670* utdelete - Object deletion and reference counts671*/672void673AcpiUtAddReference (674ACPI_OPERAND_OBJECT *Object);675676void677AcpiUtRemoveReference (678ACPI_OPERAND_OBJECT *Object);679680void681AcpiUtDeleteInternalPackageObject (682ACPI_OPERAND_OBJECT *Object);683684void685AcpiUtDeleteInternalSimpleObject (686ACPI_OPERAND_OBJECT *Object);687688void689AcpiUtDeleteInternalObjectList (690ACPI_OPERAND_OBJECT **ObjList);691692693/*694* uteval - object evaluation695*/696ACPI_STATUS697AcpiUtEvaluateObject (698ACPI_NAMESPACE_NODE *PrefixNode,699const char *Path,700UINT32 ExpectedReturnBtypes,701ACPI_OPERAND_OBJECT **ReturnDesc);702703ACPI_STATUS704AcpiUtEvaluateNumericObject (705const char *ObjectName,706ACPI_NAMESPACE_NODE *DeviceNode,707UINT64 *Value);708709ACPI_STATUS710AcpiUtExecute_STA (711ACPI_NAMESPACE_NODE *DeviceNode,712UINT32 *StatusFlags);713714ACPI_STATUS715AcpiUtExecutePowerMethods (716ACPI_NAMESPACE_NODE *DeviceNode,717const char **MethodNames,718UINT8 MethodCount,719UINT8 *OutValues);720721722/*723* utids - device ID support724*/725ACPI_STATUS726AcpiUtExecute_HID (727ACPI_NAMESPACE_NODE *DeviceNode,728ACPI_PNP_DEVICE_ID **ReturnId);729730ACPI_STATUS731AcpiUtExecute_UID (732ACPI_NAMESPACE_NODE *DeviceNode,733ACPI_PNP_DEVICE_ID **ReturnId);734735ACPI_STATUS736AcpiUtExecute_CID (737ACPI_NAMESPACE_NODE *DeviceNode,738ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);739740ACPI_STATUS741AcpiUtExecute_CLS (742ACPI_NAMESPACE_NODE *DeviceNode,743ACPI_PNP_DEVICE_ID **ReturnId);744745746/*747* utlock - reader/writer locks748*/749ACPI_STATUS750AcpiUtCreateRwLock (751ACPI_RW_LOCK *Lock);752753void754AcpiUtDeleteRwLock (755ACPI_RW_LOCK *Lock);756757ACPI_STATUS758AcpiUtAcquireReadLock (759ACPI_RW_LOCK *Lock);760761ACPI_STATUS762AcpiUtReleaseReadLock (763ACPI_RW_LOCK *Lock);764765ACPI_STATUS766AcpiUtAcquireWriteLock (767ACPI_RW_LOCK *Lock);768769void770AcpiUtReleaseWriteLock (771ACPI_RW_LOCK *Lock);772773774/*775* utobject - internal object create/delete/cache routines776*/777ACPI_OPERAND_OBJECT *778AcpiUtCreateInternalObjectDbg (779const char *ModuleName,780UINT32 LineNumber,781UINT32 ComponentId,782ACPI_OBJECT_TYPE Type);783784void *785AcpiUtAllocateObjectDescDbg (786const char *ModuleName,787UINT32 LineNumber,788UINT32 ComponentId);789790#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)791#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)792793void794AcpiUtDeleteObjectDesc (795ACPI_OPERAND_OBJECT *Object);796797BOOLEAN798AcpiUtValidInternalObject (799void *Object);800801ACPI_OPERAND_OBJECT *802AcpiUtCreatePackageObject (803UINT32 Count);804805ACPI_OPERAND_OBJECT *806AcpiUtCreateIntegerObject (807UINT64 Value);808809ACPI_OPERAND_OBJECT *810AcpiUtCreateBufferObject (811ACPI_SIZE BufferSize);812813ACPI_OPERAND_OBJECT *814AcpiUtCreateStringObject (815ACPI_SIZE StringSize);816817ACPI_STATUS818AcpiUtGetObjectSize(819ACPI_OPERAND_OBJECT *Obj,820ACPI_SIZE *ObjLength);821822823/*824* utosi - Support for the _OSI predefined control method825*/826ACPI_STATUS827AcpiUtInitializeInterfaces (828void);829830ACPI_STATUS831AcpiUtInterfaceTerminate (832void);833834ACPI_STATUS835AcpiUtInstallInterface (836ACPI_STRING InterfaceName);837838ACPI_STATUS839AcpiUtRemoveInterface (840ACPI_STRING InterfaceName);841842ACPI_STATUS843AcpiUtUpdateInterfaces (844UINT8 Action);845846ACPI_INTERFACE_INFO *847AcpiUtGetInterface (848ACPI_STRING InterfaceName);849850ACPI_STATUS851AcpiUtOsiImplementation (852ACPI_WALK_STATE *WalkState);853854855/*856* utpredef - support for predefined names857*/858const ACPI_PREDEFINED_INFO *859AcpiUtGetNextPredefinedMethod (860const ACPI_PREDEFINED_INFO *ThisName);861862const ACPI_PREDEFINED_INFO *863AcpiUtMatchPredefinedMethod (864char *Name);865866void867AcpiUtGetExpectedReturnTypes (868char *Buffer,869UINT32 ExpectedBtypes);870871#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)872const ACPI_PREDEFINED_INFO *873AcpiUtMatchResourceName (874char *Name);875876void877AcpiUtDisplayPredefinedMethod (878char *Buffer,879const ACPI_PREDEFINED_INFO *ThisName,880BOOLEAN MultiLine);881882UINT32883AcpiUtGetResourceBitWidth (884char *Buffer,885UINT16 Types);886#endif887888889/*890* utstate - Generic state creation/cache routines891*/892void893AcpiUtPushGenericState (894ACPI_GENERIC_STATE **ListHead,895ACPI_GENERIC_STATE *State);896897ACPI_GENERIC_STATE *898AcpiUtPopGenericState (899ACPI_GENERIC_STATE **ListHead);900901902ACPI_GENERIC_STATE *903AcpiUtCreateGenericState (904void);905906ACPI_THREAD_STATE *907AcpiUtCreateThreadState (908void);909910ACPI_GENERIC_STATE *911AcpiUtCreateUpdateState (912ACPI_OPERAND_OBJECT *Object,913UINT16 Action);914915ACPI_GENERIC_STATE *916AcpiUtCreatePkgState (917void *InternalObject,918void *ExternalObject,919UINT32 Index);920921ACPI_STATUS922AcpiUtCreateUpdateStateAndPush (923ACPI_OPERAND_OBJECT *Object,924UINT16 Action,925ACPI_GENERIC_STATE **StateList);926927ACPI_GENERIC_STATE *928AcpiUtCreateControlState (929void);930931void932AcpiUtDeleteGenericState (933ACPI_GENERIC_STATE *State);934935936/*937* utmath938*/939ACPI_STATUS940AcpiUtDivide (941UINT64 InDividend,942UINT64 InDivisor,943UINT64 *OutQuotient,944UINT64 *OutRemainder);945946ACPI_STATUS947AcpiUtShortDivide (948UINT64 InDividend,949UINT32 Divisor,950UINT64 *OutQuotient,951UINT32 *OutRemainder);952953ACPI_STATUS954AcpiUtShortMultiply (955UINT64 InMultiplicand,956UINT32 Multiplier,957UINT64 *Outproduct);958959ACPI_STATUS960AcpiUtShortShiftLeft (961UINT64 Operand,962UINT32 Count,963UINT64 *OutResult);964965ACPI_STATUS966AcpiUtShortShiftRight (967UINT64 Operand,968UINT32 Count,969UINT64 *OutResult);970971972/*973* utmisc974*/975const ACPI_EXCEPTION_INFO *976AcpiUtValidateException (977ACPI_STATUS Status);978979BOOLEAN980AcpiUtIsPciRootBridge (981char *Id);982983#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)984BOOLEAN985AcpiUtIsAmlTable (986ACPI_TABLE_HEADER *Table);987#endif988989ACPI_STATUS990AcpiUtWalkPackageTree (991ACPI_OPERAND_OBJECT *SourceObject,992void *TargetObject,993ACPI_PKG_CALLBACK WalkCallback,994void *Context);995996/* Values for Base above (16=Hex, 10=Decimal) */997998#define ACPI_ANY_BASE 099910001001UINT321002AcpiUtDwordByteSwap (1003UINT32 Value);10041005void1006AcpiUtSetIntegerWidth (1007UINT8 Revision);10081009#ifdef ACPI_DEBUG_OUTPUT1010void1011AcpiUtDisplayInitPathname (1012UINT8 Type,1013ACPI_NAMESPACE_NODE *ObjHandle,1014const char *Path);1015#endif101610171018/*1019* utownerid - Support for Table/Method Owner IDs1020*/1021ACPI_STATUS1022AcpiUtAllocateOwnerId (1023ACPI_OWNER_ID *OwnerId);10241025void1026AcpiUtReleaseOwnerId (1027ACPI_OWNER_ID *OwnerId);102810291030/*1031* utresrc1032*/1033ACPI_STATUS1034AcpiUtWalkAmlResources (1035ACPI_WALK_STATE *WalkState,1036UINT8 *Aml,1037ACPI_SIZE AmlLength,1038ACPI_WALK_AML_CALLBACK UserFunction,1039void **Context);10401041ACPI_STATUS1042AcpiUtValidateResource (1043ACPI_WALK_STATE *WalkState,1044void *Aml,1045UINT8 *ReturnIndex);10461047UINT321048AcpiUtGetDescriptorLength (1049void *Aml);10501051UINT161052AcpiUtGetResourceLength (1053void *Aml);10541055UINT81056AcpiUtGetResourceHeaderLength (1057void *Aml);10581059UINT81060AcpiUtGetResourceType (1061void *Aml);10621063ACPI_STATUS1064AcpiUtGetResourceEndTag (1065ACPI_OPERAND_OBJECT *ObjDesc,1066UINT8 **EndTag);106710681069/*1070* utstring - String and character utilities1071*/1072void1073AcpiUtPrintString (1074char *String,1075UINT16 MaxLength);10761077#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP1078void1079UtConvertBackslashes (1080char *Pathname);1081#endif10821083void1084AcpiUtRepairName (1085char *Name);10861087#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) || defined (ACPI_DEBUG_OUTPUT)1088BOOLEAN1089AcpiUtSafeStrcpy (1090char *Dest,1091ACPI_SIZE DestSize,1092char *Source);10931094void1095AcpiUtSafeStrncpy (1096char *Dest,1097char *Source,1098ACPI_SIZE DestSize);10991100BOOLEAN1101AcpiUtSafeStrcat (1102char *Dest,1103ACPI_SIZE DestSize,1104char *Source);11051106BOOLEAN1107AcpiUtSafeStrncat (1108char *Dest,1109ACPI_SIZE DestSize,1110char *Source,1111ACPI_SIZE MaxTransferLength);1112#endif111311141115/*1116* utmutex - mutex support1117*/1118ACPI_STATUS1119AcpiUtMutexInitialize (1120void);11211122void1123AcpiUtMutexTerminate (1124void);11251126ACPI_STATUS1127AcpiUtAcquireMutex (1128ACPI_MUTEX_HANDLE MutexId);11291130ACPI_STATUS1131AcpiUtReleaseMutex (1132ACPI_MUTEX_HANDLE MutexId);113311341135/*1136* utalloc - memory allocation and object caching1137*/1138ACPI_STATUS1139AcpiUtCreateCaches (1140void);11411142ACPI_STATUS1143AcpiUtDeleteCaches (1144void);11451146ACPI_STATUS1147AcpiUtValidateBuffer (1148ACPI_BUFFER *Buffer);11491150ACPI_STATUS1151AcpiUtInitializeBuffer (1152ACPI_BUFFER *Buffer,1153ACPI_SIZE RequiredLength);11541155#ifdef ACPI_DBG_TRACK_ALLOCATIONS1156void *1157AcpiUtAllocateAndTrack (1158ACPI_SIZE Size,1159UINT32 Component,1160const char *Module,1161UINT32 Line);11621163void *1164AcpiUtAllocateZeroedAndTrack (1165ACPI_SIZE Size,1166UINT32 Component,1167const char *Module,1168UINT32 Line);11691170void1171AcpiUtFreeAndTrack (1172void *Address,1173UINT32 Component,1174const char *Module,1175UINT32 Line);11761177void1178AcpiUtDumpAllocationInfo (1179void);11801181void1182AcpiUtDumpAllocations (1183UINT32 Component,1184const char *Module);11851186ACPI_STATUS1187AcpiUtCreateList (1188const char *ListName,1189UINT16 ObjectSize,1190ACPI_MEMORY_LIST **ReturnCache);11911192#endif /* ACPI_DBG_TRACK_ALLOCATIONS */119311941195/*1196* utaddress - address range check1197*/1198ACPI_STATUS1199AcpiUtAddAddressRange (1200ACPI_ADR_SPACE_TYPE SpaceId,1201ACPI_PHYSICAL_ADDRESS Address,1202UINT32 Length,1203ACPI_NAMESPACE_NODE *RegionNode);12041205void1206AcpiUtRemoveAddressRange (1207ACPI_ADR_SPACE_TYPE SpaceId,1208ACPI_NAMESPACE_NODE *RegionNode);12091210UINT321211AcpiUtCheckAddressRange (1212ACPI_ADR_SPACE_TYPE SpaceId,1213ACPI_PHYSICAL_ADDRESS Address,1214UINT32 Length,1215BOOLEAN Warn);12161217void1218AcpiUtDeleteAddressLists (1219void);122012211222/*1223* utxferror - various error/warning output functions1224*/1225ACPI_PRINTF_LIKE(5)1226void ACPI_INTERNAL_VAR_XFACE1227AcpiUtPredefinedWarning (1228const char *ModuleName,1229UINT32 LineNumber,1230char *Pathname,1231UINT16 NodeFlags,1232const char *Format,1233...);12341235ACPI_PRINTF_LIKE(5)1236void ACPI_INTERNAL_VAR_XFACE1237AcpiUtPredefinedInfo (1238const char *ModuleName,1239UINT32 LineNumber,1240char *Pathname,1241UINT16 NodeFlags,1242const char *Format,1243...);12441245ACPI_PRINTF_LIKE(5)1246void ACPI_INTERNAL_VAR_XFACE1247AcpiUtPredefinedBiosError (1248const char *ModuleName,1249UINT32 LineNumber,1250char *Pathname,1251UINT16 NodeFlags,1252const char *Format,1253...);12541255void1256AcpiUtPrefixedNamespaceError (1257const char *ModuleName,1258UINT32 LineNumber,1259ACPI_GENERIC_STATE *PrefixScope,1260const char *InternalName,1261ACPI_STATUS LookupStatus);12621263void1264AcpiUtMethodError (1265const char *ModuleName,1266UINT32 LineNumber,1267const char *Message,1268ACPI_NAMESPACE_NODE *Node,1269const char *Path,1270ACPI_STATUS LookupStatus);127112721273/*1274* Utility functions for ACPI names and IDs1275*/1276const AH_PREDEFINED_NAME *1277AcpiAhMatchPredefinedName (1278char *Nameseg);12791280const AH_DEVICE_ID *1281AcpiAhMatchHardwareId (1282char *Hid);12831284const char *1285AcpiAhMatchUuid (1286UINT8 *Data);128712881289/*1290* utuuid -- UUID support functions1291*/1292#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)1293void1294AcpiUtConvertStringToUuid (1295char *InString,1296UINT8 *UuidBuffer);12971298ACPI_STATUS1299AcpiUtConvertUuidToString (1300char *UuidBuffer,1301char *OutString);1302#endif13031304#endif /* _ACUTILS_H */130513061307