aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/acparser.h')
-rw-r--r--include/acpi/acparser.h248
1 files changed, 75 insertions, 173 deletions
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index f692ad56cd82..d352d40de1f3 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -41,18 +41,15 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#ifndef __ACPARSER_H__ 44#ifndef __ACPARSER_H__
46#define __ACPARSER_H__ 45#define __ACPARSER_H__
47 46
48
49#define OP_HAS_RETURN_VALUE 1 47#define OP_HAS_RETURN_VALUE 1
50 48
51/* variable # arguments */ 49/* variable # arguments */
52 50
53#define ACPI_VAR_ARGS ACPI_UINT32_MAX 51#define ACPI_VAR_ARGS ACPI_UINT32_MAX
54 52
55
56#define ACPI_PARSE_DELETE_TREE 0x0001 53#define ACPI_PARSE_DELETE_TREE 0x0001
57#define ACPI_PARSE_NO_TREE_DELETE 0x0000 54#define ACPI_PARSE_NO_TREE_DELETE 0x0000
58#define ACPI_PARSE_TREE_MASK 0x0001 55#define ACPI_PARSE_TREE_MASK 0x0001
@@ -65,266 +62,171 @@
65#define ACPI_PARSE_DEFERRED_OP 0x0100 62#define ACPI_PARSE_DEFERRED_OP 0x0100
66#define ACPI_PARSE_DISASSEMBLE 0x0200 63#define ACPI_PARSE_DISASSEMBLE 0x0200
67 64
68
69/****************************************************************************** 65/******************************************************************************
70 * 66 *
71 * Parser interfaces 67 * Parser interfaces
72 * 68 *
73 *****************************************************************************/ 69 *****************************************************************************/
74 70
75
76/* 71/*
77 * psxface - Parser external interfaces 72 * psxface - Parser external interfaces
78 */ 73 */
79acpi_status 74acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info);
80acpi_ps_execute_method (
81 struct acpi_parameter_info *info);
82
83 75
84/* 76/*
85 * psargs - Parse AML opcode arguments 77 * psargs - Parse AML opcode arguments
86 */ 78 */
87u8 * 79u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state);
88acpi_ps_get_next_package_end (
89 struct acpi_parse_state *parser_state);
90 80
91char * 81char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state);
92acpi_ps_get_next_namestring (
93 struct acpi_parse_state *parser_state);
94 82
95void 83void
96acpi_ps_get_next_simple_arg ( 84acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
97 struct acpi_parse_state *parser_state, 85 u32 arg_type, union acpi_parse_object *arg);
98 u32 arg_type,
99 union acpi_parse_object *arg);
100 86
101acpi_status 87acpi_status
102acpi_ps_get_next_namepath ( 88acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
103 struct acpi_walk_state *walk_state, 89 struct acpi_parse_state *parser_state,
104 struct acpi_parse_state *parser_state, 90 union acpi_parse_object *arg, u8 method_call);
105 union acpi_parse_object *arg,
106 u8 method_call);
107 91
108acpi_status 92acpi_status
109acpi_ps_get_next_arg ( 93acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
110 struct acpi_walk_state *walk_state, 94 struct acpi_parse_state *parser_state,
111 struct acpi_parse_state *parser_state, 95 u32 arg_type, union acpi_parse_object **return_arg);
112 u32 arg_type,
113 union acpi_parse_object **return_arg);
114
115 96
116/* 97/*
117 * psfind 98 * psfind
118 */ 99 */
119union acpi_parse_object * 100union acpi_parse_object *acpi_ps_find_name(union acpi_parse_object *scope,
120acpi_ps_find_name ( 101 u32 name, u32 opcode);
121 union acpi_parse_object *scope,
122 u32 name,
123 u32 opcode);
124
125union acpi_parse_object*
126acpi_ps_get_parent (
127 union acpi_parse_object *op);
128 102
103union acpi_parse_object *acpi_ps_get_parent(union acpi_parse_object *op);
129 104
130/* 105/*
131 * psopcode - AML Opcode information 106 * psopcode - AML Opcode information
132 */ 107 */
133const struct acpi_opcode_info * 108const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
134acpi_ps_get_opcode_info (
135 u16 opcode);
136
137char *
138acpi_ps_get_opcode_name (
139 u16 opcode);
140 109
110char *acpi_ps_get_opcode_name(u16 opcode);
141 111
142/* 112/*
143 * psparse - top level parsing routines 113 * psparse - top level parsing routines
144 */ 114 */
145acpi_status 115acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state);
146acpi_ps_parse_aml (
147 struct acpi_walk_state *walk_state);
148 116
149u32 117u32 acpi_ps_get_opcode_size(u32 opcode);
150acpi_ps_get_opcode_size (
151 u32 opcode);
152 118
153u16 119u16 acpi_ps_peek_opcode(struct acpi_parse_state *state);
154acpi_ps_peek_opcode (
155 struct acpi_parse_state *state);
156 120
157acpi_status 121acpi_status
158acpi_ps_complete_this_op ( 122acpi_ps_complete_this_op(struct acpi_walk_state *walk_state,
159 struct acpi_walk_state *walk_state, 123 union acpi_parse_object *op);
160 union acpi_parse_object *op);
161 124
162acpi_status 125acpi_status
163acpi_ps_next_parse_state ( 126acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
164 struct acpi_walk_state *walk_state, 127 union acpi_parse_object *op,
165 union acpi_parse_object *op, 128 acpi_status callback_status);
166 acpi_status callback_status);
167
168 129
169/* 130/*
170 * psloop - main parse loop 131 * psloop - main parse loop
171 */ 132 */
172acpi_status 133acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state);
173acpi_ps_parse_loop (
174 struct acpi_walk_state *walk_state);
175
176 134
177/* 135/*
178 * psscope - Scope stack management routines 136 * psscope - Scope stack management routines
179 */ 137 */
180acpi_status 138acpi_status
181acpi_ps_init_scope ( 139acpi_ps_init_scope(struct acpi_parse_state *parser_state,
182 struct acpi_parse_state *parser_state, 140 union acpi_parse_object *root);
183 union acpi_parse_object *root);
184 141
185union acpi_parse_object * 142union acpi_parse_object *acpi_ps_get_parent_scope(struct acpi_parse_state
186acpi_ps_get_parent_scope ( 143 *state);
187 struct acpi_parse_state *state);
188 144
189u8 145u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state);
190acpi_ps_has_completed_scope (
191 struct acpi_parse_state *parser_state);
192 146
193void 147void
194acpi_ps_pop_scope ( 148acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
195 struct acpi_parse_state *parser_state, 149 union acpi_parse_object **op,
196 union acpi_parse_object **op, 150 u32 * arg_list, u32 * arg_count);
197 u32 *arg_list,
198 u32 *arg_count);
199 151
200acpi_status 152acpi_status
201acpi_ps_push_scope ( 153acpi_ps_push_scope(struct acpi_parse_state *parser_state,
202 struct acpi_parse_state *parser_state, 154 union acpi_parse_object *op,
203 union acpi_parse_object *op, 155 u32 remaining_args, u32 arg_count);
204 u32 remaining_args,
205 u32 arg_count);
206
207void
208acpi_ps_cleanup_scope (
209 struct acpi_parse_state *state);
210 156
157void acpi_ps_cleanup_scope(struct acpi_parse_state *state);
211 158
212/* 159/*
213 * pstree - parse tree manipulation routines 160 * pstree - parse tree manipulation routines
214 */ 161 */
215void 162void
216acpi_ps_append_arg( 163acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg);
217 union acpi_parse_object *op,
218 union acpi_parse_object *arg);
219
220union acpi_parse_object*
221acpi_ps_find (
222 union acpi_parse_object *scope,
223 char *path,
224 u16 opcode,
225 u32 create);
226
227union acpi_parse_object *
228acpi_ps_get_arg(
229 union acpi_parse_object *op,
230 u32 argn);
231 164
232#ifdef ACPI_FUTURE_USAGE 165union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope,
233union acpi_parse_object * 166 char *path, u16 opcode, u32 create);
234acpi_ps_get_depth_next ( 167
235 union acpi_parse_object *origin, 168union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn);
236 union acpi_parse_object *op);
237#endif /* ACPI_FUTURE_USAGE */
238 169
170#ifdef ACPI_FUTURE_USAGE
171union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
172 union acpi_parse_object *op);
173#endif /* ACPI_FUTURE_USAGE */
239 174
240/* 175/*
241 * pswalk - parse tree walk routines 176 * pswalk - parse tree walk routines
242 */ 177 */
243acpi_status 178acpi_status
244acpi_ps_walk_parsed_aml ( 179acpi_ps_walk_parsed_aml(union acpi_parse_object *start_op,
245 union acpi_parse_object *start_op, 180 union acpi_parse_object *end_op,
246 union acpi_parse_object *end_op, 181 union acpi_operand_object *mth_desc,
247 union acpi_operand_object *mth_desc, 182 struct acpi_namespace_node *start_node,
248 struct acpi_namespace_node *start_node, 183 union acpi_operand_object **params,
249 union acpi_operand_object **params, 184 union acpi_operand_object **caller_return_desc,
250 union acpi_operand_object **caller_return_desc, 185 acpi_owner_id owner_id,
251 acpi_owner_id owner_id, 186 acpi_parse_downwards descending_callback,
252 acpi_parse_downwards descending_callback, 187 acpi_parse_upwards ascending_callback);
253 acpi_parse_upwards ascending_callback);
254
255acpi_status
256acpi_ps_get_next_walk_op (
257 struct acpi_walk_state *walk_state,
258 union acpi_parse_object *op,
259 acpi_parse_upwards ascending_callback);
260 188
261acpi_status 189acpi_status
262acpi_ps_delete_completed_op ( 190acpi_ps_get_next_walk_op(struct acpi_walk_state *walk_state,
263 struct acpi_walk_state *walk_state); 191 union acpi_parse_object *op,
192 acpi_parse_upwards ascending_callback);
264 193
265void 194acpi_status acpi_ps_delete_completed_op(struct acpi_walk_state *walk_state);
266acpi_ps_delete_parse_tree (
267 union acpi_parse_object *root);
268 195
196void acpi_ps_delete_parse_tree(union acpi_parse_object *root);
269 197
270/* 198/*
271 * psutils - parser utilities 199 * psutils - parser utilities
272 */ 200 */
273union acpi_parse_object * 201union acpi_parse_object *acpi_ps_create_scope_op(void);
274acpi_ps_create_scope_op (
275 void);
276 202
277void 203void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode);
278acpi_ps_init_op (
279 union acpi_parse_object *op,
280 u16 opcode);
281 204
282union acpi_parse_object * 205union acpi_parse_object *acpi_ps_alloc_op(u16 opcode);
283acpi_ps_alloc_op (
284 u16 opcode);
285 206
286void 207void acpi_ps_free_op(union acpi_parse_object *op);
287acpi_ps_free_op (
288 union acpi_parse_object *op);
289 208
290u8 209u8 acpi_ps_is_leading_char(u32 c);
291acpi_ps_is_leading_char (
292 u32 c);
293 210
294u8 211u8 acpi_ps_is_prefix_char(u32 c);
295acpi_ps_is_prefix_char (
296 u32 c);
297 212
298#ifdef ACPI_FUTURE_USAGE 213#ifdef ACPI_FUTURE_USAGE
299u32 214u32 acpi_ps_get_name(union acpi_parse_object *op);
300acpi_ps_get_name( 215#endif /* ACPI_FUTURE_USAGE */
301 union acpi_parse_object *op);
302#endif /* ACPI_FUTURE_USAGE */
303
304void
305acpi_ps_set_name(
306 union acpi_parse_object *op,
307 u32 name);
308 216
217void acpi_ps_set_name(union acpi_parse_object *op, u32 name);
309 218
310/* 219/*
311 * psdump - display parser tree 220 * psdump - display parser tree
312 */ 221 */
313u32 222u32
314acpi_ps_sprint_path ( 223acpi_ps_sprint_path(char *buffer_start,
315 char *buffer_start, 224 u32 buffer_size, union acpi_parse_object *op);
316 u32 buffer_size,
317 union acpi_parse_object *op);
318 225
319u32 226u32
320acpi_ps_sprint_op ( 227acpi_ps_sprint_op(char *buffer_start,
321 char *buffer_start, 228 u32 buffer_size, union acpi_parse_object *op);
322 u32 buffer_size,
323 union acpi_parse_object *op);
324
325void
326acpi_ps_show (
327 union acpi_parse_object *op);
328 229
230void acpi_ps_show(union acpi_parse_object *op);
329 231
330#endif /* __ACPARSER_H__ */ 232#endif /* __ACPARSER_H__ */