1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2005, R. Byron Moore
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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.
49 #define NAMEOF_LOCAL_NTE "__L0"
50 #define NAMEOF_ARG_NTE "__A0"
54 * dsopcode - support for late evaluation
57 acpi_ds_get_buffer_field_arguments (
58 union acpi_operand_object
*obj_desc
);
61 acpi_ds_get_region_arguments (
62 union acpi_operand_object
*rgn_desc
);
65 acpi_ds_get_buffer_arguments (
66 union acpi_operand_object
*obj_desc
);
69 acpi_ds_get_package_arguments (
70 union acpi_operand_object
*obj_desc
);
73 acpi_ds_eval_buffer_field_operands (
74 struct acpi_walk_state
*walk_state
,
75 union acpi_parse_object
*op
);
78 acpi_ds_eval_region_operands (
79 struct acpi_walk_state
*walk_state
,
80 union acpi_parse_object
*op
);
83 acpi_ds_eval_data_object_operands (
84 struct acpi_walk_state
*walk_state
,
85 union acpi_parse_object
*op
,
86 union acpi_operand_object
*obj_desc
);
89 acpi_ds_initialize_region (
90 acpi_handle obj_handle
);
94 * dsctrl - Parser/Interpreter interface, control stack routines
97 acpi_ds_exec_begin_control_op (
98 struct acpi_walk_state
*walk_state
,
99 union acpi_parse_object
*op
);
102 acpi_ds_exec_end_control_op (
103 struct acpi_walk_state
*walk_state
,
104 union acpi_parse_object
*op
);
108 * dsexec - Parser/Interpreter interface, method execution callbacks
111 acpi_ds_get_predicate_value (
112 struct acpi_walk_state
*walk_state
,
113 union acpi_operand_object
*result_obj
);
116 acpi_ds_exec_begin_op (
117 struct acpi_walk_state
*walk_state
,
118 union acpi_parse_object
**out_op
);
121 acpi_ds_exec_end_op (
122 struct acpi_walk_state
*state
);
126 * dsfield - Parser/Interpreter interface for AML fields
129 acpi_ds_create_field (
130 union acpi_parse_object
*op
,
131 struct acpi_namespace_node
*region_node
,
132 struct acpi_walk_state
*walk_state
);
135 acpi_ds_create_bank_field (
136 union acpi_parse_object
*op
,
137 struct acpi_namespace_node
*region_node
,
138 struct acpi_walk_state
*walk_state
);
141 acpi_ds_create_index_field (
142 union acpi_parse_object
*op
,
143 struct acpi_namespace_node
*region_node
,
144 struct acpi_walk_state
*walk_state
);
147 acpi_ds_create_buffer_field (
148 union acpi_parse_object
*op
,
149 struct acpi_walk_state
*walk_state
);
152 acpi_ds_init_field_objects (
153 union acpi_parse_object
*op
,
154 struct acpi_walk_state
*walk_state
);
158 * dsload - Parser/Interpreter interface, namespace load callbacks
161 acpi_ds_load1_begin_op (
162 struct acpi_walk_state
*walk_state
,
163 union acpi_parse_object
**out_op
);
166 acpi_ds_load1_end_op (
167 struct acpi_walk_state
*walk_state
);
170 acpi_ds_load2_begin_op (
171 struct acpi_walk_state
*walk_state
,
172 union acpi_parse_object
**out_op
);
175 acpi_ds_load2_end_op (
176 struct acpi_walk_state
*walk_state
);
179 acpi_ds_init_callbacks (
180 struct acpi_walk_state
*walk_state
,
185 * dsmthdat - method data (locals/args)
188 acpi_ds_store_object_to_local (
191 union acpi_operand_object
*src_desc
,
192 struct acpi_walk_state
*walk_state
);
195 acpi_ds_method_data_get_entry (
198 struct acpi_walk_state
*walk_state
,
199 union acpi_operand_object
***node
);
202 acpi_ds_method_data_delete_all (
203 struct acpi_walk_state
*walk_state
);
206 acpi_ds_is_method_value (
207 union acpi_operand_object
*obj_desc
);
210 acpi_ds_method_data_get_value (
213 struct acpi_walk_state
*walk_state
,
214 union acpi_operand_object
**dest_desc
);
217 acpi_ds_method_data_init_args (
218 union acpi_operand_object
**params
,
220 struct acpi_walk_state
*walk_state
);
223 acpi_ds_method_data_get_node (
226 struct acpi_walk_state
*walk_state
,
227 struct acpi_namespace_node
**node
);
230 acpi_ds_method_data_init (
231 struct acpi_walk_state
*walk_state
);
235 * dsmethod - Parser/Interpreter interface - control method parsing
238 acpi_ds_parse_method (
239 acpi_handle obj_handle
);
242 acpi_ds_call_control_method (
243 struct acpi_thread_state
*thread
,
244 struct acpi_walk_state
*walk_state
,
245 union acpi_parse_object
*op
);
248 acpi_ds_restart_control_method (
249 struct acpi_walk_state
*walk_state
,
250 union acpi_operand_object
*return_desc
);
253 acpi_ds_terminate_control_method (
254 struct acpi_walk_state
*walk_state
);
257 acpi_ds_begin_method_execution (
258 struct acpi_namespace_node
*method_node
,
259 union acpi_operand_object
*obj_desc
,
260 struct acpi_namespace_node
*calling_method_node
);
267 acpi_ds_initialize_objects (
268 struct acpi_table_desc
*table_desc
,
269 struct acpi_namespace_node
*start_node
);
273 * dsobject - Parser/Interpreter interface - object initialization and conversion
276 acpi_ds_build_internal_buffer_obj (
277 struct acpi_walk_state
*walk_state
,
278 union acpi_parse_object
*op
,
280 union acpi_operand_object
**obj_desc_ptr
);
283 acpi_ds_build_internal_package_obj (
284 struct acpi_walk_state
*walk_state
,
285 union acpi_parse_object
*op
,
287 union acpi_operand_object
**obj_desc
);
290 acpi_ds_init_object_from_op (
291 struct acpi_walk_state
*walk_state
,
292 union acpi_parse_object
*op
,
294 union acpi_operand_object
**obj_desc
);
297 acpi_ds_create_node (
298 struct acpi_walk_state
*walk_state
,
299 struct acpi_namespace_node
*node
,
300 union acpi_parse_object
*op
);
304 * dsutils - Parser/Interpreter interface utility routines
307 acpi_ds_clear_implicit_return (
308 struct acpi_walk_state
*walk_state
);
311 acpi_ds_do_implicit_return (
312 union acpi_operand_object
*return_desc
,
313 struct acpi_walk_state
*walk_state
,
317 acpi_ds_is_result_used (
318 union acpi_parse_object
*op
,
319 struct acpi_walk_state
*walk_state
);
322 acpi_ds_delete_result_if_not_used (
323 union acpi_parse_object
*op
,
324 union acpi_operand_object
*result_obj
,
325 struct acpi_walk_state
*walk_state
);
328 acpi_ds_create_operand (
329 struct acpi_walk_state
*walk_state
,
330 union acpi_parse_object
*arg
,
334 acpi_ds_create_operands (
335 struct acpi_walk_state
*walk_state
,
336 union acpi_parse_object
*first_arg
);
339 acpi_ds_resolve_operands (
340 struct acpi_walk_state
*walk_state
);
343 acpi_ds_clear_operands (
344 struct acpi_walk_state
*walk_state
);
348 * dswscope - Scope Stack manipulation
351 acpi_ds_scope_stack_push (
352 struct acpi_namespace_node
*node
,
353 acpi_object_type type
,
354 struct acpi_walk_state
*walk_state
);
358 acpi_ds_scope_stack_pop (
359 struct acpi_walk_state
*walk_state
);
362 acpi_ds_scope_stack_clear (
363 struct acpi_walk_state
*walk_state
);
367 * dswstate - parser WALK_STATE management routines
370 acpi_ds_obj_stack_push (
372 struct acpi_walk_state
*walk_state
);
375 acpi_ds_obj_stack_pop (
377 struct acpi_walk_state
*walk_state
);
379 struct acpi_walk_state
*
380 acpi_ds_create_walk_state (
381 acpi_owner_id owner_id
,
382 union acpi_parse_object
*origin
,
383 union acpi_operand_object
*mth_desc
,
384 struct acpi_thread_state
*thread
);
387 acpi_ds_init_aml_walk (
388 struct acpi_walk_state
*walk_state
,
389 union acpi_parse_object
*op
,
390 struct acpi_namespace_node
*method_node
,
393 struct acpi_parameter_info
*info
,
397 acpi_ds_obj_stack_pop_and_delete (
399 struct acpi_walk_state
*walk_state
);
402 acpi_ds_delete_walk_state (
403 struct acpi_walk_state
*walk_state
);
405 struct acpi_walk_state
*
406 acpi_ds_pop_walk_state (
407 struct acpi_thread_state
*thread
);
410 acpi_ds_push_walk_state (
411 struct acpi_walk_state
*walk_state
,
412 struct acpi_thread_state
*thread
);
415 acpi_ds_result_stack_pop (
416 struct acpi_walk_state
*walk_state
);
419 acpi_ds_result_stack_push (
420 struct acpi_walk_state
*walk_state
);
423 acpi_ds_result_stack_clear (
424 struct acpi_walk_state
*walk_state
);
426 struct acpi_walk_state
*
427 acpi_ds_get_current_walk_state (
428 struct acpi_thread_state
*thread
);
430 #ifdef ACPI_FUTURE_USAGE
432 acpi_ds_result_remove (
433 union acpi_operand_object
**object
,
435 struct acpi_walk_state
*walk_state
);
440 union acpi_operand_object
**object
,
441 struct acpi_walk_state
*walk_state
);
444 acpi_ds_result_push (
445 union acpi_operand_object
*object
,
446 struct acpi_walk_state
*walk_state
);
449 acpi_ds_result_pop_from_bottom (
450 union acpi_operand_object
**object
,
451 struct acpi_walk_state
*walk_state
);
453 #ifdef ACPI_ENABLE_OBJECT_CACHE
455 acpi_ds_delete_walk_state_cache (
459 #endif /* _ACDISPAT_H_ */