MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / acpi / acdispat.h
blobe003a4f3ff4eaed11f01db8e946f3bc86c65ed29
1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2004, R. Byron Moore
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 _ACDISPAT_H_
46 #define _ACDISPAT_H_
49 #define NAMEOF_LOCAL_NTE "__L0"
50 #define NAMEOF_ARG_NTE "__A0"
53 /* Common interfaces */
55 acpi_status
56 acpi_ds_obj_stack_push (
57 void *object,
58 struct acpi_walk_state *walk_state);
60 acpi_status
61 acpi_ds_obj_stack_pop (
62 u32 pop_count,
63 struct acpi_walk_state *walk_state);
65 void *
66 acpi_ds_obj_stack_get_value (
67 u32 index,
68 struct acpi_walk_state *walk_state);
70 acpi_status
71 acpi_ds_obj_stack_pop_object (
72 union acpi_operand_object **object,
73 struct acpi_walk_state *walk_state);
76 /* dsopcode - support for late evaluation */
78 acpi_status
79 acpi_ds_execute_arguments (
80 struct acpi_namespace_node *node,
81 struct acpi_namespace_node *scope_node,
82 u32 aml_length,
83 u8 *aml_start);
85 acpi_status
86 acpi_ds_get_buffer_field_arguments (
87 union acpi_operand_object *obj_desc);
89 acpi_status
90 acpi_ds_get_region_arguments (
91 union acpi_operand_object *rgn_desc);
93 acpi_status
94 acpi_ds_get_buffer_arguments (
95 union acpi_operand_object *obj_desc);
97 acpi_status
98 acpi_ds_get_package_arguments (
99 union acpi_operand_object *obj_desc);
101 acpi_status
102 acpi_ds_init_buffer_field (
103 u16 aml_opcode,
104 union acpi_operand_object *obj_desc,
105 union acpi_operand_object *buffer_desc,
106 union acpi_operand_object *offset_desc,
107 union acpi_operand_object *length_desc,
108 union acpi_operand_object *result_desc);
110 acpi_status
111 acpi_ds_eval_buffer_field_operands (
112 struct acpi_walk_state *walk_state,
113 union acpi_parse_object *op);
115 acpi_status
116 acpi_ds_eval_region_operands (
117 struct acpi_walk_state *walk_state,
118 union acpi_parse_object *op);
120 acpi_status
121 acpi_ds_eval_data_object_operands (
122 struct acpi_walk_state *walk_state,
123 union acpi_parse_object *op,
124 union acpi_operand_object *obj_desc);
126 acpi_status
127 acpi_ds_initialize_region (
128 acpi_handle obj_handle);
131 /* dsctrl - Parser/Interpreter interface, control stack routines */
134 acpi_status
135 acpi_ds_exec_begin_control_op (
136 struct acpi_walk_state *walk_state,
137 union acpi_parse_object *op);
139 acpi_status
140 acpi_ds_exec_end_control_op (
141 struct acpi_walk_state *walk_state,
142 union acpi_parse_object *op);
145 /* dsexec - Parser/Interpreter interface, method execution callbacks */
148 acpi_status
149 acpi_ds_get_predicate_value (
150 struct acpi_walk_state *walk_state,
151 union acpi_operand_object *result_obj);
153 acpi_status
154 acpi_ds_exec_begin_op (
155 struct acpi_walk_state *walk_state,
156 union acpi_parse_object **out_op);
158 acpi_status
159 acpi_ds_exec_end_op (
160 struct acpi_walk_state *state);
163 /* dsfield - Parser/Interpreter interface for AML fields */
165 acpi_status
166 acpi_ds_get_field_names (
167 struct acpi_create_field_info *info,
168 struct acpi_walk_state *walk_state,
169 union acpi_parse_object *arg);
171 acpi_status
172 acpi_ds_create_field (
173 union acpi_parse_object *op,
174 struct acpi_namespace_node *region_node,
175 struct acpi_walk_state *walk_state);
177 acpi_status
178 acpi_ds_create_bank_field (
179 union acpi_parse_object *op,
180 struct acpi_namespace_node *region_node,
181 struct acpi_walk_state *walk_state);
183 acpi_status
184 acpi_ds_create_index_field (
185 union acpi_parse_object *op,
186 struct acpi_namespace_node *region_node,
187 struct acpi_walk_state *walk_state);
189 acpi_status
190 acpi_ds_create_buffer_field (
191 union acpi_parse_object *op,
192 struct acpi_walk_state *walk_state);
194 acpi_status
195 acpi_ds_init_field_objects (
196 union acpi_parse_object *op,
197 struct acpi_walk_state *walk_state);
200 /* dsload - Parser/Interpreter interface, namespace load callbacks */
202 acpi_status
203 acpi_ds_load1_begin_op (
204 struct acpi_walk_state *walk_state,
205 union acpi_parse_object **out_op);
207 acpi_status
208 acpi_ds_load1_end_op (
209 struct acpi_walk_state *walk_state);
211 acpi_status
212 acpi_ds_load2_begin_op (
213 struct acpi_walk_state *walk_state,
214 union acpi_parse_object **out_op);
216 acpi_status
217 acpi_ds_load2_end_op (
218 struct acpi_walk_state *walk_state);
220 acpi_status
221 acpi_ds_init_callbacks (
222 struct acpi_walk_state *walk_state,
223 u32 pass_number);
226 /* dsmthdat - method data (locals/args) */
229 acpi_status
230 acpi_ds_store_object_to_local (
231 u16 opcode,
232 u32 index,
233 union acpi_operand_object *src_desc,
234 struct acpi_walk_state *walk_state);
236 acpi_status
237 acpi_ds_method_data_get_entry (
238 u16 opcode,
239 u32 index,
240 struct acpi_walk_state *walk_state,
241 union acpi_operand_object ***node);
243 void
244 acpi_ds_method_data_delete_all (
245 struct acpi_walk_state *walk_state);
248 acpi_ds_is_method_value (
249 union acpi_operand_object *obj_desc);
251 acpi_object_type
252 acpi_ds_method_data_get_type (
253 u16 opcode,
254 u32 index,
255 struct acpi_walk_state *walk_state);
257 acpi_status
258 acpi_ds_method_data_get_value (
259 u16 opcode,
260 u32 index,
261 struct acpi_walk_state *walk_state,
262 union acpi_operand_object **dest_desc);
264 void
265 acpi_ds_method_data_delete_value (
266 u16 opcode,
267 u32 index,
268 struct acpi_walk_state *walk_state);
270 acpi_status
271 acpi_ds_method_data_init_args (
272 union acpi_operand_object **params,
273 u32 max_param_count,
274 struct acpi_walk_state *walk_state);
276 acpi_status
277 acpi_ds_method_data_get_node (
278 u16 opcode,
279 u32 index,
280 struct acpi_walk_state *walk_state,
281 struct acpi_namespace_node **node);
283 void
284 acpi_ds_method_data_init (
285 struct acpi_walk_state *walk_state);
287 acpi_status
288 acpi_ds_method_data_set_value (
289 u16 opcode,
290 u32 index,
291 union acpi_operand_object *object,
292 struct acpi_walk_state *walk_state);
295 /* dsmethod - Parser/Interpreter interface - control method parsing */
297 acpi_status
298 acpi_ds_parse_method (
299 acpi_handle obj_handle);
301 acpi_status
302 acpi_ds_call_control_method (
303 struct acpi_thread_state *thread,
304 struct acpi_walk_state *walk_state,
305 union acpi_parse_object *op);
307 acpi_status
308 acpi_ds_restart_control_method (
309 struct acpi_walk_state *walk_state,
310 union acpi_operand_object *return_desc);
312 acpi_status
313 acpi_ds_terminate_control_method (
314 struct acpi_walk_state *walk_state);
316 acpi_status
317 acpi_ds_begin_method_execution (
318 struct acpi_namespace_node *method_node,
319 union acpi_operand_object *obj_desc,
320 struct acpi_namespace_node *calling_method_node);
323 /* dsobj - Parser/Interpreter interface - object initialization and conversion */
325 acpi_status
326 acpi_ds_init_one_object (
327 acpi_handle obj_handle,
328 u32 level,
329 void *context,
330 void **return_value);
332 acpi_status
333 acpi_ds_initialize_objects (
334 struct acpi_table_desc *table_desc,
335 struct acpi_namespace_node *start_node);
337 acpi_status
338 acpi_ds_build_internal_buffer_obj (
339 struct acpi_walk_state *walk_state,
340 union acpi_parse_object *op,
341 u32 buffer_length,
342 union acpi_operand_object **obj_desc_ptr);
344 acpi_status
345 acpi_ds_build_internal_package_obj (
346 struct acpi_walk_state *walk_state,
347 union acpi_parse_object *op,
348 u32 package_length,
349 union acpi_operand_object **obj_desc);
351 acpi_status
352 acpi_ds_build_internal_object (
353 struct acpi_walk_state *walk_state,
354 union acpi_parse_object *op,
355 union acpi_operand_object **obj_desc_ptr);
357 acpi_status
358 acpi_ds_init_object_from_op (
359 struct acpi_walk_state *walk_state,
360 union acpi_parse_object *op,
361 u16 opcode,
362 union acpi_operand_object **obj_desc);
364 acpi_status
365 acpi_ds_create_node (
366 struct acpi_walk_state *walk_state,
367 struct acpi_namespace_node *node,
368 union acpi_parse_object *op);
371 /* dsutils - Parser/Interpreter interface utility routines */
374 acpi_ds_is_result_used (
375 union acpi_parse_object *op,
376 struct acpi_walk_state *walk_state);
378 void
379 acpi_ds_delete_result_if_not_used (
380 union acpi_parse_object *op,
381 union acpi_operand_object *result_obj,
382 struct acpi_walk_state *walk_state);
384 acpi_status
385 acpi_ds_create_operand (
386 struct acpi_walk_state *walk_state,
387 union acpi_parse_object *arg,
388 u32 args_remaining);
390 acpi_status
391 acpi_ds_create_operands (
392 struct acpi_walk_state *walk_state,
393 union acpi_parse_object *first_arg);
395 acpi_status
396 acpi_ds_resolve_operands (
397 struct acpi_walk_state *walk_state);
399 void
400 acpi_ds_clear_operands (
401 struct acpi_walk_state *walk_state);
405 * dswscope - Scope Stack manipulation
408 acpi_status
409 acpi_ds_scope_stack_push (
410 struct acpi_namespace_node *node,
411 acpi_object_type type,
412 struct acpi_walk_state *walk_state);
415 acpi_status
416 acpi_ds_scope_stack_pop (
417 struct acpi_walk_state *walk_state);
419 void
420 acpi_ds_scope_stack_clear (
421 struct acpi_walk_state *walk_state);
424 /* dswstate - parser WALK_STATE management routines */
426 struct acpi_walk_state *
427 acpi_ds_create_walk_state (
428 acpi_owner_id owner_id,
429 union acpi_parse_object *origin,
430 union acpi_operand_object *mth_desc,
431 struct acpi_thread_state *thread);
433 acpi_status
434 acpi_ds_init_aml_walk (
435 struct acpi_walk_state *walk_state,
436 union acpi_parse_object *op,
437 struct acpi_namespace_node *method_node,
438 u8 *aml_start,
439 u32 aml_length,
440 struct acpi_parameter_info *info,
441 u32 pass_number);
443 acpi_status
444 acpi_ds_obj_stack_delete_all (
445 struct acpi_walk_state *walk_state);
447 acpi_status
448 acpi_ds_obj_stack_pop_and_delete (
449 u32 pop_count,
450 struct acpi_walk_state *walk_state);
452 void
453 acpi_ds_delete_walk_state (
454 struct acpi_walk_state *walk_state);
456 struct acpi_walk_state *
457 acpi_ds_pop_walk_state (
458 struct acpi_thread_state *thread);
460 void
461 acpi_ds_push_walk_state (
462 struct acpi_walk_state *walk_state,
463 struct acpi_thread_state *thread);
465 acpi_status
466 acpi_ds_result_stack_pop (
467 struct acpi_walk_state *walk_state);
469 acpi_status
470 acpi_ds_result_stack_push (
471 struct acpi_walk_state *walk_state);
473 acpi_status
474 acpi_ds_result_stack_clear (
475 struct acpi_walk_state *walk_state);
477 struct acpi_walk_state *
478 acpi_ds_get_current_walk_state (
479 struct acpi_thread_state *thread);
481 void
482 acpi_ds_delete_walk_state_cache (
483 void);
485 acpi_status
486 acpi_ds_result_insert (
487 void *object,
488 u32 index,
489 struct acpi_walk_state *walk_state);
491 acpi_status
492 acpi_ds_result_remove (
493 union acpi_operand_object **object,
494 u32 index,
495 struct acpi_walk_state *walk_state);
497 acpi_status
498 acpi_ds_result_pop (
499 union acpi_operand_object **object,
500 struct acpi_walk_state *walk_state);
502 acpi_status
503 acpi_ds_result_push (
504 union acpi_operand_object *object,
505 struct acpi_walk_state *walk_state);
507 acpi_status
508 acpi_ds_result_pop_from_bottom (
509 union acpi_operand_object **object,
510 struct acpi_walk_state *walk_state);
512 #endif /* _ACDISPAT_H_ */