acdispat.h revision 67754
1/******************************************************************************
2 *
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
4 *       $Revision: 31 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
13 * reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights.  You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
21 *
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
28 *
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code.  No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision.  In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change.  Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee.  Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution.  In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
66 *
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government.  In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117
118#ifndef _ACDISPAT_H_
119#define _ACDISPAT_H_
120
121
122#define NAMEOF_LOCAL_NTE    "__L0"
123#define NAMEOF_ARG_NTE      "__A0"
124
125
126/* For AcpiDsMethodDataSetValue */
127
128#define MTH_TYPE_LOCAL              0
129#define MTH_TYPE_ARG                1
130
131
132
133
134/* Common interfaces */
135
136ACPI_STATUS
137AcpiDsObjStackPush (
138    void                    *Object,
139    ACPI_WALK_STATE         *WalkState);
140
141ACPI_STATUS
142AcpiDsObjStackPop (
143    UINT32                  PopCount,
144    ACPI_WALK_STATE         *WalkState);
145
146void *
147AcpiDsObjStackGetValue (
148    UINT32                  Index,
149    ACPI_WALK_STATE         *WalkState);
150
151ACPI_STATUS
152AcpiDsObjStackPopObject (
153    ACPI_OPERAND_OBJECT     **Object,
154    ACPI_WALK_STATE         *WalkState);
155
156
157/* dsopcode - support for late evaluation */
158
159ACPI_STATUS
160AcpiDsGetFieldUnitArguments (
161    ACPI_OPERAND_OBJECT     *ObjDesc);
162
163ACPI_STATUS
164AcpiDsGetRegionArguments (
165    ACPI_OPERAND_OBJECT     *RgnDesc);
166
167
168/* dsctrl - Parser/Interpreter interface, control stack routines */
169
170
171ACPI_STATUS
172AcpiDsExecBeginControlOp (
173    ACPI_WALK_STATE         *WalkState,
174    ACPI_PARSE_OBJECT       *Op);
175
176ACPI_STATUS
177AcpiDsExecEndControlOp (
178    ACPI_WALK_STATE         *WalkState,
179    ACPI_PARSE_OBJECT       *Op);
180
181
182/* dsexec - Parser/Interpreter interface, method execution callbacks */
183
184
185ACPI_STATUS
186AcpiDsGetPredicateValue (
187    ACPI_WALK_STATE         *WalkState,
188    ACPI_PARSE_OBJECT       *Op,
189    UINT32                  HasResultObj);
190
191ACPI_STATUS
192AcpiDsExecBeginOp (
193    UINT16                  Opcode,
194    ACPI_PARSE_OBJECT       *Op,
195    ACPI_WALK_STATE         *WalkState,
196    ACPI_PARSE_OBJECT       **OutOp);
197
198ACPI_STATUS
199AcpiDsExecEndOp (
200    ACPI_WALK_STATE         *State,
201    ACPI_PARSE_OBJECT       *Op);
202
203
204/* dsfield - Parser/Interpreter interface for AML fields */
205
206
207ACPI_STATUS
208AcpiDsCreateField (
209    ACPI_PARSE_OBJECT       *Op,
210    ACPI_NAMESPACE_NODE     *RegionNode,
211    ACPI_WALK_STATE         *WalkState);
212
213ACPI_STATUS
214AcpiDsCreateBankField (
215    ACPI_PARSE_OBJECT       *Op,
216    ACPI_NAMESPACE_NODE     *RegionNode,
217    ACPI_WALK_STATE         *WalkState);
218
219ACPI_STATUS
220AcpiDsCreateIndexField (
221    ACPI_PARSE_OBJECT       *Op,
222    ACPI_HANDLE             RegionNode,
223    ACPI_WALK_STATE         *WalkState);
224
225
226/* dsload - Parser/Interpreter interface, namespace load callbacks */
227
228ACPI_STATUS
229AcpiDsLoad1BeginOp (
230    UINT16                  Opcode,
231    ACPI_PARSE_OBJECT       *Op,
232    ACPI_WALK_STATE         *WalkState,
233    ACPI_PARSE_OBJECT       **OutOp);
234
235ACPI_STATUS
236AcpiDsLoad1EndOp (
237    ACPI_WALK_STATE         *WalkState,
238    ACPI_PARSE_OBJECT       *Op);
239
240ACPI_STATUS
241AcpiDsLoad2BeginOp (
242    UINT16                  Opcode,
243    ACPI_PARSE_OBJECT       *Op,
244    ACPI_WALK_STATE         *WalkState,
245    ACPI_PARSE_OBJECT       **OutOp);
246
247ACPI_STATUS
248AcpiDsLoad2EndOp (
249    ACPI_WALK_STATE         *State,
250    ACPI_PARSE_OBJECT       *Op);
251
252ACPI_STATUS
253AcpiDsLoad3BeginOp (
254    UINT16                  Opcode,
255    ACPI_PARSE_OBJECT       *Op,
256    ACPI_WALK_STATE         *WalkState,
257    ACPI_PARSE_OBJECT       **OutOp);
258
259ACPI_STATUS
260AcpiDsLoad3EndOp (
261    ACPI_WALK_STATE         *State,
262    ACPI_PARSE_OBJECT       *Op);
263
264
265/* dsmthdat - method data (locals/args) */
266
267
268ACPI_STATUS
269AcpiDsMethodDataGetEntry (
270    UINT32                  Type,
271    UINT32                  Index,
272    ACPI_WALK_STATE         *WalkState,
273    ACPI_OPERAND_OBJECT     ***Node);
274
275ACPI_STATUS
276AcpiDsMethodDataDeleteAll (
277    ACPI_WALK_STATE         *WalkState);
278
279BOOLEAN
280AcpiDsIsMethodValue (
281    ACPI_OPERAND_OBJECT     *ObjDesc);
282
283OBJECT_TYPE_INTERNAL
284AcpiDsMethodDataGetType (
285    UINT32                  Type,
286    UINT32                  Index,
287    ACPI_WALK_STATE         *WalkState);
288
289ACPI_STATUS
290AcpiDsMethodDataGetValue (
291    UINT32                  Type,
292    UINT32                  Index,
293    ACPI_WALK_STATE         *WalkState,
294    ACPI_OPERAND_OBJECT     **DestDesc);
295
296ACPI_STATUS
297AcpiDsMethodDataSetValue (
298    UINT32                  Type,
299    UINT32                  Index,
300    ACPI_OPERAND_OBJECT     *SrcDesc,
301    ACPI_WALK_STATE         *WalkState);
302
303ACPI_STATUS
304AcpiDsMethodDataDeleteValue (
305    UINT32                  Type,
306    UINT32                  Index,
307    ACPI_WALK_STATE         *WalkState);
308
309ACPI_STATUS
310AcpiDsMethodDataInitArgs (
311    ACPI_OPERAND_OBJECT     **Params,
312    UINT32                  MaxParamCount,
313    ACPI_WALK_STATE         *WalkState);
314
315ACPI_NAMESPACE_NODE *
316AcpiDsMethodDataGetNte (
317    UINT32                  Type,
318    UINT32                  Index,
319    ACPI_WALK_STATE         *WalkState);
320
321ACPI_STATUS
322AcpiDsMethodDataInit (
323    ACPI_WALK_STATE         *WalkState);
324
325ACPI_STATUS
326AcpiDsMethodDataSetEntry (
327    UINT32                  Type,
328    UINT32                  Index,
329    ACPI_OPERAND_OBJECT     *Object,
330    ACPI_WALK_STATE         *WalkState);
331
332
333/* dsmethod - Parser/Interpreter interface - control method parsing */
334
335ACPI_STATUS
336AcpiDsParseMethod (
337    ACPI_HANDLE             ObjHandle);
338
339ACPI_STATUS
340AcpiDsCallControlMethod (
341    ACPI_WALK_LIST          *WalkList,
342    ACPI_WALK_STATE         *WalkState,
343    ACPI_PARSE_OBJECT       *Op);
344
345ACPI_STATUS
346AcpiDsRestartControlMethod (
347    ACPI_WALK_STATE         *WalkState,
348    ACPI_OPERAND_OBJECT     *ReturnDesc);
349
350ACPI_STATUS
351AcpiDsTerminateControlMethod (
352    ACPI_WALK_STATE         *WalkState);
353
354ACPI_STATUS
355AcpiDsBeginMethodExecution (
356    ACPI_NAMESPACE_NODE     *MethodNode,
357    ACPI_OPERAND_OBJECT     *ObjDesc);
358
359
360/* dsobj - Parser/Interpreter interface - object initialization and conversion */
361
362ACPI_STATUS
363AcpiDsInitOneObject (
364    ACPI_HANDLE             ObjHandle,
365    UINT32                  Level,
366    void                    *Context,
367    void                    **ReturnValue);
368
369ACPI_STATUS
370AcpiDsInitializeObjects (
371    ACPI_TABLE_DESC         *TableDesc,
372    ACPI_NAMESPACE_NODE     *StartNode);
373
374ACPI_STATUS
375AcpiDsBuildInternalPackageObj (
376    ACPI_WALK_STATE         *WalkState,
377    ACPI_PARSE_OBJECT       *op,
378    ACPI_OPERAND_OBJECT     **ObjDesc);
379
380ACPI_STATUS
381AcpiDsBuildInternalObject (
382    ACPI_WALK_STATE         *WalkState,
383    ACPI_PARSE_OBJECT       *op,
384    ACPI_OPERAND_OBJECT     **ObjDescPtr);
385
386ACPI_STATUS
387AcpiDsInitObjectFromOp (
388    ACPI_WALK_STATE         *WalkState,
389    ACPI_PARSE_OBJECT       *Op,
390    UINT16                  Opcode,
391    ACPI_OPERAND_OBJECT     **ObjDesc);
392
393ACPI_STATUS
394AcpiDsCreateNode (
395    ACPI_WALK_STATE         *WalkState,
396    ACPI_NAMESPACE_NODE     *Node,
397    ACPI_PARSE_OBJECT       *Op);
398
399
400/* dsregn - Parser/Interpreter interface - Op Region parsing */
401
402ACPI_STATUS
403AcpiDsEvalFieldUnitOperands (
404    ACPI_WALK_STATE         *WalkState,
405    ACPI_PARSE_OBJECT       *Op);
406
407ACPI_STATUS
408AcpiDsEvalRegionOperands (
409    ACPI_WALK_STATE         *WalkState,
410    ACPI_PARSE_OBJECT       *Op);
411
412ACPI_STATUS
413AcpiDsInitializeRegion (
414    ACPI_HANDLE             ObjHandle);
415
416
417/* dsutils - Parser/Interpreter interface utility routines */
418
419BOOLEAN
420AcpiDsIsResultUsed (
421    ACPI_PARSE_OBJECT       *Op,
422    ACPI_WALK_STATE         *WalkState);
423
424void
425AcpiDsDeleteResultIfNotUsed (
426    ACPI_PARSE_OBJECT       *Op,
427    ACPI_OPERAND_OBJECT     *ResultObj,
428    ACPI_WALK_STATE         *WalkState);
429
430ACPI_STATUS
431AcpiDsCreateOperand (
432    ACPI_WALK_STATE         *WalkState,
433    ACPI_PARSE_OBJECT       *Arg);
434
435ACPI_STATUS
436AcpiDsCreateOperands (
437    ACPI_WALK_STATE         *WalkState,
438    ACPI_PARSE_OBJECT       *FirstArg);
439
440ACPI_STATUS
441AcpiDsResolveOperands (
442    ACPI_WALK_STATE         *WalkState);
443
444OBJECT_TYPE_INTERNAL
445AcpiDsMapOpcodeToDataType (
446    UINT16                  Opcode,
447    UINT32                  *OutFlags);
448
449OBJECT_TYPE_INTERNAL
450AcpiDsMapNamedOpcodeToDataType (
451    UINT16                  Opcode);
452
453
454/*
455 * dswscope - Scope Stack manipulation
456 */
457
458ACPI_STATUS
459AcpiDsScopeStackPush (
460    ACPI_NAMESPACE_NODE     *Node,
461    OBJECT_TYPE_INTERNAL    Type,
462    ACPI_WALK_STATE         *WalkState);
463
464
465ACPI_STATUS
466AcpiDsScopeStackPop (
467    ACPI_WALK_STATE         *WalkState);
468
469void
470AcpiDsScopeStackClear (
471    ACPI_WALK_STATE         *WalkState);
472
473
474/* AcpiDswstate - parser WALK_STATE management routines */
475
476ACPI_WALK_STATE *
477AcpiDsCreateWalkState (
478    ACPI_OWNER_ID           OwnerId,
479    ACPI_PARSE_OBJECT       *Origin,
480    ACPI_OPERAND_OBJECT     *MthDesc,
481    ACPI_WALK_LIST          *WalkList);
482
483ACPI_STATUS
484AcpiDsObjStackDeleteAll (
485    ACPI_WALK_STATE         *WalkState);
486
487ACPI_STATUS
488AcpiDsObjStackPopAndDelete (
489    UINT32                  PopCount,
490    ACPI_WALK_STATE         *WalkState);
491
492void
493AcpiDsDeleteWalkState (
494    ACPI_WALK_STATE         *WalkState);
495
496ACPI_WALK_STATE *
497AcpiDsPopWalkState (
498    ACPI_WALK_LIST          *WalkList);
499
500ACPI_STATUS
501AcpiDsResultStackPop (
502    ACPI_OPERAND_OBJECT     **Object,
503    ACPI_WALK_STATE         *WalkState);
504
505ACPI_STATUS
506AcpiDsResultStackPush (
507    void                    *Object,
508    ACPI_WALK_STATE         *WalkState);
509
510ACPI_STATUS
511AcpiDsResultStackClear (
512    ACPI_WALK_STATE         *WalkState);
513
514ACPI_WALK_STATE *
515AcpiDsGetCurrentWalkState (
516    ACPI_WALK_LIST          *WalkList);
517
518void
519AcpiDsDeleteWalkStateCache (
520    void);
521
522
523#endif /* _ACDISPAT_H_ */
524