1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
48 #define NAMEOF_LOCAL_NTE "__L0"
49 #define NAMEOF_ARG_NTE "__A0"
53 * dsargs - execution of dynamic arguments for static objects
56 AcpiDsGetBufferFieldArguments (
57 ACPI_OPERAND_OBJECT
*ObjDesc
);
60 AcpiDsGetBankFieldArguments (
61 ACPI_OPERAND_OBJECT
*ObjDesc
);
64 AcpiDsGetRegionArguments (
65 ACPI_OPERAND_OBJECT
*RgnDesc
);
68 AcpiDsGetBufferArguments (
69 ACPI_OPERAND_OBJECT
*ObjDesc
);
72 AcpiDsGetPackageArguments (
73 ACPI_OPERAND_OBJECT
*ObjDesc
);
77 * dscontrol - support for execution control opcodes
80 AcpiDsExecBeginControlOp (
81 ACPI_WALK_STATE
*WalkState
,
82 ACPI_PARSE_OBJECT
*Op
);
85 AcpiDsExecEndControlOp (
86 ACPI_WALK_STATE
*WalkState
,
87 ACPI_PARSE_OBJECT
*Op
);
91 * dsopcode - support for late operand evaluation
94 AcpiDsEvalBufferFieldOperands (
95 ACPI_WALK_STATE
*WalkState
,
96 ACPI_PARSE_OBJECT
*Op
);
99 AcpiDsEvalRegionOperands (
100 ACPI_WALK_STATE
*WalkState
,
101 ACPI_PARSE_OBJECT
*Op
);
104 AcpiDsEvalTableRegionOperands (
105 ACPI_WALK_STATE
*WalkState
,
106 ACPI_PARSE_OBJECT
*Op
);
109 AcpiDsEvalDataObjectOperands (
110 ACPI_WALK_STATE
*WalkState
,
111 ACPI_PARSE_OBJECT
*Op
,
112 ACPI_OPERAND_OBJECT
*ObjDesc
);
115 AcpiDsEvalBankFieldOperands (
116 ACPI_WALK_STATE
*WalkState
,
117 ACPI_PARSE_OBJECT
*Op
);
120 AcpiDsInitializeRegion (
121 ACPI_HANDLE ObjHandle
);
125 * dsexec - Parser/Interpreter interface, method execution callbacks
128 AcpiDsGetPredicateValue (
129 ACPI_WALK_STATE
*WalkState
,
130 ACPI_OPERAND_OBJECT
*ResultObj
);
134 ACPI_WALK_STATE
*WalkState
,
135 ACPI_PARSE_OBJECT
**OutOp
);
139 ACPI_WALK_STATE
*State
);
143 * dsfield - Parser/Interpreter interface for AML fields
147 ACPI_PARSE_OBJECT
*Op
,
148 ACPI_NAMESPACE_NODE
*RegionNode
,
149 ACPI_WALK_STATE
*WalkState
);
152 AcpiDsCreateBankField (
153 ACPI_PARSE_OBJECT
*Op
,
154 ACPI_NAMESPACE_NODE
*RegionNode
,
155 ACPI_WALK_STATE
*WalkState
);
158 AcpiDsCreateIndexField (
159 ACPI_PARSE_OBJECT
*Op
,
160 ACPI_NAMESPACE_NODE
*RegionNode
,
161 ACPI_WALK_STATE
*WalkState
);
164 AcpiDsCreateBufferField (
165 ACPI_PARSE_OBJECT
*Op
,
166 ACPI_WALK_STATE
*WalkState
);
169 AcpiDsInitFieldObjects (
170 ACPI_PARSE_OBJECT
*Op
,
171 ACPI_WALK_STATE
*WalkState
);
175 * dsload - Parser/Interpreter interface
178 AcpiDsInitCallbacks (
179 ACPI_WALK_STATE
*WalkState
,
182 /* dsload - pass 1 namespace load callbacks */
186 ACPI_WALK_STATE
*WalkState
,
187 ACPI_PARSE_OBJECT
**OutOp
);
191 ACPI_WALK_STATE
*WalkState
);
194 /* dsload - pass 2 namespace load callbacks */
198 ACPI_WALK_STATE
*WalkState
,
199 ACPI_PARSE_OBJECT
**OutOp
);
203 ACPI_WALK_STATE
*WalkState
);
207 * dsmthdat - method data (locals/args)
210 AcpiDsStoreObjectToLocal (
213 ACPI_OPERAND_OBJECT
*SrcDesc
,
214 ACPI_WALK_STATE
*WalkState
);
217 AcpiDsMethodDataGetEntry (
220 ACPI_WALK_STATE
*WalkState
,
221 ACPI_OPERAND_OBJECT
***Node
);
224 AcpiDsMethodDataDeleteAll (
225 ACPI_WALK_STATE
*WalkState
);
228 AcpiDsIsMethodValue (
229 ACPI_OPERAND_OBJECT
*ObjDesc
);
232 AcpiDsMethodDataGetValue (
235 ACPI_WALK_STATE
*WalkState
,
236 ACPI_OPERAND_OBJECT
**DestDesc
);
239 AcpiDsMethodDataInitArgs (
240 ACPI_OPERAND_OBJECT
**Params
,
241 UINT32 MaxParamCount
,
242 ACPI_WALK_STATE
*WalkState
);
245 AcpiDsMethodDataGetNode (
248 ACPI_WALK_STATE
*WalkState
,
249 ACPI_NAMESPACE_NODE
**Node
);
252 AcpiDsMethodDataInit (
253 ACPI_WALK_STATE
*WalkState
);
257 * dsmethod - Parser/Interpreter interface - control method parsing
260 AcpiDsAutoSerializeMethod (
261 ACPI_NAMESPACE_NODE
*Node
,
262 ACPI_OPERAND_OBJECT
*ObjDesc
);
265 AcpiDsCallControlMethod (
266 ACPI_THREAD_STATE
*Thread
,
267 ACPI_WALK_STATE
*WalkState
,
268 ACPI_PARSE_OBJECT
*Op
);
271 AcpiDsRestartControlMethod (
272 ACPI_WALK_STATE
*WalkState
,
273 ACPI_OPERAND_OBJECT
*ReturnDesc
);
276 AcpiDsTerminateControlMethod (
277 ACPI_OPERAND_OBJECT
*MethodDesc
,
278 ACPI_WALK_STATE
*WalkState
);
281 AcpiDsBeginMethodExecution (
282 ACPI_NAMESPACE_NODE
*MethodNode
,
283 ACPI_OPERAND_OBJECT
*ObjDesc
,
284 ACPI_WALK_STATE
*WalkState
);
289 ACPI_WALK_STATE
*WalkState
);
295 AcpiDsInitializeObjects (
297 ACPI_NAMESPACE_NODE
*StartNode
);
301 * dsobject - Parser/Interpreter interface - object initialization and conversion
304 AcpiDsBuildInternalBufferObj (
305 ACPI_WALK_STATE
*WalkState
,
306 ACPI_PARSE_OBJECT
*Op
,
308 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
311 AcpiDsBuildInternalPackageObj (
312 ACPI_WALK_STATE
*WalkState
,
313 ACPI_PARSE_OBJECT
*op
,
314 UINT32 PackageLength
,
315 ACPI_OPERAND_OBJECT
**ObjDesc
);
318 AcpiDsInitObjectFromOp (
319 ACPI_WALK_STATE
*WalkState
,
320 ACPI_PARSE_OBJECT
*Op
,
322 ACPI_OPERAND_OBJECT
**ObjDesc
);
326 ACPI_WALK_STATE
*WalkState
,
327 ACPI_NAMESPACE_NODE
*Node
,
328 ACPI_PARSE_OBJECT
*Op
);
332 * dsutils - Parser/Interpreter interface utility routines
335 AcpiDsClearImplicitReturn (
336 ACPI_WALK_STATE
*WalkState
);
339 AcpiDsDoImplicitReturn (
340 ACPI_OPERAND_OBJECT
*ReturnDesc
,
341 ACPI_WALK_STATE
*WalkState
,
342 BOOLEAN AddReference
);
346 ACPI_PARSE_OBJECT
*Op
,
347 ACPI_WALK_STATE
*WalkState
);
350 AcpiDsDeleteResultIfNotUsed (
351 ACPI_PARSE_OBJECT
*Op
,
352 ACPI_OPERAND_OBJECT
*ResultObj
,
353 ACPI_WALK_STATE
*WalkState
);
356 AcpiDsCreateOperand (
357 ACPI_WALK_STATE
*WalkState
,
358 ACPI_PARSE_OBJECT
*Arg
,
359 UINT32 ArgsRemaining
);
362 AcpiDsCreateOperands (
363 ACPI_WALK_STATE
*WalkState
,
364 ACPI_PARSE_OBJECT
*FirstArg
);
367 AcpiDsResolveOperands (
368 ACPI_WALK_STATE
*WalkState
);
371 AcpiDsClearOperands (
372 ACPI_WALK_STATE
*WalkState
);
375 AcpiDsEvaluateNamePath (
376 ACPI_WALK_STATE
*WalkState
);
380 * dswscope - Scope Stack manipulation
383 AcpiDsScopeStackPush (
384 ACPI_NAMESPACE_NODE
*Node
,
385 ACPI_OBJECT_TYPE Type
,
386 ACPI_WALK_STATE
*WalkState
);
390 AcpiDsScopeStackPop (
391 ACPI_WALK_STATE
*WalkState
);
394 AcpiDsScopeStackClear (
395 ACPI_WALK_STATE
*WalkState
);
399 * dswstate - parser WALK_STATE management routines
404 ACPI_WALK_STATE
*WalkState
);
409 ACPI_WALK_STATE
*WalkState
);
412 AcpiDsCreateWalkState (
413 ACPI_OWNER_ID OwnerId
,
414 ACPI_PARSE_OBJECT
*Origin
,
415 ACPI_OPERAND_OBJECT
*MthDesc
,
416 ACPI_THREAD_STATE
*Thread
);
420 ACPI_WALK_STATE
*WalkState
,
421 ACPI_PARSE_OBJECT
*Op
,
422 ACPI_NAMESPACE_NODE
*MethodNode
,
425 ACPI_EVALUATE_INFO
*Info
,
429 AcpiDsObjStackPopAndDelete (
431 ACPI_WALK_STATE
*WalkState
);
434 AcpiDsDeleteWalkState (
435 ACPI_WALK_STATE
*WalkState
);
439 ACPI_THREAD_STATE
*Thread
);
442 AcpiDsPushWalkState (
443 ACPI_WALK_STATE
*WalkState
,
444 ACPI_THREAD_STATE
*Thread
);
447 AcpiDsResultStackClear (
448 ACPI_WALK_STATE
*WalkState
);
451 AcpiDsGetCurrentWalkState (
452 ACPI_THREAD_STATE
*Thread
);
456 ACPI_OPERAND_OBJECT
**Object
,
457 ACPI_WALK_STATE
*WalkState
);
461 ACPI_OPERAND_OBJECT
*Object
,
462 ACPI_WALK_STATE
*WalkState
);
466 * dsdebug - parser debugging routines
469 AcpiDsDumpMethodStack (
471 ACPI_WALK_STATE
*WalkState
,
472 ACPI_PARSE_OBJECT
*Op
);
474 #endif /* _ACDISPAT_H_ */