1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
6 *****************************************************************************/
9 * Copyright (C) 2000 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 /* For Acpi_ds_method_data_set_value */
37 #define MTH_TYPE_LOCAL 0
38 #define MTH_TYPE_ARG 1
41 /* Common interfaces */
44 acpi_ds_obj_stack_push (
46 ACPI_WALK_STATE
*walk_state
);
49 acpi_ds_obj_stack_pop (
51 ACPI_WALK_STATE
*walk_state
);
54 acpi_ds_obj_stack_get_value (
56 ACPI_WALK_STATE
*walk_state
);
59 acpi_ds_obj_stack_pop_object (
60 ACPI_OPERAND_OBJECT
**object
,
61 ACPI_WALK_STATE
*walk_state
);
64 /* dsopcode - support for late evaluation */
67 acpi_ds_get_field_unit_arguments (
68 ACPI_OPERAND_OBJECT
*obj_desc
);
71 acpi_ds_get_region_arguments (
72 ACPI_OPERAND_OBJECT
*rgn_desc
);
75 /* dsctrl - Parser/Interpreter interface, control stack routines */
79 acpi_ds_exec_begin_control_op (
80 ACPI_WALK_STATE
*walk_state
,
81 ACPI_PARSE_OBJECT
*op
);
84 acpi_ds_exec_end_control_op (
85 ACPI_WALK_STATE
*walk_state
,
86 ACPI_PARSE_OBJECT
*op
);
89 /* dsexec - Parser/Interpreter interface, method execution callbacks */
93 acpi_ds_get_predicate_value (
94 ACPI_WALK_STATE
*walk_state
,
95 ACPI_PARSE_OBJECT
*op
,
99 acpi_ds_exec_begin_op (
101 ACPI_PARSE_OBJECT
*op
,
102 ACPI_WALK_STATE
*walk_state
,
103 ACPI_PARSE_OBJECT
**out_op
);
106 acpi_ds_exec_end_op (
107 ACPI_WALK_STATE
*state
,
108 ACPI_PARSE_OBJECT
*op
);
111 /* dsfield - Parser/Interpreter interface for AML fields */
115 acpi_ds_create_field (
116 ACPI_PARSE_OBJECT
*op
,
117 ACPI_NAMESPACE_NODE
*region_node
,
118 ACPI_WALK_STATE
*walk_state
);
121 acpi_ds_create_bank_field (
122 ACPI_PARSE_OBJECT
*op
,
123 ACPI_NAMESPACE_NODE
*region_node
,
124 ACPI_WALK_STATE
*walk_state
);
127 acpi_ds_create_index_field (
128 ACPI_PARSE_OBJECT
*op
,
129 ACPI_HANDLE region_node
,
130 ACPI_WALK_STATE
*walk_state
);
133 /* dsload - Parser/Interpreter interface, namespace load callbacks */
136 acpi_ds_load1_begin_op (
138 ACPI_PARSE_OBJECT
*op
,
139 ACPI_WALK_STATE
*walk_state
,
140 ACPI_PARSE_OBJECT
**out_op
);
143 acpi_ds_load1_end_op (
144 ACPI_WALK_STATE
*walk_state
,
145 ACPI_PARSE_OBJECT
*op
);
148 acpi_ds_load2_begin_op (
150 ACPI_PARSE_OBJECT
*op
,
151 ACPI_WALK_STATE
*walk_state
,
152 ACPI_PARSE_OBJECT
**out_op
);
155 acpi_ds_load2_end_op (
156 ACPI_WALK_STATE
*state
,
157 ACPI_PARSE_OBJECT
*op
);
160 acpi_ds_load3_begin_op (
162 ACPI_PARSE_OBJECT
*op
,
163 ACPI_WALK_STATE
*walk_state
,
164 ACPI_PARSE_OBJECT
**out_op
);
167 acpi_ds_load3_end_op (
168 ACPI_WALK_STATE
*state
,
169 ACPI_PARSE_OBJECT
*op
);
172 /* dsmthdat - method data (locals/args) */
176 acpi_ds_method_data_get_entry (
179 ACPI_WALK_STATE
*walk_state
,
180 ACPI_OPERAND_OBJECT
***node
);
183 acpi_ds_method_data_delete_all (
184 ACPI_WALK_STATE
*walk_state
);
187 acpi_ds_is_method_value (
188 ACPI_OPERAND_OBJECT
*obj_desc
);
191 acpi_ds_method_data_get_type (
194 ACPI_WALK_STATE
*walk_state
);
197 acpi_ds_method_data_get_value (
200 ACPI_WALK_STATE
*walk_state
,
201 ACPI_OPERAND_OBJECT
**dest_desc
);
204 acpi_ds_method_data_set_value (
207 ACPI_OPERAND_OBJECT
*src_desc
,
208 ACPI_WALK_STATE
*walk_state
);
211 acpi_ds_method_data_delete_value (
214 ACPI_WALK_STATE
*walk_state
);
217 acpi_ds_method_data_init_args (
218 ACPI_OPERAND_OBJECT
**params
,
220 ACPI_WALK_STATE
*walk_state
);
222 ACPI_NAMESPACE_NODE
*
223 acpi_ds_method_data_get_nte (
226 ACPI_WALK_STATE
*walk_state
);
229 acpi_ds_method_data_init (
230 ACPI_WALK_STATE
*walk_state
);
233 acpi_ds_method_data_set_entry (
236 ACPI_OPERAND_OBJECT
*object
,
237 ACPI_WALK_STATE
*walk_state
);
240 /* dsmethod - Parser/Interpreter interface - control method parsing */
243 acpi_ds_parse_method (
244 ACPI_HANDLE obj_handle
);
247 acpi_ds_call_control_method (
248 ACPI_WALK_LIST
*walk_list
,
249 ACPI_WALK_STATE
*walk_state
,
250 ACPI_PARSE_OBJECT
*op
);
253 acpi_ds_restart_control_method (
254 ACPI_WALK_STATE
*walk_state
,
255 ACPI_OPERAND_OBJECT
*return_desc
);
258 acpi_ds_terminate_control_method (
259 ACPI_WALK_STATE
*walk_state
);
262 acpi_ds_begin_method_execution (
263 ACPI_NAMESPACE_NODE
*method_node
,
264 ACPI_OPERAND_OBJECT
*obj_desc
);
267 /* dsobj - Parser/Interpreter interface - object initialization and conversion */
270 acpi_ds_init_one_object (
271 ACPI_HANDLE obj_handle
,
274 void **return_value
);
277 acpi_ds_initialize_objects (
278 ACPI_TABLE_DESC
*table_desc
,
279 ACPI_NAMESPACE_NODE
*start_node
);
282 acpi_ds_build_internal_package_obj (
283 ACPI_WALK_STATE
*walk_state
,
284 ACPI_PARSE_OBJECT
*op
,
285 ACPI_OPERAND_OBJECT
**obj_desc
);
288 acpi_ds_build_internal_object (
289 ACPI_WALK_STATE
*walk_state
,
290 ACPI_PARSE_OBJECT
*op
,
291 ACPI_OPERAND_OBJECT
**obj_desc_ptr
);
294 acpi_ds_init_object_from_op (
295 ACPI_WALK_STATE
*walk_state
,
296 ACPI_PARSE_OBJECT
*op
,
298 ACPI_OPERAND_OBJECT
**obj_desc
);
301 acpi_ds_create_node (
302 ACPI_WALK_STATE
*walk_state
,
303 ACPI_NAMESPACE_NODE
*node
,
304 ACPI_PARSE_OBJECT
*op
);
307 /* dsregn - Parser/Interpreter interface - Op Region parsing */
310 acpi_ds_eval_field_unit_operands (
311 ACPI_WALK_STATE
*walk_state
,
312 ACPI_PARSE_OBJECT
*op
);
315 acpi_ds_eval_region_operands (
316 ACPI_WALK_STATE
*walk_state
,
317 ACPI_PARSE_OBJECT
*op
);
320 acpi_ds_initialize_region (
321 ACPI_HANDLE obj_handle
);
324 /* dsutils - Parser/Interpreter interface utility routines */
327 acpi_ds_is_result_used (
328 ACPI_PARSE_OBJECT
*op
,
329 ACPI_WALK_STATE
*walk_state
);
332 acpi_ds_delete_result_if_not_used (
333 ACPI_PARSE_OBJECT
*op
,
334 ACPI_OPERAND_OBJECT
*result_obj
,
335 ACPI_WALK_STATE
*walk_state
);
338 acpi_ds_create_operand (
339 ACPI_WALK_STATE
*walk_state
,
340 ACPI_PARSE_OBJECT
*arg
,
344 acpi_ds_create_operands (
345 ACPI_WALK_STATE
*walk_state
,
346 ACPI_PARSE_OBJECT
*first_arg
);
349 acpi_ds_resolve_operands (
350 ACPI_WALK_STATE
*walk_state
);
353 acpi_ds_map_opcode_to_data_type (
358 acpi_ds_map_named_opcode_to_data_type (
363 * dswscope - Scope Stack manipulation
367 acpi_ds_scope_stack_push (
368 ACPI_NAMESPACE_NODE
*node
,
369 OBJECT_TYPE_INTERNAL type
,
370 ACPI_WALK_STATE
*walk_state
);
374 acpi_ds_scope_stack_pop (
375 ACPI_WALK_STATE
*walk_state
);
378 acpi_ds_scope_stack_clear (
379 ACPI_WALK_STATE
*walk_state
);
382 /* Acpi_dswstate - parser WALK_STATE management routines */
385 acpi_ds_create_walk_state (
386 ACPI_OWNER_ID owner_id
,
387 ACPI_PARSE_OBJECT
*origin
,
388 ACPI_OPERAND_OBJECT
*mth_desc
,
389 ACPI_WALK_LIST
*walk_list
);
392 acpi_ds_obj_stack_delete_all (
393 ACPI_WALK_STATE
*walk_state
);
396 acpi_ds_obj_stack_pop_and_delete (
398 ACPI_WALK_STATE
*walk_state
);
401 acpi_ds_delete_walk_state (
402 ACPI_WALK_STATE
*walk_state
);
405 acpi_ds_pop_walk_state (
406 ACPI_WALK_LIST
*walk_list
);
409 acpi_ds_result_stack_pop (
410 ACPI_WALK_STATE
*walk_state
);
413 acpi_ds_result_stack_push (
414 ACPI_WALK_STATE
*walk_state
);
417 acpi_ds_result_stack_clear (
418 ACPI_WALK_STATE
*walk_state
);
421 acpi_ds_get_current_walk_state (
422 ACPI_WALK_LIST
*walk_list
);
425 acpi_ds_delete_walk_state_cache (
429 acpi_ds_result_insert (
432 ACPI_WALK_STATE
*walk_state
);
435 acpi_ds_result_remove (
436 ACPI_OPERAND_OBJECT
**object
,
438 ACPI_WALK_STATE
*walk_state
);
442 ACPI_OPERAND_OBJECT
**object
,
443 ACPI_WALK_STATE
*walk_state
);
446 acpi_ds_result_push (
447 ACPI_OPERAND_OBJECT
*object
,
448 ACPI_WALK_STATE
*walk_state
);
451 acpi_ds_result_pop_from_bottom (
452 ACPI_OPERAND_OBJECT
**object
,
453 ACPI_WALK_STATE
*walk_state
);
455 #endif /* _ACDISPAT_H_ */