Path: blob/main/sys/contrib/dev/acpica/include/acdispat.h
48286 views
/******************************************************************************1*2* Name: acdispat.h - dispatcher (parser to interpreter interface)3*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 _ACDISPAT_H_152#define _ACDISPAT_H_153154155#define NAMEOF_LOCAL_NTE "__L0"156#define NAMEOF_ARG_NTE "__A0"157158159/*160* dsargs - execution of dynamic arguments for static objects161*/162ACPI_STATUS163AcpiDsGetBufferFieldArguments (164ACPI_OPERAND_OBJECT *ObjDesc);165166ACPI_STATUS167AcpiDsGetBankFieldArguments (168ACPI_OPERAND_OBJECT *ObjDesc);169170ACPI_STATUS171AcpiDsGetRegionArguments (172ACPI_OPERAND_OBJECT *RgnDesc);173174ACPI_STATUS175AcpiDsGetBufferArguments (176ACPI_OPERAND_OBJECT *ObjDesc);177178ACPI_STATUS179AcpiDsGetPackageArguments (180ACPI_OPERAND_OBJECT *ObjDesc);181182183/*184* dscontrol - support for execution control opcodes185*/186ACPI_STATUS187AcpiDsExecBeginControlOp (188ACPI_WALK_STATE *WalkState,189ACPI_PARSE_OBJECT *Op);190191ACPI_STATUS192AcpiDsExecEndControlOp (193ACPI_WALK_STATE *WalkState,194ACPI_PARSE_OBJECT *Op);195196197/*198* dsopcode - support for late operand evaluation199*/200ACPI_STATUS201AcpiDsEvalBufferFieldOperands (202ACPI_WALK_STATE *WalkState,203ACPI_PARSE_OBJECT *Op);204205ACPI_STATUS206AcpiDsEvalRegionOperands (207ACPI_WALK_STATE *WalkState,208ACPI_PARSE_OBJECT *Op);209210ACPI_STATUS211AcpiDsEvalTableRegionOperands (212ACPI_WALK_STATE *WalkState,213ACPI_PARSE_OBJECT *Op);214215ACPI_STATUS216AcpiDsEvalDataObjectOperands (217ACPI_WALK_STATE *WalkState,218ACPI_PARSE_OBJECT *Op,219ACPI_OPERAND_OBJECT *ObjDesc);220221ACPI_STATUS222AcpiDsEvalBankFieldOperands (223ACPI_WALK_STATE *WalkState,224ACPI_PARSE_OBJECT *Op);225226ACPI_STATUS227AcpiDsInitializeRegion (228ACPI_HANDLE ObjHandle);229230231/*232* dsexec - Parser/Interpreter interface, method execution callbacks233*/234ACPI_STATUS235AcpiDsGetPredicateValue (236ACPI_WALK_STATE *WalkState,237ACPI_OPERAND_OBJECT *ResultObj);238239ACPI_STATUS240AcpiDsExecBeginOp (241ACPI_WALK_STATE *WalkState,242ACPI_PARSE_OBJECT **OutOp);243244ACPI_STATUS245AcpiDsExecEndOp (246ACPI_WALK_STATE *State);247248249/*250* dsfield - Parser/Interpreter interface for AML fields251*/252ACPI_STATUS253AcpiDsCreateField (254ACPI_PARSE_OBJECT *Op,255ACPI_NAMESPACE_NODE *RegionNode,256ACPI_WALK_STATE *WalkState);257258ACPI_STATUS259AcpiDsCreateBankField (260ACPI_PARSE_OBJECT *Op,261ACPI_NAMESPACE_NODE *RegionNode,262ACPI_WALK_STATE *WalkState);263264ACPI_STATUS265AcpiDsCreateIndexField (266ACPI_PARSE_OBJECT *Op,267ACPI_NAMESPACE_NODE *RegionNode,268ACPI_WALK_STATE *WalkState);269270ACPI_STATUS271AcpiDsCreateBufferField (272ACPI_PARSE_OBJECT *Op,273ACPI_WALK_STATE *WalkState);274275ACPI_STATUS276AcpiDsInitFieldObjects (277ACPI_PARSE_OBJECT *Op,278ACPI_WALK_STATE *WalkState);279280281/*282* dsload - Parser/Interpreter interface283*/284ACPI_STATUS285AcpiDsInitCallbacks (286ACPI_WALK_STATE *WalkState,287UINT32 PassNumber);288289/* dsload - pass 1 namespace load callbacks */290291ACPI_STATUS292AcpiDsLoad1BeginOp (293ACPI_WALK_STATE *WalkState,294ACPI_PARSE_OBJECT **OutOp);295296ACPI_STATUS297AcpiDsLoad1EndOp (298ACPI_WALK_STATE *WalkState);299300301/* dsload - pass 2 namespace load callbacks */302303ACPI_STATUS304AcpiDsLoad2BeginOp (305ACPI_WALK_STATE *WalkState,306ACPI_PARSE_OBJECT **OutOp);307308ACPI_STATUS309AcpiDsLoad2EndOp (310ACPI_WALK_STATE *WalkState);311312313/*314* dsmthdat - method data (locals/args)315*/316ACPI_STATUS317AcpiDsStoreObjectToLocal (318UINT8 Type,319UINT32 Index,320ACPI_OPERAND_OBJECT *SrcDesc,321ACPI_WALK_STATE *WalkState);322323ACPI_STATUS324AcpiDsMethodDataGetEntry (325UINT16 Opcode,326UINT32 Index,327ACPI_WALK_STATE *WalkState,328ACPI_OPERAND_OBJECT ***Node);329330void331AcpiDsMethodDataDeleteAll (332ACPI_WALK_STATE *WalkState);333334BOOLEAN335AcpiDsIsMethodValue (336ACPI_OPERAND_OBJECT *ObjDesc);337338ACPI_STATUS339AcpiDsMethodDataGetValue (340UINT8 Type,341UINT32 Index,342ACPI_WALK_STATE *WalkState,343ACPI_OPERAND_OBJECT **DestDesc);344345ACPI_STATUS346AcpiDsMethodDataInitArgs (347ACPI_OPERAND_OBJECT **Params,348UINT32 MaxParamCount,349ACPI_WALK_STATE *WalkState);350351ACPI_STATUS352AcpiDsMethodDataGetNode (353UINT8 Type,354UINT32 Index,355ACPI_WALK_STATE *WalkState,356ACPI_NAMESPACE_NODE **Node);357358void359AcpiDsMethodDataInit (360ACPI_WALK_STATE *WalkState);361362363/*364* dsmethod - Parser/Interpreter interface - control method parsing365*/366ACPI_STATUS367AcpiDsAutoSerializeMethod (368ACPI_NAMESPACE_NODE *Node,369ACPI_OPERAND_OBJECT *ObjDesc);370371ACPI_STATUS372AcpiDsCallControlMethod (373ACPI_THREAD_STATE *Thread,374ACPI_WALK_STATE *WalkState,375ACPI_PARSE_OBJECT *Op);376377ACPI_STATUS378AcpiDsRestartControlMethod (379ACPI_WALK_STATE *WalkState,380ACPI_OPERAND_OBJECT *ReturnDesc);381382void383AcpiDsTerminateControlMethod (384ACPI_OPERAND_OBJECT *MethodDesc,385ACPI_WALK_STATE *WalkState);386387ACPI_STATUS388AcpiDsBeginMethodExecution (389ACPI_NAMESPACE_NODE *MethodNode,390ACPI_OPERAND_OBJECT *ObjDesc,391ACPI_WALK_STATE *WalkState);392393ACPI_STATUS394AcpiDsMethodError (395ACPI_STATUS Status,396ACPI_WALK_STATE *WalkState);397398/*399* dsinit400*/401ACPI_STATUS402AcpiDsInitializeObjects (403UINT32 TableIndex,404ACPI_NAMESPACE_NODE *StartNode);405406407/*408* dsobject - Parser/Interpreter interface - object initialization and conversion409*/410ACPI_STATUS411AcpiDsBuildInternalObject (412ACPI_WALK_STATE *WalkState,413ACPI_PARSE_OBJECT *Op,414ACPI_OPERAND_OBJECT **ObjDescPtr);415416ACPI_STATUS417AcpiDsBuildInternalBufferObj (418ACPI_WALK_STATE *WalkState,419ACPI_PARSE_OBJECT *Op,420UINT32 BufferLength,421ACPI_OPERAND_OBJECT **ObjDescPtr);422423ACPI_STATUS424AcpiDsBuildInternalPackageObj (425ACPI_WALK_STATE *WalkState,426ACPI_PARSE_OBJECT *op,427UINT32 PackageLength,428ACPI_OPERAND_OBJECT **ObjDesc);429430ACPI_STATUS431AcpiDsInitObjectFromOp (432ACPI_WALK_STATE *WalkState,433ACPI_PARSE_OBJECT *Op,434UINT16 Opcode,435ACPI_OPERAND_OBJECT **ObjDesc);436437ACPI_STATUS438AcpiDsCreateNode (439ACPI_WALK_STATE *WalkState,440ACPI_NAMESPACE_NODE *Node,441ACPI_PARSE_OBJECT *Op);442443444/*445* dspkginit - Package object initialization446*/447ACPI_STATUS448AcpiDsInitPackageElement (449UINT8 ObjectType,450ACPI_OPERAND_OBJECT *SourceObject,451ACPI_GENERIC_STATE *State,452void *Context);453454455/*456* dsutils - Parser/Interpreter interface utility routines457*/458void459AcpiDsClearImplicitReturn (460ACPI_WALK_STATE *WalkState);461462BOOLEAN463AcpiDsDoImplicitReturn (464ACPI_OPERAND_OBJECT *ReturnDesc,465ACPI_WALK_STATE *WalkState,466BOOLEAN AddReference);467468BOOLEAN469AcpiDsIsResultUsed (470ACPI_PARSE_OBJECT *Op,471ACPI_WALK_STATE *WalkState);472473void474AcpiDsDeleteResultIfNotUsed (475ACPI_PARSE_OBJECT *Op,476ACPI_OPERAND_OBJECT *ResultObj,477ACPI_WALK_STATE *WalkState);478479ACPI_STATUS480AcpiDsCreateOperand (481ACPI_WALK_STATE *WalkState,482ACPI_PARSE_OBJECT *Arg,483UINT32 ArgsRemaining);484485ACPI_STATUS486AcpiDsCreateOperands (487ACPI_WALK_STATE *WalkState,488ACPI_PARSE_OBJECT *FirstArg);489490ACPI_STATUS491AcpiDsResolveOperands (492ACPI_WALK_STATE *WalkState);493494void495AcpiDsClearOperands (496ACPI_WALK_STATE *WalkState);497498ACPI_STATUS499AcpiDsEvaluateNamePath (500ACPI_WALK_STATE *WalkState);501502503/*504* dswscope - Scope Stack manipulation505*/506ACPI_STATUS507AcpiDsScopeStackPush (508ACPI_NAMESPACE_NODE *Node,509ACPI_OBJECT_TYPE Type,510ACPI_WALK_STATE *WalkState);511512513ACPI_STATUS514AcpiDsScopeStackPop (515ACPI_WALK_STATE *WalkState);516517void518AcpiDsScopeStackClear (519ACPI_WALK_STATE *WalkState);520521522/*523* dswstate - parser WALK_STATE management routines524*/525ACPI_STATUS526AcpiDsObjStackPush (527void *Object,528ACPI_WALK_STATE *WalkState);529530ACPI_STATUS531AcpiDsObjStackPop (532UINT32 PopCount,533ACPI_WALK_STATE *WalkState);534535ACPI_WALK_STATE *536AcpiDsCreateWalkState (537ACPI_OWNER_ID OwnerId,538ACPI_PARSE_OBJECT *Origin,539ACPI_OPERAND_OBJECT *MthDesc,540ACPI_THREAD_STATE *Thread);541542ACPI_STATUS543AcpiDsInitAmlWalk (544ACPI_WALK_STATE *WalkState,545ACPI_PARSE_OBJECT *Op,546ACPI_NAMESPACE_NODE *MethodNode,547UINT8 *AmlStart,548UINT32 AmlLength,549ACPI_EVALUATE_INFO *Info,550UINT8 PassNumber);551552void553AcpiDsObjStackPopAndDelete (554UINT32 PopCount,555ACPI_WALK_STATE *WalkState);556557void558AcpiDsDeleteWalkState (559ACPI_WALK_STATE *WalkState);560561ACPI_WALK_STATE *562AcpiDsPopWalkState (563ACPI_THREAD_STATE *Thread);564565void566AcpiDsPushWalkState (567ACPI_WALK_STATE *WalkState,568ACPI_THREAD_STATE *Thread);569570ACPI_STATUS571AcpiDsResultStackClear (572ACPI_WALK_STATE *WalkState);573574ACPI_WALK_STATE *575AcpiDsGetCurrentWalkState (576ACPI_THREAD_STATE *Thread);577578ACPI_STATUS579AcpiDsResultPop (580ACPI_OPERAND_OBJECT **Object,581ACPI_WALK_STATE *WalkState);582583ACPI_STATUS584AcpiDsResultPush (585ACPI_OPERAND_OBJECT *Object,586ACPI_WALK_STATE *WalkState);587588589/*590* dsdebug - parser debugging routines591*/592void593AcpiDsDumpMethodStack (594ACPI_STATUS Status,595ACPI_WALK_STATE *WalkState,596ACPI_PARSE_OBJECT *Op);597598#endif /* _ACDISPAT_H_ */599600601