1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, 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.
49 #define NAMEOF_LOCAL_NTE "__L0"
50 #define NAMEOF_ARG_NTE "__A0"
54 * dsargs - execution of dynamic arguments for static objects
57 AcpiDsGetBufferFieldArguments (
58 ACPI_OPERAND_OBJECT
*ObjDesc
);
61 AcpiDsGetBankFieldArguments (
62 ACPI_OPERAND_OBJECT
*ObjDesc
);
65 AcpiDsGetRegionArguments (
66 ACPI_OPERAND_OBJECT
*RgnDesc
);
69 AcpiDsGetBufferArguments (
70 ACPI_OPERAND_OBJECT
*ObjDesc
);
73 AcpiDsGetPackageArguments (
74 ACPI_OPERAND_OBJECT
*ObjDesc
);
78 * dscontrol - support for execution control opcodes
81 AcpiDsExecBeginControlOp (
82 ACPI_WALK_STATE
*WalkState
,
83 ACPI_PARSE_OBJECT
*Op
);
86 AcpiDsExecEndControlOp (
87 ACPI_WALK_STATE
*WalkState
,
88 ACPI_PARSE_OBJECT
*Op
);
92 * dsopcode - support for late operand evaluation
95 AcpiDsEvalBufferFieldOperands (
96 ACPI_WALK_STATE
*WalkState
,
97 ACPI_PARSE_OBJECT
*Op
);
100 AcpiDsEvalRegionOperands (
101 ACPI_WALK_STATE
*WalkState
,
102 ACPI_PARSE_OBJECT
*Op
);
105 AcpiDsEvalTableRegionOperands (
106 ACPI_WALK_STATE
*WalkState
,
107 ACPI_PARSE_OBJECT
*Op
);
110 AcpiDsEvalDataObjectOperands (
111 ACPI_WALK_STATE
*WalkState
,
112 ACPI_PARSE_OBJECT
*Op
,
113 ACPI_OPERAND_OBJECT
*ObjDesc
);
116 AcpiDsEvalBankFieldOperands (
117 ACPI_WALK_STATE
*WalkState
,
118 ACPI_PARSE_OBJECT
*Op
);
121 AcpiDsInitializeRegion (
122 ACPI_HANDLE ObjHandle
);
126 * dsexec - Parser/Interpreter interface, method execution callbacks
129 AcpiDsGetPredicateValue (
130 ACPI_WALK_STATE
*WalkState
,
131 ACPI_OPERAND_OBJECT
*ResultObj
);
135 ACPI_WALK_STATE
*WalkState
,
136 ACPI_PARSE_OBJECT
**OutOp
);
140 ACPI_WALK_STATE
*State
);
144 * dsfield - Parser/Interpreter interface for AML fields
148 ACPI_PARSE_OBJECT
*Op
,
149 ACPI_NAMESPACE_NODE
*RegionNode
,
150 ACPI_WALK_STATE
*WalkState
);
153 AcpiDsCreateBankField (
154 ACPI_PARSE_OBJECT
*Op
,
155 ACPI_NAMESPACE_NODE
*RegionNode
,
156 ACPI_WALK_STATE
*WalkState
);
159 AcpiDsCreateIndexField (
160 ACPI_PARSE_OBJECT
*Op
,
161 ACPI_NAMESPACE_NODE
*RegionNode
,
162 ACPI_WALK_STATE
*WalkState
);
165 AcpiDsCreateBufferField (
166 ACPI_PARSE_OBJECT
*Op
,
167 ACPI_WALK_STATE
*WalkState
);
170 AcpiDsInitFieldObjects (
171 ACPI_PARSE_OBJECT
*Op
,
172 ACPI_WALK_STATE
*WalkState
);
176 * dsload - Parser/Interpreter interface, pass 1 namespace load callbacks
179 AcpiDsInitCallbacks (
180 ACPI_WALK_STATE
*WalkState
,
185 ACPI_WALK_STATE
*WalkState
,
186 ACPI_PARSE_OBJECT
**OutOp
);
190 ACPI_WALK_STATE
*WalkState
);
194 * dsload - Parser/Interpreter interface, 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
261 ACPI_NAMESPACE_NODE
*Node
);
264 AcpiDsCallControlMethod (
265 ACPI_THREAD_STATE
*Thread
,
266 ACPI_WALK_STATE
*WalkState
,
267 ACPI_PARSE_OBJECT
*Op
);
270 AcpiDsRestartControlMethod (
271 ACPI_WALK_STATE
*WalkState
,
272 ACPI_OPERAND_OBJECT
*ReturnDesc
);
275 AcpiDsTerminateControlMethod (
276 ACPI_OPERAND_OBJECT
*MethodDesc
,
277 ACPI_WALK_STATE
*WalkState
);
280 AcpiDsBeginMethodExecution (
281 ACPI_NAMESPACE_NODE
*MethodNode
,
282 ACPI_OPERAND_OBJECT
*ObjDesc
,
283 ACPI_WALK_STATE
*WalkState
);
288 ACPI_WALK_STATE
*WalkState
);
294 AcpiDsInitializeObjects (
296 ACPI_NAMESPACE_NODE
*StartNode
);
300 * dsobject - Parser/Interpreter interface - object initialization and conversion
303 AcpiDsBuildInternalBufferObj (
304 ACPI_WALK_STATE
*WalkState
,
305 ACPI_PARSE_OBJECT
*Op
,
307 ACPI_OPERAND_OBJECT
**ObjDescPtr
);
310 AcpiDsBuildInternalPackageObj (
311 ACPI_WALK_STATE
*WalkState
,
312 ACPI_PARSE_OBJECT
*op
,
313 UINT32 PackageLength
,
314 ACPI_OPERAND_OBJECT
**ObjDesc
);
317 AcpiDsInitObjectFromOp (
318 ACPI_WALK_STATE
*WalkState
,
319 ACPI_PARSE_OBJECT
*Op
,
321 ACPI_OPERAND_OBJECT
**ObjDesc
);
325 ACPI_WALK_STATE
*WalkState
,
326 ACPI_NAMESPACE_NODE
*Node
,
327 ACPI_PARSE_OBJECT
*Op
);
331 * dsutils - Parser/Interpreter interface utility routines
334 AcpiDsClearImplicitReturn (
335 ACPI_WALK_STATE
*WalkState
);
338 AcpiDsDoImplicitReturn (
339 ACPI_OPERAND_OBJECT
*ReturnDesc
,
340 ACPI_WALK_STATE
*WalkState
,
341 BOOLEAN AddReference
);
345 ACPI_PARSE_OBJECT
*Op
,
346 ACPI_WALK_STATE
*WalkState
);
349 AcpiDsDeleteResultIfNotUsed (
350 ACPI_PARSE_OBJECT
*Op
,
351 ACPI_OPERAND_OBJECT
*ResultObj
,
352 ACPI_WALK_STATE
*WalkState
);
355 AcpiDsCreateOperand (
356 ACPI_WALK_STATE
*WalkState
,
357 ACPI_PARSE_OBJECT
*Arg
,
358 UINT32 ArgsRemaining
);
361 AcpiDsCreateOperands (
362 ACPI_WALK_STATE
*WalkState
,
363 ACPI_PARSE_OBJECT
*FirstArg
);
366 AcpiDsResolveOperands (
367 ACPI_WALK_STATE
*WalkState
);
370 AcpiDsClearOperands (
371 ACPI_WALK_STATE
*WalkState
);
374 AcpiDsEvaluateNamePath (
375 ACPI_WALK_STATE
*WalkState
);
379 * dswscope - Scope Stack manipulation
382 AcpiDsScopeStackPush (
383 ACPI_NAMESPACE_NODE
*Node
,
384 ACPI_OBJECT_TYPE Type
,
385 ACPI_WALK_STATE
*WalkState
);
389 AcpiDsScopeStackPop (
390 ACPI_WALK_STATE
*WalkState
);
393 AcpiDsScopeStackClear (
394 ACPI_WALK_STATE
*WalkState
);
398 * dswstate - parser WALK_STATE management routines
403 ACPI_WALK_STATE
*WalkState
);
408 ACPI_WALK_STATE
*WalkState
);
411 AcpiDsCreateWalkState (
412 ACPI_OWNER_ID OwnerId
,
413 ACPI_PARSE_OBJECT
*Origin
,
414 ACPI_OPERAND_OBJECT
*MthDesc
,
415 ACPI_THREAD_STATE
*Thread
);
419 ACPI_WALK_STATE
*WalkState
,
420 ACPI_PARSE_OBJECT
*Op
,
421 ACPI_NAMESPACE_NODE
*MethodNode
,
424 ACPI_EVALUATE_INFO
*Info
,
428 AcpiDsObjStackPopAndDelete (
430 ACPI_WALK_STATE
*WalkState
);
433 AcpiDsDeleteWalkState (
434 ACPI_WALK_STATE
*WalkState
);
438 ACPI_THREAD_STATE
*Thread
);
441 AcpiDsPushWalkState (
442 ACPI_WALK_STATE
*WalkState
,
443 ACPI_THREAD_STATE
*Thread
);
446 AcpiDsResultStackClear (
447 ACPI_WALK_STATE
*WalkState
);
450 AcpiDsGetCurrentWalkState (
451 ACPI_THREAD_STATE
*Thread
);
455 ACPI_OPERAND_OBJECT
**Object
,
456 ACPI_WALK_STATE
*WalkState
);
460 ACPI_OPERAND_OBJECT
*Object
,
461 ACPI_WALK_STATE
*WalkState
);
463 #endif /* _ACDISPAT_H_ */