1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
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
31 #define NAMEOF_LOCAL_NTE "__L0"
32 #define NAMEOF_ARG_NTE "__A0"
35 /* Common interfaces */
38 acpi_ds_obj_stack_push (
40 acpi_walk_state *walk_state);
43 acpi_ds_obj_stack_pop (
45 acpi_walk_state *walk_state);
48 acpi_ds_obj_stack_get_value (
50 acpi_walk_state *walk_state);
53 acpi_ds_obj_stack_pop_object (
54 acpi_operand_object **object,
55 acpi_walk_state *walk_state);
58 /* dsopcode - support for late evaluation */
61 acpi_ds_get_buffer_field_arguments (
62 acpi_operand_object *obj_desc);
65 acpi_ds_get_region_arguments (
66 acpi_operand_object *rgn_desc);
69 /* dsctrl - Parser/Interpreter interface, control stack routines */
73 acpi_ds_exec_begin_control_op (
74 acpi_walk_state *walk_state,
75 acpi_parse_object *op);
78 acpi_ds_exec_end_control_op (
79 acpi_walk_state *walk_state,
80 acpi_parse_object *op);
83 /* dsexec - Parser/Interpreter interface, method execution callbacks */
87 acpi_ds_get_predicate_value (
88 acpi_walk_state *walk_state,
92 acpi_ds_exec_begin_op (
93 acpi_walk_state *walk_state,
94 acpi_parse_object **out_op);
98 acpi_walk_state *state);
101 /* dsfield - Parser/Interpreter interface for AML fields */
104 acpi_ds_create_field (
105 acpi_parse_object *op,
106 acpi_namespace_node *region_node,
107 acpi_walk_state *walk_state);
110 acpi_ds_create_bank_field (
111 acpi_parse_object *op,
112 acpi_namespace_node *region_node,
113 acpi_walk_state *walk_state);
116 acpi_ds_create_index_field (
117 acpi_parse_object *op,
118 acpi_namespace_node *region_node,
119 acpi_walk_state *walk_state);
122 acpi_ds_create_buffer_field (
123 acpi_parse_object *op,
124 acpi_walk_state *walk_state);
127 /* dsload - Parser/Interpreter interface, namespace load callbacks */
130 acpi_ds_load1_begin_op (
131 acpi_walk_state *walk_state,
132 acpi_parse_object **out_op);
135 acpi_ds_load1_end_op (
136 acpi_walk_state *walk_state);
139 acpi_ds_load2_begin_op (
140 acpi_walk_state *walk_state,
141 acpi_parse_object **out_op);
144 acpi_ds_load2_end_op (
145 acpi_walk_state *walk_state);
148 acpi_ds_init_callbacks (
149 acpi_walk_state *walk_state,
153 /* dsmthdat - method data (locals/args) */
157 acpi_ds_store_object_to_local (
160 acpi_operand_object *src_desc,
161 acpi_walk_state *walk_state);
164 acpi_ds_method_data_get_entry (
167 acpi_walk_state *walk_state,
168 acpi_operand_object ***node);
171 acpi_ds_method_data_delete_all (
172 acpi_walk_state *walk_state);
175 acpi_ds_is_method_value (
176 acpi_operand_object *obj_desc);
179 acpi_ds_method_data_get_type (
182 acpi_walk_state *walk_state);
185 acpi_ds_method_data_get_value (
188 acpi_walk_state *walk_state,
189 acpi_operand_object **dest_desc);
192 acpi_ds_method_data_delete_value (
195 acpi_walk_state *walk_state);
198 acpi_ds_method_data_init_args (
199 acpi_operand_object **params,
201 acpi_walk_state *walk_state);
203 acpi_namespace_node *
204 acpi_ds_method_data_get_node (
207 acpi_walk_state *walk_state);
210 acpi_ds_method_data_init (
211 acpi_walk_state *walk_state);
214 acpi_ds_method_data_set_entry (
217 acpi_operand_object *object,
218 acpi_walk_state *walk_state);
221 /* dsmethod - Parser/Interpreter interface - control method parsing */
224 acpi_ds_parse_method (
225 acpi_handle obj_handle);
228 acpi_ds_call_control_method (
229 acpi_walk_list *walk_list,
230 acpi_walk_state *walk_state,
231 acpi_parse_object *op);
234 acpi_ds_restart_control_method (
235 acpi_walk_state *walk_state,
236 acpi_operand_object *return_desc);
239 acpi_ds_terminate_control_method (
240 acpi_walk_state *walk_state);
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);
249 /* dsobj - Parser/Interpreter interface - object initialization and conversion */
252 acpi_ds_init_one_object (
253 acpi_handle obj_handle,
256 void **return_value);
259 acpi_ds_initialize_objects (
260 acpi_table_desc *table_desc,
261 acpi_namespace_node *start_node);
264 acpi_ds_build_internal_package_obj (
265 acpi_walk_state *walk_state,
266 acpi_parse_object *op,
267 acpi_operand_object **obj_desc);
270 acpi_ds_build_internal_object (
271 acpi_walk_state *walk_state,
272 acpi_parse_object *op,
273 acpi_operand_object **obj_desc_ptr);
276 acpi_ds_init_object_from_op (
277 acpi_walk_state *walk_state,
278 acpi_parse_object *op,
280 acpi_operand_object **obj_desc);
283 acpi_ds_create_node (
284 acpi_walk_state *walk_state,
285 acpi_namespace_node *node,
286 acpi_parse_object *op);
289 /* dsregn - Parser/Interpreter interface - Op Region parsing */
292 acpi_ds_eval_buffer_field_operands (
293 acpi_walk_state *walk_state,
294 acpi_parse_object *op);
297 acpi_ds_eval_region_operands (
298 acpi_walk_state *walk_state,
299 acpi_parse_object *op);
302 acpi_ds_initialize_region (
303 acpi_handle obj_handle);
306 /* dsutils - Parser/Interpreter interface utility routines */
309 acpi_ds_is_result_used (
310 acpi_parse_object *op,
311 acpi_walk_state *walk_state);
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);
320 acpi_ds_create_operand (
321 acpi_walk_state *walk_state,
322 acpi_parse_object *arg,
326 acpi_ds_create_operands (
327 acpi_walk_state *walk_state,
328 acpi_parse_object *first_arg);
331 acpi_ds_resolve_operands (
332 acpi_walk_state *walk_state);
335 acpi_ds_map_opcode_to_data_type (
340 acpi_ds_map_named_opcode_to_data_type (
345 * dswscope - Scope Stack manipulation
349 acpi_ds_scope_stack_push (
350 acpi_namespace_node *node,
351 acpi_object_type8 type,
352 acpi_walk_state *walk_state);
356 acpi_ds_scope_stack_pop (
357 acpi_walk_state *walk_state);
360 acpi_ds_scope_stack_clear (
361 acpi_walk_state *walk_state);
364 /* dswstate - parser WALK_STATE management routines */
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);
374 acpi_ds_init_aml_walk (
375 acpi_walk_state *walk_state,
376 acpi_parse_object *op,
377 acpi_namespace_node *method_node,
380 acpi_operand_object **params,
381 acpi_operand_object **return_obj_desc,
385 acpi_ds_obj_stack_delete_all (
386 acpi_walk_state *walk_state);
389 acpi_ds_obj_stack_pop_and_delete (
391 acpi_walk_state *walk_state);
394 acpi_ds_delete_walk_state (
395 acpi_walk_state *walk_state);
398 acpi_ds_pop_walk_state (
399 acpi_walk_list *walk_list);
402 acpi_ds_push_walk_state (
403 acpi_walk_state *walk_state,
404 acpi_walk_list *walk_list);
407 acpi_ds_result_stack_pop (
408 acpi_walk_state *walk_state);
411 acpi_ds_result_stack_push (
412 acpi_walk_state *walk_state);
415 acpi_ds_result_stack_clear (
416 acpi_walk_state *walk_state);
419 acpi_ds_get_current_walk_state (
420 acpi_walk_list *walk_list);
423 acpi_ds_delete_walk_state_cache (
427 acpi_ds_result_insert (
430 acpi_walk_state *walk_state);
433 acpi_ds_result_remove (
434 acpi_operand_object **object,
436 acpi_walk_state *walk_state);
440 acpi_operand_object **object,
441 acpi_walk_state *walk_state);
444 acpi_ds_result_push (
445 acpi_operand_object *object,
446 acpi_walk_state *walk_state);
449 acpi_ds_result_pop_from_bottom (
450 acpi_operand_object **object,
451 acpi_walk_state *walk_state);
453 #endif /* _ACDISPAT_H_ */