import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / drivers / acpi / include / acdispat.h
1 /******************************************************************************
2  *
3  * Name: acdispat.h - dispatcher (parser to interpreter interface)
4  *       $Revision: 1.1.1.1 $
5  *
6  *****************************************************************************/
7
8 /*
9  *  Copyright (C) 2000, 2001 R. Byron Moore
10  *
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.
15  *
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.
20  *
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
24  */
25
26
27 #ifndef _ACDISPAT_H_
28 #define _ACDISPAT_H_
29
30
31 #define NAMEOF_LOCAL_NTE    "__L0"
32 #define NAMEOF_ARG_NTE      "__A0"
33
34
35 /* Common interfaces */
36
37 acpi_status
38 acpi_ds_obj_stack_push (
39         void                    *object,
40         acpi_walk_state         *walk_state);
41
42 acpi_status
43 acpi_ds_obj_stack_pop (
44         u32                     pop_count,
45         acpi_walk_state         *walk_state);
46
47 void *
48 acpi_ds_obj_stack_get_value (
49         u32                     index,
50         acpi_walk_state         *walk_state);
51
52 acpi_status
53 acpi_ds_obj_stack_pop_object (
54         acpi_operand_object     **object,
55         acpi_walk_state         *walk_state);
56
57
58 /* dsopcode - support for late evaluation */
59
60 acpi_status
61 acpi_ds_get_buffer_field_arguments (
62         acpi_operand_object     *obj_desc);
63
64 acpi_status
65 acpi_ds_get_region_arguments (
66         acpi_operand_object     *rgn_desc);
67
68
69 /* dsctrl - Parser/Interpreter interface, control stack routines */
70
71
72 acpi_status
73 acpi_ds_exec_begin_control_op (
74         acpi_walk_state         *walk_state,
75         acpi_parse_object       *op);
76
77 acpi_status
78 acpi_ds_exec_end_control_op (
79         acpi_walk_state         *walk_state,
80         acpi_parse_object       *op);
81
82
83 /* dsexec - Parser/Interpreter interface, method execution callbacks */
84
85
86 acpi_status
87 acpi_ds_get_predicate_value (
88         acpi_walk_state         *walk_state,
89         u32                     has_result_obj);
90
91 acpi_status
92 acpi_ds_exec_begin_op (
93         acpi_walk_state         *walk_state,
94         acpi_parse_object       **out_op);
95
96 acpi_status
97 acpi_ds_exec_end_op (
98         acpi_walk_state         *state);
99
100
101 /* dsfield - Parser/Interpreter interface for AML fields */
102
103 acpi_status
104 acpi_ds_create_field (
105         acpi_parse_object       *op,
106         acpi_namespace_node     *region_node,
107         acpi_walk_state         *walk_state);
108
109 acpi_status
110 acpi_ds_create_bank_field (
111         acpi_parse_object       *op,
112         acpi_namespace_node     *region_node,
113         acpi_walk_state         *walk_state);
114
115 acpi_status
116 acpi_ds_create_index_field (
117         acpi_parse_object       *op,
118         acpi_namespace_node     *region_node,
119         acpi_walk_state         *walk_state);
120
121 acpi_status
122 acpi_ds_create_buffer_field (
123         acpi_parse_object       *op,
124         acpi_walk_state         *walk_state);
125
126
127 /* dsload - Parser/Interpreter interface, namespace load callbacks */
128
129 acpi_status
130 acpi_ds_load1_begin_op (
131         acpi_walk_state         *walk_state,
132         acpi_parse_object       **out_op);
133
134 acpi_status
135 acpi_ds_load1_end_op (
136         acpi_walk_state         *walk_state);
137
138 acpi_status
139 acpi_ds_load2_begin_op (
140         acpi_walk_state         *walk_state,
141         acpi_parse_object       **out_op);
142
143 acpi_status
144 acpi_ds_load2_end_op (
145         acpi_walk_state         *walk_state);
146
147 acpi_status
148 acpi_ds_init_callbacks (
149         acpi_walk_state         *walk_state,
150         u32                     pass_number);
151
152
153 /* dsmthdat - method data (locals/args) */
154
155
156 acpi_status
157 acpi_ds_store_object_to_local (
158         u16                     opcode,
159         u32                     index,
160         acpi_operand_object     *src_desc,
161         acpi_walk_state         *walk_state);
162
163 acpi_status
164 acpi_ds_method_data_get_entry (
165         u16                     opcode,
166         u32                     index,
167         acpi_walk_state         *walk_state,
168         acpi_operand_object     ***node);
169
170 acpi_status
171 acpi_ds_method_data_delete_all (
172         acpi_walk_state         *walk_state);
173
174 u8
175 acpi_ds_is_method_value (
176         acpi_operand_object     *obj_desc);
177
178 acpi_object_type8
179 acpi_ds_method_data_get_type (
180         u16                     opcode,
181         u32                     index,
182         acpi_walk_state         *walk_state);
183
184 acpi_status
185 acpi_ds_method_data_get_value (
186         u16                     opcode,
187         u32                     index,
188         acpi_walk_state         *walk_state,
189         acpi_operand_object     **dest_desc);
190
191 acpi_status
192 acpi_ds_method_data_delete_value (
193         u16                     opcode,
194         u32                     index,
195         acpi_walk_state         *walk_state);
196
197 acpi_status
198 acpi_ds_method_data_init_args (
199         acpi_operand_object     **params,
200         u32                     max_param_count,
201         acpi_walk_state         *walk_state);
202
203 acpi_namespace_node *
204 acpi_ds_method_data_get_node (
205         u16                     opcode,
206         u32                     index,
207         acpi_walk_state         *walk_state);
208
209 acpi_status
210 acpi_ds_method_data_init (
211         acpi_walk_state         *walk_state);
212
213 acpi_status
214 acpi_ds_method_data_set_entry (
215         u16                     opcode,
216         u32                     index,
217         acpi_operand_object     *object,
218         acpi_walk_state         *walk_state);
219
220
221 /* dsmethod - Parser/Interpreter interface - control method parsing */
222
223 acpi_status
224 acpi_ds_parse_method (
225         acpi_handle             obj_handle);
226
227 acpi_status
228 acpi_ds_call_control_method (
229         acpi_walk_list          *walk_list,
230         acpi_walk_state         *walk_state,
231         acpi_parse_object       *op);
232
233 acpi_status
234 acpi_ds_restart_control_method (
235         acpi_walk_state         *walk_state,
236         acpi_operand_object     *return_desc);
237
238 acpi_status
239 acpi_ds_terminate_control_method (
240         acpi_walk_state         *walk_state);
241
242 acpi_status
243 acpi_ds_begin_method_execution (
244         acpi_namespace_node     *method_node,
245         acpi_operand_object     *obj_desc,
246         acpi_namespace_node     *calling_method_node);
247
248
249 /* dsobj - Parser/Interpreter interface - object initialization and conversion */
250
251 acpi_status
252 acpi_ds_init_one_object (
253         acpi_handle             obj_handle,
254         u32                     level,
255         void                    *context,
256         void                    **return_value);
257
258 acpi_status
259 acpi_ds_initialize_objects (
260         acpi_table_desc         *table_desc,
261         acpi_namespace_node     *start_node);
262
263 acpi_status
264 acpi_ds_build_internal_package_obj (
265         acpi_walk_state         *walk_state,
266         acpi_parse_object       *op,
267         acpi_operand_object     **obj_desc);
268
269 acpi_status
270 acpi_ds_build_internal_object (
271         acpi_walk_state         *walk_state,
272         acpi_parse_object       *op,
273         acpi_operand_object     **obj_desc_ptr);
274
275 acpi_status
276 acpi_ds_init_object_from_op (
277         acpi_walk_state         *walk_state,
278         acpi_parse_object       *op,
279         u16                     opcode,
280         acpi_operand_object     **obj_desc);
281
282 acpi_status
283 acpi_ds_create_node (
284         acpi_walk_state         *walk_state,
285         acpi_namespace_node     *node,
286         acpi_parse_object       *op);
287
288
289 /* dsregn - Parser/Interpreter interface - Op Region parsing */
290
291 acpi_status
292 acpi_ds_eval_buffer_field_operands (
293         acpi_walk_state         *walk_state,
294         acpi_parse_object       *op);
295
296 acpi_status
297 acpi_ds_eval_region_operands (
298         acpi_walk_state         *walk_state,
299         acpi_parse_object       *op);
300
301 acpi_status
302 acpi_ds_initialize_region (
303         acpi_handle             obj_handle);
304
305
306 /* dsutils - Parser/Interpreter interface utility routines */
307
308 u8
309 acpi_ds_is_result_used (
310         acpi_parse_object       *op,
311         acpi_walk_state         *walk_state);
312
313 void
314 acpi_ds_delete_result_if_not_used (
315         acpi_parse_object       *op,
316         acpi_operand_object     *result_obj,
317         acpi_walk_state         *walk_state);
318
319 acpi_status
320 acpi_ds_create_operand (
321         acpi_walk_state         *walk_state,
322         acpi_parse_object       *arg,
323         u32                     args_remaining);
324
325 acpi_status
326 acpi_ds_create_operands (
327         acpi_walk_state         *walk_state,
328         acpi_parse_object       *first_arg);
329
330 acpi_status
331 acpi_ds_resolve_operands (
332         acpi_walk_state         *walk_state);
333
334 acpi_object_type8
335 acpi_ds_map_opcode_to_data_type (
336         u16                     opcode,
337         u32                     *out_flags);
338
339 acpi_object_type8
340 acpi_ds_map_named_opcode_to_data_type (
341         u16                     opcode);
342
343
344 /*
345  * dswscope - Scope Stack manipulation
346  */
347
348 acpi_status
349 acpi_ds_scope_stack_push (
350         acpi_namespace_node     *node,
351         acpi_object_type8       type,
352         acpi_walk_state         *walk_state);
353
354
355 acpi_status
356 acpi_ds_scope_stack_pop (
357         acpi_walk_state         *walk_state);
358
359 void
360 acpi_ds_scope_stack_clear (
361         acpi_walk_state         *walk_state);
362
363
364 /* dswstate - parser WALK_STATE management routines */
365
366 acpi_walk_state *
367 acpi_ds_create_walk_state (
368         acpi_owner_id           owner_id,
369         acpi_parse_object       *origin,
370         acpi_operand_object     *mth_desc,
371         acpi_walk_list          *walk_list);
372
373 acpi_status
374 acpi_ds_init_aml_walk (
375         acpi_walk_state         *walk_state,
376         acpi_parse_object       *op,
377         acpi_namespace_node     *method_node,
378         u8                      *aml_start,
379         u32                     aml_length,
380         acpi_operand_object     **params,
381         acpi_operand_object     **return_obj_desc,
382         u32                     pass_number);
383
384 acpi_status
385 acpi_ds_obj_stack_delete_all (
386         acpi_walk_state         *walk_state);
387
388 acpi_status
389 acpi_ds_obj_stack_pop_and_delete (
390         u32                     pop_count,
391         acpi_walk_state         *walk_state);
392
393 void
394 acpi_ds_delete_walk_state (
395         acpi_walk_state         *walk_state);
396
397 acpi_walk_state *
398 acpi_ds_pop_walk_state (
399         acpi_walk_list          *walk_list);
400
401 void
402 acpi_ds_push_walk_state (
403         acpi_walk_state         *walk_state,
404         acpi_walk_list          *walk_list);
405
406 acpi_status
407 acpi_ds_result_stack_pop (
408         acpi_walk_state         *walk_state);
409
410 acpi_status
411 acpi_ds_result_stack_push (
412         acpi_walk_state         *walk_state);
413
414 acpi_status
415 acpi_ds_result_stack_clear (
416         acpi_walk_state         *walk_state);
417
418 acpi_walk_state *
419 acpi_ds_get_current_walk_state (
420         acpi_walk_list          *walk_list);
421
422 void
423 acpi_ds_delete_walk_state_cache (
424         void);
425
426 acpi_status
427 acpi_ds_result_insert (
428         void                    *object,
429         u32                     index,
430         acpi_walk_state         *walk_state);
431
432 acpi_status
433 acpi_ds_result_remove (
434         acpi_operand_object     **object,
435         u32                     index,
436         acpi_walk_state         *walk_state);
437
438 acpi_status
439 acpi_ds_result_pop (
440         acpi_operand_object     **object,
441         acpi_walk_state         *walk_state);
442
443 acpi_status
444 acpi_ds_result_push (
445         acpi_operand_object     *object,
446         acpi_walk_state         *walk_state);
447
448 acpi_status
449 acpi_ds_result_pop_from_bottom (
450         acpi_operand_object     **object,
451         acpi_walk_state         *walk_state);
452
453 #endif /* _ACDISPAT_H_ */