dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / arch / x86 / include / sys / acpi / acdispat.h
blob1a6f39e2aa8e3120ca5a3ae3364b0b864570082c
1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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.
44 #ifndef _ACDISPAT_H_
45 #define _ACDISPAT_H_
48 #define NAMEOF_LOCAL_NTE "__L0"
49 #define NAMEOF_ARG_NTE "__A0"
53 * dsargs - execution of dynamic arguments for static objects
55 ACPI_STATUS
56 AcpiDsGetBufferFieldArguments (
57 ACPI_OPERAND_OBJECT *ObjDesc);
59 ACPI_STATUS
60 AcpiDsGetBankFieldArguments (
61 ACPI_OPERAND_OBJECT *ObjDesc);
63 ACPI_STATUS
64 AcpiDsGetRegionArguments (
65 ACPI_OPERAND_OBJECT *RgnDesc);
67 ACPI_STATUS
68 AcpiDsGetBufferArguments (
69 ACPI_OPERAND_OBJECT *ObjDesc);
71 ACPI_STATUS
72 AcpiDsGetPackageArguments (
73 ACPI_OPERAND_OBJECT *ObjDesc);
77 * dscontrol - support for execution control opcodes
79 ACPI_STATUS
80 AcpiDsExecBeginControlOp (
81 ACPI_WALK_STATE *WalkState,
82 ACPI_PARSE_OBJECT *Op);
84 ACPI_STATUS
85 AcpiDsExecEndControlOp (
86 ACPI_WALK_STATE *WalkState,
87 ACPI_PARSE_OBJECT *Op);
91 * dsopcode - support for late operand evaluation
93 ACPI_STATUS
94 AcpiDsEvalBufferFieldOperands (
95 ACPI_WALK_STATE *WalkState,
96 ACPI_PARSE_OBJECT *Op);
98 ACPI_STATUS
99 AcpiDsEvalRegionOperands (
100 ACPI_WALK_STATE *WalkState,
101 ACPI_PARSE_OBJECT *Op);
103 ACPI_STATUS
104 AcpiDsEvalTableRegionOperands (
105 ACPI_WALK_STATE *WalkState,
106 ACPI_PARSE_OBJECT *Op);
108 ACPI_STATUS
109 AcpiDsEvalDataObjectOperands (
110 ACPI_WALK_STATE *WalkState,
111 ACPI_PARSE_OBJECT *Op,
112 ACPI_OPERAND_OBJECT *ObjDesc);
114 ACPI_STATUS
115 AcpiDsEvalBankFieldOperands (
116 ACPI_WALK_STATE *WalkState,
117 ACPI_PARSE_OBJECT *Op);
119 ACPI_STATUS
120 AcpiDsInitializeRegion (
121 ACPI_HANDLE ObjHandle);
125 * dsexec - Parser/Interpreter interface, method execution callbacks
127 ACPI_STATUS
128 AcpiDsGetPredicateValue (
129 ACPI_WALK_STATE *WalkState,
130 ACPI_OPERAND_OBJECT *ResultObj);
132 ACPI_STATUS
133 AcpiDsExecBeginOp (
134 ACPI_WALK_STATE *WalkState,
135 ACPI_PARSE_OBJECT **OutOp);
137 ACPI_STATUS
138 AcpiDsExecEndOp (
139 ACPI_WALK_STATE *State);
143 * dsfield - Parser/Interpreter interface for AML fields
145 ACPI_STATUS
146 AcpiDsCreateField (
147 ACPI_PARSE_OBJECT *Op,
148 ACPI_NAMESPACE_NODE *RegionNode,
149 ACPI_WALK_STATE *WalkState);
151 ACPI_STATUS
152 AcpiDsCreateBankField (
153 ACPI_PARSE_OBJECT *Op,
154 ACPI_NAMESPACE_NODE *RegionNode,
155 ACPI_WALK_STATE *WalkState);
157 ACPI_STATUS
158 AcpiDsCreateIndexField (
159 ACPI_PARSE_OBJECT *Op,
160 ACPI_NAMESPACE_NODE *RegionNode,
161 ACPI_WALK_STATE *WalkState);
163 ACPI_STATUS
164 AcpiDsCreateBufferField (
165 ACPI_PARSE_OBJECT *Op,
166 ACPI_WALK_STATE *WalkState);
168 ACPI_STATUS
169 AcpiDsInitFieldObjects (
170 ACPI_PARSE_OBJECT *Op,
171 ACPI_WALK_STATE *WalkState);
175 * dsload - Parser/Interpreter interface
177 ACPI_STATUS
178 AcpiDsInitCallbacks (
179 ACPI_WALK_STATE *WalkState,
180 UINT32 PassNumber);
182 /* dsload - pass 1 namespace load callbacks */
184 ACPI_STATUS
185 AcpiDsLoad1BeginOp (
186 ACPI_WALK_STATE *WalkState,
187 ACPI_PARSE_OBJECT **OutOp);
189 ACPI_STATUS
190 AcpiDsLoad1EndOp (
191 ACPI_WALK_STATE *WalkState);
194 /* dsload - pass 2 namespace load callbacks */
196 ACPI_STATUS
197 AcpiDsLoad2BeginOp (
198 ACPI_WALK_STATE *WalkState,
199 ACPI_PARSE_OBJECT **OutOp);
201 ACPI_STATUS
202 AcpiDsLoad2EndOp (
203 ACPI_WALK_STATE *WalkState);
207 * dsmthdat - method data (locals/args)
209 ACPI_STATUS
210 AcpiDsStoreObjectToLocal (
211 UINT8 Type,
212 UINT32 Index,
213 ACPI_OPERAND_OBJECT *SrcDesc,
214 ACPI_WALK_STATE *WalkState);
216 ACPI_STATUS
217 AcpiDsMethodDataGetEntry (
218 UINT16 Opcode,
219 UINT32 Index,
220 ACPI_WALK_STATE *WalkState,
221 ACPI_OPERAND_OBJECT ***Node);
223 void
224 AcpiDsMethodDataDeleteAll (
225 ACPI_WALK_STATE *WalkState);
227 BOOLEAN
228 AcpiDsIsMethodValue (
229 ACPI_OPERAND_OBJECT *ObjDesc);
231 ACPI_STATUS
232 AcpiDsMethodDataGetValue (
233 UINT8 Type,
234 UINT32 Index,
235 ACPI_WALK_STATE *WalkState,
236 ACPI_OPERAND_OBJECT **DestDesc);
238 ACPI_STATUS
239 AcpiDsMethodDataInitArgs (
240 ACPI_OPERAND_OBJECT **Params,
241 UINT32 MaxParamCount,
242 ACPI_WALK_STATE *WalkState);
244 ACPI_STATUS
245 AcpiDsMethodDataGetNode (
246 UINT8 Type,
247 UINT32 Index,
248 ACPI_WALK_STATE *WalkState,
249 ACPI_NAMESPACE_NODE **Node);
251 void
252 AcpiDsMethodDataInit (
253 ACPI_WALK_STATE *WalkState);
257 * dsmethod - Parser/Interpreter interface - control method parsing
259 ACPI_STATUS
260 AcpiDsAutoSerializeMethod (
261 ACPI_NAMESPACE_NODE *Node,
262 ACPI_OPERAND_OBJECT *ObjDesc);
264 ACPI_STATUS
265 AcpiDsCallControlMethod (
266 ACPI_THREAD_STATE *Thread,
267 ACPI_WALK_STATE *WalkState,
268 ACPI_PARSE_OBJECT *Op);
270 ACPI_STATUS
271 AcpiDsRestartControlMethod (
272 ACPI_WALK_STATE *WalkState,
273 ACPI_OPERAND_OBJECT *ReturnDesc);
275 void
276 AcpiDsTerminateControlMethod (
277 ACPI_OPERAND_OBJECT *MethodDesc,
278 ACPI_WALK_STATE *WalkState);
280 ACPI_STATUS
281 AcpiDsBeginMethodExecution (
282 ACPI_NAMESPACE_NODE *MethodNode,
283 ACPI_OPERAND_OBJECT *ObjDesc,
284 ACPI_WALK_STATE *WalkState);
286 ACPI_STATUS
287 AcpiDsMethodError (
288 ACPI_STATUS Status,
289 ACPI_WALK_STATE *WalkState);
292 * dsinit
294 ACPI_STATUS
295 AcpiDsInitializeObjects (
296 UINT32 TableIndex,
297 ACPI_NAMESPACE_NODE *StartNode);
301 * dsobject - Parser/Interpreter interface - object initialization and conversion
303 ACPI_STATUS
304 AcpiDsBuildInternalBufferObj (
305 ACPI_WALK_STATE *WalkState,
306 ACPI_PARSE_OBJECT *Op,
307 UINT32 BufferLength,
308 ACPI_OPERAND_OBJECT **ObjDescPtr);
310 ACPI_STATUS
311 AcpiDsBuildInternalPackageObj (
312 ACPI_WALK_STATE *WalkState,
313 ACPI_PARSE_OBJECT *op,
314 UINT32 PackageLength,
315 ACPI_OPERAND_OBJECT **ObjDesc);
317 ACPI_STATUS
318 AcpiDsInitObjectFromOp (
319 ACPI_WALK_STATE *WalkState,
320 ACPI_PARSE_OBJECT *Op,
321 UINT16 Opcode,
322 ACPI_OPERAND_OBJECT **ObjDesc);
324 ACPI_STATUS
325 AcpiDsCreateNode (
326 ACPI_WALK_STATE *WalkState,
327 ACPI_NAMESPACE_NODE *Node,
328 ACPI_PARSE_OBJECT *Op);
332 * dsutils - Parser/Interpreter interface utility routines
334 void
335 AcpiDsClearImplicitReturn (
336 ACPI_WALK_STATE *WalkState);
338 BOOLEAN
339 AcpiDsDoImplicitReturn (
340 ACPI_OPERAND_OBJECT *ReturnDesc,
341 ACPI_WALK_STATE *WalkState,
342 BOOLEAN AddReference);
344 BOOLEAN
345 AcpiDsIsResultUsed (
346 ACPI_PARSE_OBJECT *Op,
347 ACPI_WALK_STATE *WalkState);
349 void
350 AcpiDsDeleteResultIfNotUsed (
351 ACPI_PARSE_OBJECT *Op,
352 ACPI_OPERAND_OBJECT *ResultObj,
353 ACPI_WALK_STATE *WalkState);
355 ACPI_STATUS
356 AcpiDsCreateOperand (
357 ACPI_WALK_STATE *WalkState,
358 ACPI_PARSE_OBJECT *Arg,
359 UINT32 ArgsRemaining);
361 ACPI_STATUS
362 AcpiDsCreateOperands (
363 ACPI_WALK_STATE *WalkState,
364 ACPI_PARSE_OBJECT *FirstArg);
366 ACPI_STATUS
367 AcpiDsResolveOperands (
368 ACPI_WALK_STATE *WalkState);
370 void
371 AcpiDsClearOperands (
372 ACPI_WALK_STATE *WalkState);
374 ACPI_STATUS
375 AcpiDsEvaluateNamePath (
376 ACPI_WALK_STATE *WalkState);
380 * dswscope - Scope Stack manipulation
382 ACPI_STATUS
383 AcpiDsScopeStackPush (
384 ACPI_NAMESPACE_NODE *Node,
385 ACPI_OBJECT_TYPE Type,
386 ACPI_WALK_STATE *WalkState);
389 ACPI_STATUS
390 AcpiDsScopeStackPop (
391 ACPI_WALK_STATE *WalkState);
393 void
394 AcpiDsScopeStackClear (
395 ACPI_WALK_STATE *WalkState);
399 * dswstate - parser WALK_STATE management routines
401 ACPI_STATUS
402 AcpiDsObjStackPush (
403 void *Object,
404 ACPI_WALK_STATE *WalkState);
406 ACPI_STATUS
407 AcpiDsObjStackPop (
408 UINT32 PopCount,
409 ACPI_WALK_STATE *WalkState);
411 ACPI_WALK_STATE *
412 AcpiDsCreateWalkState (
413 ACPI_OWNER_ID OwnerId,
414 ACPI_PARSE_OBJECT *Origin,
415 ACPI_OPERAND_OBJECT *MthDesc,
416 ACPI_THREAD_STATE *Thread);
418 ACPI_STATUS
419 AcpiDsInitAmlWalk (
420 ACPI_WALK_STATE *WalkState,
421 ACPI_PARSE_OBJECT *Op,
422 ACPI_NAMESPACE_NODE *MethodNode,
423 UINT8 *AmlStart,
424 UINT32 AmlLength,
425 ACPI_EVALUATE_INFO *Info,
426 UINT8 PassNumber);
428 void
429 AcpiDsObjStackPopAndDelete (
430 UINT32 PopCount,
431 ACPI_WALK_STATE *WalkState);
433 void
434 AcpiDsDeleteWalkState (
435 ACPI_WALK_STATE *WalkState);
437 ACPI_WALK_STATE *
438 AcpiDsPopWalkState (
439 ACPI_THREAD_STATE *Thread);
441 void
442 AcpiDsPushWalkState (
443 ACPI_WALK_STATE *WalkState,
444 ACPI_THREAD_STATE *Thread);
446 ACPI_STATUS
447 AcpiDsResultStackClear (
448 ACPI_WALK_STATE *WalkState);
450 ACPI_WALK_STATE *
451 AcpiDsGetCurrentWalkState (
452 ACPI_THREAD_STATE *Thread);
454 ACPI_STATUS
455 AcpiDsResultPop (
456 ACPI_OPERAND_OBJECT **Object,
457 ACPI_WALK_STATE *WalkState);
459 ACPI_STATUS
460 AcpiDsResultPush (
461 ACPI_OPERAND_OBJECT *Object,
462 ACPI_WALK_STATE *WalkState);
466 * dsdebug - parser debugging routines
468 void
469 AcpiDsDumpMethodStack (
470 ACPI_STATUS Status,
471 ACPI_WALK_STATE *WalkState,
472 ACPI_PARSE_OBJECT *Op);
474 #endif /* _ACDISPAT_H_ */