Fixed compatibility of output.
[AROS.git] / arch / all-pc / acpica / source / include / acparser.h
blob7f236d8605f1e19caadadfcfc216d1844e9f353c
1 /******************************************************************************
3 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2013, 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.
45 #ifndef __ACPARSER_H__
46 #define __ACPARSER_H__
49 #define OP_HAS_RETURN_VALUE 1
51 /* Variable number of arguments. This field must be 32 bits */
53 #define ACPI_VAR_ARGS ACPI_UINT32_MAX
56 #define ACPI_PARSE_DELETE_TREE 0x0001
57 #define ACPI_PARSE_NO_TREE_DELETE 0x0000
58 #define ACPI_PARSE_TREE_MASK 0x0001
60 #define ACPI_PARSE_LOAD_PASS1 0x0010
61 #define ACPI_PARSE_LOAD_PASS2 0x0020
62 #define ACPI_PARSE_EXECUTE 0x0030
63 #define ACPI_PARSE_MODE_MASK 0x0030
65 #define ACPI_PARSE_DEFERRED_OP 0x0100
66 #define ACPI_PARSE_DISASSEMBLE 0x0200
68 #define ACPI_PARSE_MODULE_LEVEL 0x0400
70 /******************************************************************************
72 * Parser interfaces
74 *****************************************************************************/
78 * psxface - Parser external interfaces
80 ACPI_STATUS
81 AcpiPsExecuteMethod (
82 ACPI_EVALUATE_INFO *Info);
86 * psargs - Parse AML opcode arguments
88 UINT8 *
89 AcpiPsGetNextPackageEnd (
90 ACPI_PARSE_STATE *ParserState);
92 char *
93 AcpiPsGetNextNamestring (
94 ACPI_PARSE_STATE *ParserState);
96 void
97 AcpiPsGetNextSimpleArg (
98 ACPI_PARSE_STATE *ParserState,
99 UINT32 ArgType,
100 ACPI_PARSE_OBJECT *Arg);
102 ACPI_STATUS
103 AcpiPsGetNextNamepath (
104 ACPI_WALK_STATE *WalkState,
105 ACPI_PARSE_STATE *ParserState,
106 ACPI_PARSE_OBJECT *Arg,
107 BOOLEAN MethodCall);
109 ACPI_STATUS
110 AcpiPsGetNextArg (
111 ACPI_WALK_STATE *WalkState,
112 ACPI_PARSE_STATE *ParserState,
113 UINT32 ArgType,
114 ACPI_PARSE_OBJECT **ReturnArg);
118 * psfind
120 ACPI_PARSE_OBJECT *
121 AcpiPsFindName (
122 ACPI_PARSE_OBJECT *Scope,
123 UINT32 Name,
124 UINT32 Opcode);
126 ACPI_PARSE_OBJECT*
127 AcpiPsGetParent (
128 ACPI_PARSE_OBJECT *Op);
132 * psobject - support for parse object processing
134 ACPI_STATUS
135 AcpiPsBuildNamedOp (
136 ACPI_WALK_STATE *WalkState,
137 UINT8 *AmlOpStart,
138 ACPI_PARSE_OBJECT *UnnamedOp,
139 ACPI_PARSE_OBJECT **Op);
141 ACPI_STATUS
142 AcpiPsCreateOp (
143 ACPI_WALK_STATE *WalkState,
144 UINT8 *AmlOpStart,
145 ACPI_PARSE_OBJECT **NewOp);
147 ACPI_STATUS
148 AcpiPsCompleteOp (
149 ACPI_WALK_STATE *WalkState,
150 ACPI_PARSE_OBJECT **Op,
151 ACPI_STATUS Status);
153 ACPI_STATUS
154 AcpiPsCompleteFinalOp (
155 ACPI_WALK_STATE *WalkState,
156 ACPI_PARSE_OBJECT *Op,
157 ACPI_STATUS Status);
161 * psopinfo - AML Opcode information
163 const ACPI_OPCODE_INFO *
164 AcpiPsGetOpcodeInfo (
165 UINT16 Opcode);
167 char *
168 AcpiPsGetOpcodeName (
169 UINT16 Opcode);
171 UINT8
172 AcpiPsGetArgumentCount (
173 UINT32 OpType);
177 * psparse - top level parsing routines
179 ACPI_STATUS
180 AcpiPsParseAml (
181 ACPI_WALK_STATE *WalkState);
183 UINT32
184 AcpiPsGetOpcodeSize (
185 UINT32 Opcode);
187 UINT16
188 AcpiPsPeekOpcode (
189 ACPI_PARSE_STATE *state);
191 ACPI_STATUS
192 AcpiPsCompleteThisOp (
193 ACPI_WALK_STATE *WalkState,
194 ACPI_PARSE_OBJECT *Op);
196 ACPI_STATUS
197 AcpiPsNextParseState (
198 ACPI_WALK_STATE *WalkState,
199 ACPI_PARSE_OBJECT *Op,
200 ACPI_STATUS CallbackStatus);
204 * psloop - main parse loop
206 ACPI_STATUS
207 AcpiPsParseLoop (
208 ACPI_WALK_STATE *WalkState);
212 * psscope - Scope stack management routines
214 ACPI_STATUS
215 AcpiPsInitScope (
216 ACPI_PARSE_STATE *ParserState,
217 ACPI_PARSE_OBJECT *Root);
219 ACPI_PARSE_OBJECT *
220 AcpiPsGetParentScope (
221 ACPI_PARSE_STATE *state);
223 BOOLEAN
224 AcpiPsHasCompletedScope (
225 ACPI_PARSE_STATE *ParserState);
227 void
228 AcpiPsPopScope (
229 ACPI_PARSE_STATE *ParserState,
230 ACPI_PARSE_OBJECT **Op,
231 UINT32 *ArgList,
232 UINT32 *ArgCount);
234 ACPI_STATUS
235 AcpiPsPushScope (
236 ACPI_PARSE_STATE *ParserState,
237 ACPI_PARSE_OBJECT *Op,
238 UINT32 RemainingArgs,
239 UINT32 ArgCount);
241 void
242 AcpiPsCleanupScope (
243 ACPI_PARSE_STATE *state);
247 * pstree - parse tree manipulation routines
249 void
250 AcpiPsAppendArg(
251 ACPI_PARSE_OBJECT *op,
252 ACPI_PARSE_OBJECT *arg);
254 ACPI_PARSE_OBJECT*
255 AcpiPsFind (
256 ACPI_PARSE_OBJECT *Scope,
257 char *Path,
258 UINT16 Opcode,
259 UINT32 Create);
261 ACPI_PARSE_OBJECT *
262 AcpiPsGetArg(
263 ACPI_PARSE_OBJECT *op,
264 UINT32 argn);
266 ACPI_PARSE_OBJECT *
267 AcpiPsGetDepthNext (
268 ACPI_PARSE_OBJECT *Origin,
269 ACPI_PARSE_OBJECT *Op);
273 * pswalk - parse tree walk routines
275 ACPI_STATUS
276 AcpiPsWalkParsedAml (
277 ACPI_PARSE_OBJECT *StartOp,
278 ACPI_PARSE_OBJECT *EndOp,
279 ACPI_OPERAND_OBJECT *MthDesc,
280 ACPI_NAMESPACE_NODE *StartNode,
281 ACPI_OPERAND_OBJECT **Params,
282 ACPI_OPERAND_OBJECT **CallerReturnDesc,
283 ACPI_OWNER_ID OwnerId,
284 ACPI_PARSE_DOWNWARDS DescendingCallback,
285 ACPI_PARSE_UPWARDS AscendingCallback);
287 ACPI_STATUS
288 AcpiPsGetNextWalkOp (
289 ACPI_WALK_STATE *WalkState,
290 ACPI_PARSE_OBJECT *Op,
291 ACPI_PARSE_UPWARDS AscendingCallback);
293 ACPI_STATUS
294 AcpiPsDeleteCompletedOp (
295 ACPI_WALK_STATE *WalkState);
297 void
298 AcpiPsDeleteParseTree (
299 ACPI_PARSE_OBJECT *root);
303 * psutils - parser utilities
305 ACPI_PARSE_OBJECT *
306 AcpiPsCreateScopeOp (
307 void);
309 void
310 AcpiPsInitOp (
311 ACPI_PARSE_OBJECT *op,
312 UINT16 opcode);
314 ACPI_PARSE_OBJECT *
315 AcpiPsAllocOp (
316 UINT16 opcode);
318 void
319 AcpiPsFreeOp (
320 ACPI_PARSE_OBJECT *Op);
322 BOOLEAN
323 AcpiPsIsLeadingChar (
324 UINT32 c);
326 UINT32
327 AcpiPsGetName(
328 ACPI_PARSE_OBJECT *op);
330 void
331 AcpiPsSetName(
332 ACPI_PARSE_OBJECT *op,
333 UINT32 name);
337 * psdump - display parser tree
339 UINT32
340 AcpiPsSprintPath (
341 char *BufferStart,
342 UINT32 BufferSize,
343 ACPI_PARSE_OBJECT *Op);
345 UINT32
346 AcpiPsSprintOp (
347 char *BufferStart,
348 UINT32 BufferSize,
349 ACPI_PARSE_OBJECT *Op);
351 void
352 AcpiPsShow (
353 ACPI_PARSE_OBJECT *op);
356 #endif /* __ACPARSER_H__ */