1 /******************************************************************************
3 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef __ACPARSER_H__
28 #define __ACPARSER_H__
31 #define OP_HAS_RETURN_VALUE 1
33 /* variable # arguments */
35 #define ACPI_VAR_ARGS ACPI_UINT32_MAX
37 /* maximum virtual address */
39 #define ACPI_MAX_AML ((u8 *)(~0UL))
42 #define ACPI_PARSE_DELETE_TREE 0x0001
43 #define ACPI_PARSE_NO_TREE_DELETE 0x0000
44 #define ACPI_PARSE_TREE_MASK 0x0001
46 #define ACPI_PARSE_LOAD_PASS1 0x0010
47 #define ACPI_PARSE_LOAD_PASS2 0x0020
48 #define ACPI_PARSE_EXECUTE 0x0030
49 #define ACPI_PARSE_MODE_MASK 0x0030
51 /* psapi - Parser external interfaces */
60 acpi_namespace_node *method_node,
61 acpi_operand_object **params,
62 acpi_operand_object **return_obj_desc);
64 /******************************************************************************
68 *****************************************************************************/
71 /* psargs - Parse AML opcode arguments */
74 acpi_ps_get_next_package_end (
75 acpi_parse_state *parser_state);
78 acpi_ps_get_next_package_length (
79 acpi_parse_state *parser_state);
82 acpi_ps_get_next_namestring (
83 acpi_parse_state *parser_state);
86 acpi_ps_get_next_simple_arg (
87 acpi_parse_state *parser_state,
88 u32 arg_type, /* type of argument */
89 acpi_parse_object *arg); /* (OUT) argument data */
92 acpi_ps_get_next_namepath (
93 acpi_parse_state *parser_state,
94 acpi_parse_object *arg,
99 acpi_ps_get_next_field (
100 acpi_parse_state *parser_state);
103 acpi_ps_get_next_arg (
104 acpi_parse_state *parser_state,
109 /* psopcode - AML Opcode information */
111 const acpi_opcode_info *
112 acpi_ps_get_opcode_info (
116 acpi_ps_get_opcode_name (
120 /* psparse - top level parsing routines */
123 acpi_ps_find_object (
124 acpi_walk_state *walk_state,
125 acpi_parse_object **out_op);
128 acpi_ps_delete_parse_tree (
129 acpi_parse_object *root);
133 acpi_walk_state *walk_state);
137 acpi_walk_state *walk_state);
140 acpi_ps_parse_table (
143 acpi_parse_downwards descending_callback,
144 acpi_parse_upwards ascending_callback,
145 acpi_parse_object **root_object);
148 acpi_ps_peek_opcode (
149 acpi_parse_state *state);
152 /* psscope - Scope stack management routines */
157 acpi_parse_state *parser_state,
158 acpi_parse_object *root);
161 acpi_ps_get_parent_scope (
162 acpi_parse_state *state);
165 acpi_ps_has_completed_scope (
166 acpi_parse_state *parser_state);
170 acpi_parse_state *parser_state,
171 acpi_parse_object **op,
177 acpi_parse_state *parser_state,
178 acpi_parse_object *op,
183 acpi_ps_cleanup_scope (
184 acpi_parse_state *state);
187 /* pstree - parse tree manipulation routines */
191 acpi_parse_object *op,
192 acpi_parse_object *arg);
196 acpi_parse_object *scope,
203 acpi_parse_object *op,
208 acpi_parse_object *op);
211 acpi_ps_get_depth_next (
212 acpi_parse_object *origin,
213 acpi_parse_object *op);
216 /* pswalk - parse tree walk routines */
219 acpi_ps_walk_parsed_aml (
220 acpi_parse_object *start_op,
221 acpi_parse_object *end_op,
222 acpi_operand_object *mth_desc,
223 acpi_namespace_node *start_node,
224 acpi_operand_object **params,
225 acpi_operand_object **caller_return_desc,
226 acpi_owner_id owner_id,
227 acpi_parse_downwards descending_callback,
228 acpi_parse_upwards ascending_callback);
231 acpi_ps_get_next_walk_op (
232 acpi_walk_state *walk_state,
233 acpi_parse_object *op,
234 acpi_parse_upwards ascending_callback);
237 /* psutils - parser utilities */
241 acpi_parse_object *op,
250 acpi_parse_object *op);
253 acpi_ps_delete_parse_cache (
257 acpi_ps_is_leading_char (
261 acpi_ps_is_prefix_char (
266 acpi_parse_object *op);
270 acpi_parse_object *op,
274 /* psdump - display parser tree */
277 acpi_ps_sprint_path (
278 NATIVE_CHAR *buffer_start,
280 acpi_parse_object *op);
284 NATIVE_CHAR *buffer_start,
286 acpi_parse_object *op);
290 acpi_parse_object *op);
293 #endif /* __ACPARSER_H__ */