Path: blob/main/sys/contrib/dev/acpica/compiler/aslcompiler.h
48371 views
/******************************************************************************1*2* Module Name: aslcompiler.h - common include file for iASL3*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 __ASLCOMPILER_H152#define __ASLCOMPILER_H153154#include <contrib/dev/acpica/include/acpi.h>155#include <contrib/dev/acpica/include/accommon.h>156#include <contrib/dev/acpica/include/amlresrc.h>157#include <contrib/dev/acpica/include/acdebug.h>158159/* Microsoft-specific */160161#if (defined WIN32 || defined WIN64)162163/* warn : used #pragma pack */164#pragma warning(disable:4103)165166/* warn : named type definition in parentheses */167#pragma warning(disable:4115)168#endif169170#include <stdio.h>171#include <stdlib.h>172#include <string.h>173#include <errno.h>174#include <ctype.h>175176/* Compiler headers */177178#include <contrib/dev/acpica/compiler/asldefine.h>179#include <contrib/dev/acpica/compiler/asltypes.h>180#include <contrib/dev/acpica/compiler/aslmessages.h>181#include <contrib/dev/acpica/compiler/aslglobal.h>182#include <contrib/dev/acpica/compiler/preprocess.h>183#include <contrib/dev/acpica/compiler/dtcompiler.h>184185186/*******************************************************************************187*188* Compiler prototypes189*190******************************************************************************/191192/*193* Main ASL parser - generated from flex/bison, lex/yacc, etc.194*/195ACPI_PARSE_OBJECT *196AslDoError (197void);198199int200AslCompilerlex(201void);202203void204AslResetCurrentLineBuffer (205void);206207void208AslInsertLineBuffer (209int SourceChar);210211int212AslPopInputFileStack (213void);214215void216AslPushInputFileStack (217FILE *InputFile,218char *Filename);219220void221AslParserCleanup (222void);223224225/*226* aslstartup - entered from main()227*/228void229AslInitializeGlobals (230void);231232typedef233ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (234char *);235236ACPI_STATUS237AslDoOneFile (238char *Filename);239240ACPI_STATUS241AslCheckForErrorExit (242void);243244245/*246* aslcompile - compile mainline247*/248void249AslCompilerSignon (250UINT32 FileId);251252void253AslCompilerFileHeader (254UINT32 FileId);255256ACPI_STATUS257CmDoCompile (258void);259260int261CmDoAslMiddleAndBackEnd (262void);263264void265CmDoOutputFiles (266void);267268int269CmCleanupAndExit (270void);271272ACPI_STATUS273AslDoDisassembly (274void);275276277/*278* aslallocate - memory allocation279*/280void *281UtLocalCalloc (282UINT32 Size);283284void285UtExpandLineBuffers (286void);287288void289UtReallocLineBuffers (290char **Buffer,291UINT32 OldSize,292UINT32 NewSize);293294void295UtFreeLineBuffers (296void);297298299/*300* aslcache - local cache support301*/302char *303UtLocalCacheCalloc (304UINT32 Length);305306ACPI_PARSE_OBJECT *307UtParseOpCacheCalloc (308void);309310DT_SUBTABLE *311UtSubtableCacheCalloc (312void);313314DT_FIELD *315UtFieldCacheCalloc (316void);317318void319UtDeleteLocalCaches (320void);321322323/*324* aslascii - ascii support325*/326ACPI_STATUS327FlIsFileAsciiSource (328char *Filename,329BOOLEAN DisplayErrors);330331332/*333* aslwalks - semantic analysis and parse tree walks334*/335ACPI_STATUS336AnOtherSemanticAnalysisWalkBegin (337ACPI_PARSE_OBJECT *Op,338UINT32 Level,339void *Context);340341ACPI_STATUS342AnOtherSemanticAnalysisWalkEnd (343ACPI_PARSE_OBJECT *Op,344UINT32 Level,345void *Context);346347ACPI_STATUS348AnOperandTypecheckWalkEnd (349ACPI_PARSE_OBJECT *Op,350UINT32 Level,351void *Context);352353ACPI_STATUS354AnMethodTypingWalkEnd (355ACPI_PARSE_OBJECT *Op,356UINT32 Level,357void *Context);358359360/*361* aslmethod - Control method analysis walk362*/363ACPI_STATUS364MtMethodAnalysisWalkBegin (365ACPI_PARSE_OBJECT *Op,366UINT32 Level,367void *Context);368369ACPI_STATUS370MtMethodAnalysisWalkEnd (371ACPI_PARSE_OBJECT *Op,372UINT32 Level,373void *Context);374375UINT32376MtProcessTypeOp (377ACPI_PARSE_OBJECT *TypeOp);378379UINT8380MtProcessParameterTypeList (381ACPI_PARSE_OBJECT *ParamTypeOp,382UINT32 *TypeList);383384385/*386* aslbtypes - bitfield data types387*/388UINT32389AnMapObjTypeToBtype (390ACPI_PARSE_OBJECT *Op);391392UINT32393AnMapArgTypeToBtype (394UINT32 ArgType);395396UINT32397AnGetBtype (398ACPI_PARSE_OBJECT *Op);399400void401AnFormatBtype (402char *Buffer,403UINT32 Btype);404405406/*407* aslanalyze - Support functions for parse tree walks408*/409void410AnCheckId (411ACPI_PARSE_OBJECT *Op,412ACPI_NAME Type);413414/* Values for Type argument above */415416#define ASL_TYPE_HID 0417#define ASL_TYPE_CID 1418419BOOLEAN420AnIsInternalMethod (421ACPI_PARSE_OBJECT *Op);422423UINT32424AnGetInternalMethodReturnType (425ACPI_PARSE_OBJECT *Op);426427BOOLEAN428AnLastStatementIsReturn (429ACPI_PARSE_OBJECT *Op);430431void432AnCheckMethodReturnValue (433ACPI_PARSE_OBJECT *Op,434const ACPI_OPCODE_INFO *OpInfo,435ACPI_PARSE_OBJECT *ArgOp,436UINT32 RequiredBtypes,437UINT32 ThisNodeBtype);438439BOOLEAN440AnIsResultUsed (441ACPI_PARSE_OBJECT *Op);442443void444ApCheckForGpeNameConflict (445ACPI_PARSE_OBJECT *Op);446447void448ApCheckRegMethod (449ACPI_PARSE_OBJECT *Op);450451BOOLEAN452ApFindNameInScope (453char *Name,454ACPI_PARSE_OBJECT *Op);455456BOOLEAN457ApFindNameInDeviceTree (458char *Name,459ACPI_PARSE_OBJECT *Op);460461/*462* aslerror - error handling/reporting463*/464void465AslAbort (466void);467468void469AslDualParseOpError (470UINT8 Level,471UINT16 MainMessageId,472ACPI_PARSE_OBJECT *MainOp,473char *MainMessage,474UINT16 SecondMessageId,475ACPI_PARSE_OBJECT *SecondOp,476char *SecondaryMessage);477478void479AslError (480UINT8 Level,481UINT16 MessageId,482ACPI_PARSE_OBJECT *Op,483char *ExtraMessage);484485void486AslCheckExpectedExceptions (487void);488489ACPI_STATUS490AslLogExpectedException (491char *MessageIdString);492493ACPI_STATUS494AslElevateException (495char *MessageIdString);496497ACPI_STATUS498AslDisableException (499char *MessageIdString);500501BOOLEAN502AslIsExceptionIgnored (503char *Filename,504UINT32 LineNumber,505UINT8 Level,506UINT16 MessageId);507508void509AslLogExpectedExceptionByLine (510char *MessageIdString);511512void513AslCoreSubsystemError (514ACPI_PARSE_OBJECT *Op,515ACPI_STATUS Status,516char *ExtraMessage,517BOOLEAN Abort);518519int520AslCompilererror(521const char *s);522523void524AslCommonError (525UINT8 Level,526UINT16 MessageId,527UINT32 CurrentLineNumber,528UINT32 LogicalLineNumber,529UINT32 LogicalByteOffset,530UINT32 Column,531char *Filename,532char *ExtraMessage);533534void535AslCommonError2 (536UINT8 Level,537UINT16 MessageId,538UINT32 LineNumber,539UINT32 Column,540char *SourceLine,541char *Filename,542char *ExtraMessage);543544void545AePrintException (546UINT32 FileId,547ASL_ERROR_MSG *Enode,548char *Header);549550void551AePrintErrorLog (552UINT32 FileId);553554void555AeClearErrorLog (556void);557558559/*560* asllisting - generate all "listing" type files561*/562void563LsDoListings (564void);565566void567LsWriteNodeToAsmListing (568ACPI_PARSE_OBJECT *Op);569570void571LsWriteNode (572ACPI_PARSE_OBJECT *Op,573UINT32 FileId);574575void576LsDumpParseTree (577void);578579580/*581* asllistsup - Listing file support utilities582*/583void584LsDumpAscii (585UINT32 FileId,586UINT32 Count,587UINT8 *Buffer);588589void590LsDumpAsciiInComment (591UINT32 FileId,592UINT32 Count,593UINT8 *Buffer);594595void596LsCheckException (597UINT32 LineNumber,598UINT32 FileId);599600void601LsFlushListingBuffer (602UINT32 FileId);603604void605LsWriteListingHexBytes (606UINT8 *Buffer,607UINT32 Length,608UINT32 FileId);609610void611LsWriteSourceLines (612UINT32 ToLineNumber,613UINT32 ToLogicalLineNumber,614UINT32 FileId);615616UINT32617LsWriteOneSourceLine (618UINT32 FileId);619620void621LsPushNode (622char *Filename);623624ASL_LISTING_NODE *625LsPopNode (626void);627628629/*630* aslhex - generate all "hex" output files (C, ASM, ASL)631*/632void633HxDoHexOutput (634void);635636637/*638* aslfold - constant folding639*/640ACPI_STATUS641OpcAmlConstantWalk (642ACPI_PARSE_OBJECT *Op,643UINT32 Level,644void *Context);645646647/*648* aslmessages - exception strings649*/650const char *651AeDecodeMessageId (652UINT16 MessageId);653654const char *655AeDecodeExceptionLevel (656UINT8 Level);657658UINT16659AeBuildFullExceptionCode (660UINT8 Level,661UINT16 MessageId);662663/*664* asloffset - generate C offset file for BIOS support665*/666ACPI_STATUS667LsAmlOffsetWalk (668ACPI_PARSE_OBJECT *Op,669UINT32 Level,670void *Context);671672void673LsDoOffsetTableHeader (674UINT32 FileId);675676void677LsDoOffsetTableFooter (678UINT32 FileId);679680681/*682* aslopcodes - generate AML opcodes683*/684ACPI_STATUS685OpcAmlOpcodeWalk (686ACPI_PARSE_OBJECT *Op,687UINT32 Level,688void *Context);689690ACPI_STATUS691OpcAmlOpcodeUpdateWalk (692ACPI_PARSE_OBJECT *Op,693UINT32 Level,694void *Context);695696void697OpcGenerateAmlOpcode (698ACPI_PARSE_OBJECT *Op);699700UINT32701OpcSetOptimalIntegerSize (702ACPI_PARSE_OBJECT *Op);703704void705OpcGetIntegerWidth (706ACPI_PARSE_OBJECT *Op);707708709/*710* asloperands - generate AML operands for the AML opcodes711*/712ACPI_PARSE_OBJECT *713UtGetArg (714ACPI_PARSE_OBJECT *Op,715UINT32 Argn);716717void718OpnGenerateAmlOperands (719ACPI_PARSE_OBJECT *Op);720721void722OpnDoPackage (723ACPI_PARSE_OBJECT *Op);724725726/*727* aslopt - optimization728*/729void730OptOptimizeNamePath (731ACPI_PARSE_OBJECT *Op,732UINT32 Flags,733ACPI_WALK_STATE *WalkState,734char *AmlNameString,735ACPI_NAMESPACE_NODE *TargetNode);736737738/*739* aslpld - ToPLD macro support740*/741void742OpcDoPld (743ACPI_PARSE_OBJECT *Op);744745746/*747* aslprintf - Printf/Fprintf macros748*/749void750OpcDoPrintf (751ACPI_PARSE_OBJECT *Op);752753void754OpcDoFprintf (755ACPI_PARSE_OBJECT *Op);756757758/*759* aslprune - parse tree pruner760*/761void762AslPruneParseTree (763UINT32 PruneDepth,764UINT32 Type);765766767/*768* aslcodegen - code generation769*/770void771CgGenerateAmlOutput (772void);773774void775CgLocalWriteAmlData (776ACPI_PARSE_OBJECT *Op,777void *Buffer,778UINT32 Length);779780781/*782* aslfile783*/784void785FlOpenFile (786UINT32 FileId,787char *Filename,788char *Mode);789790791/*792* asllength - calculate/adjust AML package lengths793*/794ACPI_STATUS795LnPackageLengthWalk (796ACPI_PARSE_OBJECT *Op,797UINT32 Level,798void *Context);799800ACPI_STATUS801LnInitLengthsWalk (802ACPI_PARSE_OBJECT *Op,803UINT32 Level,804void *Context);805806void807CgGenerateAmlLengths (808ACPI_PARSE_OBJECT *Op);809810811/*812* aslmap - opcode mappings and reserved method names813*/814ACPI_OBJECT_TYPE815AslMapNamedOpcodeToDataType (816UINT16 Opcode);817818819/*820* aslpredef - ACPI predefined names support821*/822BOOLEAN823ApCheckForPredefinedMethod (824ACPI_PARSE_OBJECT *Op,825ASL_METHOD_INFO *MethodInfo);826827void828ApCheckPredefinedReturnValue (829ACPI_PARSE_OBJECT *Op,830ASL_METHOD_INFO *MethodInfo);831832UINT32833ApCheckForPredefinedName (834ACPI_PARSE_OBJECT *Op,835char *Name);836837void838ApCheckForPredefinedObject (839ACPI_PARSE_OBJECT *Op,840char *Name);841842ACPI_STATUS843ApCheckObjectType (844const char *PredefinedName,845ACPI_PARSE_OBJECT *Op,846UINT32 ExpectedBtypes,847UINT32 PackageIndex);848849void850ApDisplayReservedNames (851void);852853854/*855* aslprepkg - ACPI predefined names support for packages856*/857void858ApCheckPackage (859ACPI_PARSE_OBJECT *ParentOp,860const ACPI_PREDEFINED_INFO *Predefined);861862863/*864* asltransform - parse tree transformations865*/866ACPI_STATUS867TrAmlTransformWalkBegin (868ACPI_PARSE_OBJECT *Op,869UINT32 Level,870void *Context);871872ACPI_STATUS873TrAmlTransformWalkEnd (874ACPI_PARSE_OBJECT *Op,875UINT32 Level,876void *Context);877878879/*880* aslexternal - External opcode support881*/882ACPI_STATUS883ExAmlExternalWalkBegin (884ACPI_PARSE_OBJECT *Op,885UINT32 Level,886void *Context);887888ACPI_STATUS889ExAmlExternalWalkEnd (890ACPI_PARSE_OBJECT *Op,891UINT32 Level,892void *Context);893894void895ExDoExternal (896ACPI_PARSE_OBJECT *Op);897898/* Values for "Visitation" parameter above */899900#define ASL_WALK_VISIT_DOWNWARD 0x01901#define ASL_WALK_VISIT_UPWARD 0x02902#define ASL_WALK_VISIT_DB_SEPARATELY 0x04903#define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)904905906/*907* aslparseop.c - Parse op create/allocate/cache908*/909ACPI_PARSE_OBJECT *910TrCreateOp (911UINT32 ParseOpcode,912UINT32 NumChildren,913...);914915ACPI_PARSE_OBJECT *916TrCreateLeafOp (917UINT32 ParseOpcode);918919ACPI_PARSE_OBJECT *920TrCreateNullTargetOp (921void);922923ACPI_PARSE_OBJECT *924TrCreateAssignmentOp (925ACPI_PARSE_OBJECT *Target,926ACPI_PARSE_OBJECT *Source);927928ACPI_PARSE_OBJECT *929TrCreateTargetOp (930ACPI_PARSE_OBJECT *OriginalOp,931ACPI_PARSE_OBJECT *ParentOp);932933ACPI_PARSE_OBJECT *934TrCreateValuedLeafOp (935UINT32 ParseOpcode,936UINT64 Value);937938ACPI_PARSE_OBJECT *939TrCreateConstantLeafOp (940UINT32 ParseOpcode);941942ACPI_PARSE_OBJECT *943TrAllocateOp (944UINT32 ParseOpcode);945946void947TrPrintOpFlags (948UINT32 Flags,949UINT32 OutputLevel);950951952/*953* asltree.c - Parse tree management954*/955void956TrSetOpParent (957ACPI_PARSE_OBJECT *Op,958ACPI_PARSE_OBJECT *ParentOp);959960ACPI_PARSE_OBJECT *961TrSetOpIntegerValue (962UINT32 ParseOpcode,963ACPI_PARSE_OBJECT *Op);964965void966TrSetOpEndLineNumber (967ACPI_PARSE_OBJECT *Op);968969void970TrSetOpCurrentFilename (971ACPI_PARSE_OBJECT *Op);972973void974TrSetOpIntegerWidth (975ACPI_PARSE_OBJECT *TableSignature,976ACPI_PARSE_OBJECT *Revision);977978ACPI_PARSE_OBJECT *979TrLinkOpChildren (980ACPI_PARSE_OBJECT *Op,981UINT32 NumChildren,982...);983984ACPI_PARSE_OBJECT *985TrLinkPeerOp (986ACPI_PARSE_OBJECT *Op1,987ACPI_PARSE_OBJECT *Op2);988989ACPI_PARSE_OBJECT *990TrLinkChildOp (991ACPI_PARSE_OBJECT *Op1,992ACPI_PARSE_OBJECT *Op2);993994ACPI_PARSE_OBJECT *995TrSetOpFlags (996ACPI_PARSE_OBJECT *Op,997UINT32 Flags);998999ACPI_PARSE_OBJECT *1000TrSetOpAmlLength (1001ACPI_PARSE_OBJECT *Op,1002UINT32 Length);10031004ACPI_PARSE_OBJECT *1005TrLinkPeerOps (1006UINT32 NumPeers,1007...);10081009ACPI_STATUS1010TrWalkParseTree (1011ACPI_PARSE_OBJECT *Op,1012UINT32 Visitation,1013ASL_WALK_CALLBACK DescendingCallback,1014ASL_WALK_CALLBACK AscendingCallback,1015void *Context);101610171018/*1019* aslfiles - File I/O support1020*/1021void1022FlAddIncludeDirectory (1023char *Dir);10241025char *1026FlMergePathnames (1027char *PrefixDir,1028char *FilePathname);10291030void1031FlOpenIncludeFile (1032ACPI_PARSE_OBJECT *Op);10331034void1035FlFileError (1036UINT32 FileId,1037UINT8 ErrorId);10381039UINT321040FlGetFileSize (1041UINT32 FileId);10421043ACPI_STATUS1044FlReadFile (1045UINT32 FileId,1046void *Buffer,1047UINT32 Length);10481049void1050FlWriteFile (1051UINT32 FileId,1052void *Buffer,1053UINT32 Length);10541055void1056FlSeekFile (1057UINT32 FileId,1058long Offset);10591060void1061FlSeekFileSet (1062UINT32 FileId,1063long Offset);10641065void1066FlCloseFile (1067UINT32 FileId);10681069ACPI_PRINTF_LIKE (2)1070void1071FlPrintFile (1072UINT32 FileId,1073char *Format,1074...);10751076void1077FlDeleteFile (1078UINT32 FileId);10791080void1081FlSetLineNumber (1082UINT32 LineNumber);10831084void1085FlSetFilename (1086char *Filename);10871088ACPI_STATUS1089FlOpenInputFile (1090char *InputFilename);10911092ACPI_STATUS1093FlOpenAmlOutputFile (1094char *InputFilename);10951096ACPI_STATUS1097FlOpenMiscOutputFiles (1098char *InputFilename);10991100ACPI_STATUS1101FlInitOneFile (1102char *InputFilename);11031104ASL_FILE_SWITCH_STATUS1105FlSwitchFileSet (1106char *InputFilename);11071108FILE *1109FlGetFileHandle (1110UINT32 OutFileId,1111UINT32 InFileId,1112char *Filename);11131114ASL_GLOBAL_FILE_NODE *1115FlGetFileNode (1116UINT32 FileId,1117char *Filename);11181119ASL_GLOBAL_FILE_NODE *1120FlGetCurrentFileNode (1121void);112211231124/*1125* aslhwmap - hardware map summary1126*/1127void1128MpEmitMappingInfo (1129void);113011311132/*1133* asload - load namespace in prep for cross reference1134*/1135ACPI_STATUS1136LdLoadNamespace (1137ACPI_PARSE_OBJECT *RootOp);11381139/*1140* asllookup - namespace lookup functions1141*/1142void1143LkFindUnreferencedObjects (1144void);114511461147/*1148* aslhelp - help screens1149*/1150void1151Usage (1152void);11531154void1155AslFilenameHelp (1156void);11571158void1159AslDisassemblyHelp (1160void);116111621163/*1164* aslnamesp - namespace output file generation1165*/1166ACPI_STATUS1167NsDisplayNamespace (1168void);11691170void1171NsSetupNamespaceListing (1172void *Handle);117311741175/*1176* asloptions - command line processing1177*/1178int1179AslCommandLine (1180int argc,1181char **argv);118211831184/*1185* aslxref - namespace cross reference1186*/1187ACPI_STATUS1188XfCrossReferenceNamespace (1189void);119011911192/*1193* aslxrefout1194*/1195void1196OtPrintHeaders (1197char *Message);11981199void1200OtCreateXrefFile (1201void);12021203void1204OtXrefWalkPart1 (1205ACPI_PARSE_OBJECT *Op,1206UINT32 Level,1207ASL_METHOD_INFO *MethodInfo);120812091210/*1211* aslutils - common compiler utilities1212*/1213ACPI_PRINTF_LIKE(2)1214void1215DbgPrint (1216UINT32 Type,1217char *Format,1218...);12191220/* Type values for above */12211222#define ASL_DEBUG_OUTPUT 01223#define ASL_PARSE_OUTPUT 11224#define ASL_TREE_OUTPUT 212251226BOOLEAN1227UtIsIdInteger (1228UINT8 *Target);12291230UINT81231UtIsBigEndianMachine (1232void);12331234BOOLEAN1235UtQueryForOverwrite (1236char *Pathname);12371238void1239UtDumpStringOp (1240ACPI_PARSE_OBJECT *Op,1241UINT32 Level);12421243void1244UtDumpIntegerOp (1245ACPI_PARSE_OBJECT *Op,1246UINT32 Level,1247UINT32 IntegerLength);12481249void1250UtDumpBasicOp (1251ACPI_PARSE_OBJECT *Op,1252UINT32 Level);12531254ACPI_NAMESPACE_NODE *1255UtGetParentMethodNode (1256ACPI_NAMESPACE_NODE *Node);12571258ACPI_PARSE_OBJECT *1259UtGetParentMethodOp (1260ACPI_PARSE_OBJECT *Op);12611262BOOLEAN1263UtNodeIsDescendantOf (1264ACPI_NAMESPACE_NODE *Node1,1265ACPI_NAMESPACE_NODE *Node2);12661267void1268UtDisplaySupportedTables (1269void);12701271void1272UtDisplayConstantOpcodes (1273void);12741275UINT81276UtBeginEvent (1277char *Name);12781279void1280UtEndEvent (1281UINT8 Event);12821283void1284UtDisplaySummary (1285UINT32 FileId);12861287void1288UtDisplayOneSummary (1289UINT32 FileId,1290BOOLEAN DisplayErrorSummary);12911292void1293UtConvertByteToHex (1294UINT8 RawByte,1295UINT8 *Buffer);12961297void1298UtConvertByteToAsmHex (1299UINT8 RawByte,1300UINT8 *Buffer);13011302char *1303UtGetOpName (1304UINT32 ParseOpcode);13051306void1307UtSetParseOpName (1308ACPI_PARSE_OBJECT *Op);13091310ACPI_STATUS1311UtInternalizeName (1312char *ExternalName,1313char **ConvertedName);13141315BOOLEAN1316UtNameContainsAllPrefix (1317ACPI_PARSE_OBJECT *Op);13181319void1320UtAttachNamepathToOwner (1321ACPI_PARSE_OBJECT *Op,1322ACPI_PARSE_OBJECT *NameNode);13231324ACPI_PARSE_OBJECT *1325UtCheckIntegerRange (1326ACPI_PARSE_OBJECT *Op,1327UINT32 LowValue,1328UINT32 HighValue);13291330UINT641331UtDoConstant (1332char *String);13331334char *1335AcpiUtStrdup (1336char *String);13371338char *1339AcpiUtStrcat (1340char *String1,1341char *String2);134213431344/*1345* asluuid - UUID support1346*/1347ACPI_STATUS1348AuValidateUuid (1349char *InString);13501351ACPI_STATUS1352AuConvertUuidToString (1353char *UuIdBuffer,1354char *OutString);135513561357/*1358* aslresource - Resource template generation utilities1359*/1360void1361RsSmallAddressCheck (1362UINT8 Type,1363UINT32 Minimum,1364UINT32 Maximum,1365UINT32 Length,1366UINT32 Alignment,1367ACPI_PARSE_OBJECT *MinOp,1368ACPI_PARSE_OBJECT *MaxOp,1369ACPI_PARSE_OBJECT *LengthOp,1370ACPI_PARSE_OBJECT *AlignOp,1371ACPI_PARSE_OBJECT *Op);13721373void1374RsLargeAddressCheck (1375UINT64 Minimum,1376UINT64 Maximum,1377UINT64 Length,1378UINT64 Granularity,1379UINT8 Flags,1380ACPI_PARSE_OBJECT *MinOp,1381ACPI_PARSE_OBJECT *MaxOp,1382ACPI_PARSE_OBJECT *LengthOp,1383ACPI_PARSE_OBJECT *GranOp,1384ACPI_PARSE_OBJECT *Op);13851386UINT161387RsGetStringDataLength (1388ACPI_PARSE_OBJECT *InitializerOp);13891390ASL_RESOURCE_NODE *1391RsAllocateResourceNode (1392UINT32 Size);13931394void1395RsCreateResourceField (1396ACPI_PARSE_OBJECT *Op,1397char *Name,1398UINT32 ByteOffset,1399UINT32 BitOffset,1400UINT32 BitLength);14011402void1403RsSetFlagBits (1404UINT8 *Flags,1405ACPI_PARSE_OBJECT *Op,1406UINT8 Position,1407UINT8 DefaultBit);14081409void1410RsSetFlagBits16 (1411UINT16 *Flags,1412ACPI_PARSE_OBJECT *Op,1413UINT8 Position,1414UINT8 DefaultBit);14151416ACPI_PARSE_OBJECT *1417RsCompleteNodeAndGetNext (1418ACPI_PARSE_OBJECT *Op);14191420void1421RsCheckListForDuplicates (1422ACPI_PARSE_OBJECT *Op);14231424ASL_RESOURCE_NODE *1425RsDoOneResourceDescriptor (1426ASL_RESOURCE_INFO *Info,1427UINT8 *State);14281429/* Values for State above */14301431#define ACPI_RSTATE_NORMAL 01432#define ACPI_RSTATE_START_DEPENDENT 11433#define ACPI_RSTATE_DEPENDENT_LIST 214341435UINT321436RsLinkDescriptorChain (1437ASL_RESOURCE_NODE **PreviousRnode,1438ASL_RESOURCE_NODE *Rnode);14391440void1441RsDoResourceTemplate (1442ACPI_PARSE_OBJECT *Op);144314441445/*1446* aslrestype1 - Miscellaneous Small descriptors1447*/1448ASL_RESOURCE_NODE *1449RsDoEndTagDescriptor (1450ASL_RESOURCE_INFO *Info);14511452ASL_RESOURCE_NODE *1453RsDoEndDependentDescriptor (1454ASL_RESOURCE_INFO *Info);14551456ASL_RESOURCE_NODE *1457RsDoMemory24Descriptor (1458ASL_RESOURCE_INFO *Info);14591460ASL_RESOURCE_NODE *1461RsDoMemory32Descriptor (1462ASL_RESOURCE_INFO *Info);14631464ASL_RESOURCE_NODE *1465RsDoMemory32FixedDescriptor (1466ASL_RESOURCE_INFO *Info);14671468ASL_RESOURCE_NODE *1469RsDoStartDependentDescriptor (1470ASL_RESOURCE_INFO *Info);14711472ASL_RESOURCE_NODE *1473RsDoStartDependentNoPriDescriptor (1474ASL_RESOURCE_INFO *Info);14751476ASL_RESOURCE_NODE *1477RsDoVendorSmallDescriptor (1478ASL_RESOURCE_INFO *Info);147914801481/*1482* aslrestype1i - I/O-related Small descriptors1483*/1484ASL_RESOURCE_NODE *1485RsDoDmaDescriptor (1486ASL_RESOURCE_INFO *Info);14871488ASL_RESOURCE_NODE *1489RsDoFixedDmaDescriptor (1490ASL_RESOURCE_INFO *Info);14911492ASL_RESOURCE_NODE *1493RsDoFixedIoDescriptor (1494ASL_RESOURCE_INFO *Info);14951496ASL_RESOURCE_NODE *1497RsDoIoDescriptor (1498ASL_RESOURCE_INFO *Info);14991500ASL_RESOURCE_NODE *1501RsDoIrqDescriptor (1502ASL_RESOURCE_INFO *Info);15031504ASL_RESOURCE_NODE *1505RsDoIrqNoFlagsDescriptor (1506ASL_RESOURCE_INFO *Info);150715081509/*1510* aslrestype2 - Large resource descriptors1511*/1512ASL_RESOURCE_NODE *1513RsDoInterruptDescriptor (1514ASL_RESOURCE_INFO *Info);15151516ASL_RESOURCE_NODE *1517RsDoVendorLargeDescriptor (1518ASL_RESOURCE_INFO *Info);15191520ASL_RESOURCE_NODE *1521RsDoGeneralRegisterDescriptor (1522ASL_RESOURCE_INFO *Info);15231524ASL_RESOURCE_NODE *1525RsDoGpioIntDescriptor (1526ASL_RESOURCE_INFO *Info);15271528ASL_RESOURCE_NODE *1529RsDoGpioIoDescriptor (1530ASL_RESOURCE_INFO *Info);15311532ASL_RESOURCE_NODE *1533RsDoI2cSerialBusDescriptor (1534ASL_RESOURCE_INFO *Info);15351536ASL_RESOURCE_NODE *1537RsDoSpiSerialBusDescriptor (1538ASL_RESOURCE_INFO *Info);15391540ASL_RESOURCE_NODE *1541RsDoUartSerialBusDescriptor (1542ASL_RESOURCE_INFO *Info);15431544ASL_RESOURCE_NODE *1545RsDoCsi2SerialBusDescriptor (1546ASL_RESOURCE_INFO *Info);15471548ASL_RESOURCE_NODE *1549RsDoPinFunctionDescriptor (1550ASL_RESOURCE_INFO *Info);15511552ASL_RESOURCE_NODE *1553RsDoPinConfigDescriptor (1554ASL_RESOURCE_INFO *Info);15551556ASL_RESOURCE_NODE *1557RsDoPinGroupDescriptor (1558ASL_RESOURCE_INFO *Info);15591560ASL_RESOURCE_NODE *1561RsDoPinGroupFunctionDescriptor (1562ASL_RESOURCE_INFO *Info);15631564ASL_RESOURCE_NODE *1565RsDoPinGroupConfigDescriptor (1566ASL_RESOURCE_INFO *Info);15671568ASL_RESOURCE_NODE *1569RsDoClockInputDescriptor (1570ASL_RESOURCE_INFO *Info);15711572/*1573* aslrestype2d - DWord address descriptors1574*/1575ASL_RESOURCE_NODE *1576RsDoDwordIoDescriptor (1577ASL_RESOURCE_INFO *Info);15781579ASL_RESOURCE_NODE *1580RsDoDwordMemoryDescriptor (1581ASL_RESOURCE_INFO *Info);15821583ASL_RESOURCE_NODE *1584RsDoDwordPccDescriptor (1585ASL_RESOURCE_INFO *Info);15861587ASL_RESOURCE_NODE *1588RsDoDwordSpaceDescriptor (1589ASL_RESOURCE_INFO *Info);15901591/*1592* aslrestype2e - Extended address descriptors1593*/1594ASL_RESOURCE_NODE *1595RsDoExtendedIoDescriptor (1596ASL_RESOURCE_INFO *Info);15971598ASL_RESOURCE_NODE *1599RsDoExtendedMemoryDescriptor (1600ASL_RESOURCE_INFO *Info);16011602ASL_RESOURCE_NODE *1603RsDoExtendedSpaceDescriptor (1604ASL_RESOURCE_INFO *Info);160516061607/*1608* aslrestype2q - QWord address descriptors1609*/1610ASL_RESOURCE_NODE *1611RsDoQwordIoDescriptor (1612ASL_RESOURCE_INFO *Info);16131614ASL_RESOURCE_NODE *1615RsDoQwordMemoryDescriptor (1616ASL_RESOURCE_INFO *Info);16171618ASL_RESOURCE_NODE *1619RsDoQwordPccDescriptor (1620ASL_RESOURCE_INFO *Info);16211622ASL_RESOURCE_NODE *1623RsDoQwordSpaceDescriptor (1624ASL_RESOURCE_INFO *Info);162516261627/*1628* aslrestype2w - Word address descriptors1629*/1630ASL_RESOURCE_NODE *1631RsDoWordIoDescriptor (1632ASL_RESOURCE_INFO *Info);16331634ASL_RESOURCE_NODE *1635RsDoWordPccDescriptor (1636ASL_RESOURCE_INFO *Info);16371638ASL_RESOURCE_NODE *1639RsDoWordSpaceDescriptor (1640ASL_RESOURCE_INFO *Info);16411642ASL_RESOURCE_NODE *1643RsDoWordBusNumberDescriptor (1644ASL_RESOURCE_INFO *Info);164516461647/*1648* Entry to data table compiler subsystem1649*/1650ACPI_STATUS1651DtDoCompile(1652void);16531654ACPI_STATUS1655DtCreateTemplates (1656char **argv);165716581659/*1660* ASL/ASL+ converter debug1661*/1662ACPI_PRINTF_LIKE (1)1663void1664CvDbgPrint (1665char *Fmt,1666...);166716681669#endif /* __ASLCOMPILER_H */167016711672