1 /******************************************************************************
3 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2004, 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.
44 #ifndef __ACINTERP_H__
45 #define __ACINTERP_H__
48 #define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
52 acpi_ex_resolve_operands (
54 union acpi_operand_object **stack_ptr,
55 struct acpi_walk_state *walk_state);
58 acpi_ex_check_object_type (
59 acpi_object_type type_needed,
60 acpi_object_type this_type,
64 * exxface - External interpreter interfaces
69 acpi_table_type table_id);
72 acpi_ex_execute_method (
73 struct acpi_namespace_node *method_node,
74 union acpi_operand_object **params,
75 union acpi_operand_object **return_obj_desc);
79 * exconvrt - object conversion
83 acpi_ex_convert_to_integer (
84 union acpi_operand_object *obj_desc,
85 union acpi_operand_object **result_desc,
86 struct acpi_walk_state *walk_state);
89 acpi_ex_convert_to_buffer (
90 union acpi_operand_object *obj_desc,
91 union acpi_operand_object **result_desc,
92 struct acpi_walk_state *walk_state);
95 acpi_ex_convert_to_string (
96 union acpi_operand_object *obj_desc,
97 union acpi_operand_object **result_desc,
100 struct acpi_walk_state *walk_state);
103 acpi_ex_convert_to_target_type (
104 acpi_object_type destination_type,
105 union acpi_operand_object *source_desc,
106 union acpi_operand_object **result_desc,
107 struct acpi_walk_state *walk_state);
110 acpi_ex_convert_to_ascii (
111 acpi_integer integer,
117 * exfield - ACPI AML (p-code) execution - field manipulation
121 acpi_ex_extract_from_field (
122 union acpi_operand_object *obj_desc,
127 acpi_ex_insert_into_field (
128 union acpi_operand_object *obj_desc,
133 acpi_ex_setup_region (
134 union acpi_operand_object *obj_desc,
135 u32 field_datum_byte_offset);
138 acpi_ex_access_region (
139 union acpi_operand_object *obj_desc,
140 u32 field_datum_byte_offset,
145 acpi_ex_register_overflow (
146 union acpi_operand_object *obj_desc,
150 acpi_ex_field_datum_io (
151 union acpi_operand_object *obj_desc,
152 u32 field_datum_byte_offset,
157 acpi_ex_write_with_update_rule (
158 union acpi_operand_object *obj_desc,
160 acpi_integer field_value,
161 u32 field_datum_byte_offset);
164 acpi_ex_get_buffer_datum(
168 u32 byte_granularity,
172 acpi_ex_set_buffer_datum (
173 acpi_integer merged_datum,
176 u32 byte_granularity,
180 acpi_ex_read_data_from_field (
181 struct acpi_walk_state *walk_state,
182 union acpi_operand_object *obj_desc,
183 union acpi_operand_object **ret_buffer_desc);
186 acpi_ex_write_data_to_field (
187 union acpi_operand_object *source_desc,
188 union acpi_operand_object *obj_desc,
189 union acpi_operand_object **result_desc);
192 * exmisc - ACPI AML (p-code) execution - specific opcodes
196 acpi_ex_opcode_3A_0T_0R (
197 struct acpi_walk_state *walk_state);
200 acpi_ex_opcode_3A_1T_1R (
201 struct acpi_walk_state *walk_state);
204 acpi_ex_opcode_6A_0T_1R (
205 struct acpi_walk_state *walk_state);
210 acpi_integer package_value,
211 acpi_integer match_value);
214 acpi_ex_get_object_reference (
215 union acpi_operand_object *obj_desc,
216 union acpi_operand_object **return_desc,
217 struct acpi_walk_state *walk_state);
220 acpi_ex_resolve_multiple (
221 struct acpi_walk_state *walk_state,
222 union acpi_operand_object *operand,
223 acpi_object_type *return_type,
224 union acpi_operand_object **return_desc);
227 acpi_ex_concat_template (
228 union acpi_operand_object *obj_desc,
229 union acpi_operand_object *obj_desc2,
230 union acpi_operand_object **actual_return_desc,
231 struct acpi_walk_state *walk_state);
234 acpi_ex_do_concatenate (
235 union acpi_operand_object *obj_desc,
236 union acpi_operand_object *obj_desc2,
237 union acpi_operand_object **actual_return_desc,
238 struct acpi_walk_state *walk_state);
241 acpi_ex_do_logical_op (
243 acpi_integer operand0,
244 acpi_integer operand1);
249 acpi_integer operand0,
250 acpi_integer operand1);
253 acpi_ex_create_mutex (
254 struct acpi_walk_state *walk_state);
257 acpi_ex_create_processor (
258 struct acpi_walk_state *walk_state);
261 acpi_ex_create_power_resource (
262 struct acpi_walk_state *walk_state);
265 acpi_ex_create_region (
269 struct acpi_walk_state *walk_state);
272 acpi_ex_create_table_region (
273 struct acpi_walk_state *walk_state);
276 acpi_ex_create_event (
277 struct acpi_walk_state *walk_state);
280 acpi_ex_create_alias (
281 struct acpi_walk_state *walk_state);
284 acpi_ex_create_method (
287 struct acpi_walk_state *walk_state);
291 * exconfig - dynamic table load/unload
296 struct acpi_table_header *table,
297 struct acpi_namespace_node *parent_node,
298 union acpi_operand_object **ddb_handle);
302 union acpi_operand_object *obj_desc,
303 union acpi_operand_object *target,
304 struct acpi_walk_state *walk_state);
307 acpi_ex_load_table_op (
308 struct acpi_walk_state *walk_state,
309 union acpi_operand_object **return_desc);
312 acpi_ex_unload_table (
313 union acpi_operand_object *ddb_handle);
317 * exmutex - mutex support
321 acpi_ex_acquire_mutex (
322 union acpi_operand_object *time_desc,
323 union acpi_operand_object *obj_desc,
324 struct acpi_walk_state *walk_state);
327 acpi_ex_release_mutex (
328 union acpi_operand_object *obj_desc,
329 struct acpi_walk_state *walk_state);
332 acpi_ex_release_all_mutexes (
333 struct acpi_thread_state *thread);
336 acpi_ex_unlink_mutex (
337 union acpi_operand_object *obj_desc);
341 union acpi_operand_object *obj_desc,
342 struct acpi_thread_state *thread);
345 * exprep - ACPI AML (p-code) execution - prep utilities
349 acpi_ex_prep_common_field_object (
350 union acpi_operand_object *obj_desc,
353 u32 field_bit_position,
354 u32 field_bit_length);
357 acpi_ex_prep_field_value (
358 struct acpi_create_field_info *info);
361 * exsystem - Interface to OS services
365 acpi_ex_system_do_notify_op (
366 union acpi_operand_object *value,
367 union acpi_operand_object *obj_desc);
370 acpi_ex_system_do_suspend(
374 acpi_ex_system_do_stall (
378 acpi_ex_system_acquire_mutex(
379 union acpi_operand_object *time,
380 union acpi_operand_object *obj_desc);
383 acpi_ex_system_release_mutex(
384 union acpi_operand_object *obj_desc);
387 acpi_ex_system_signal_event(
388 union acpi_operand_object *obj_desc);
391 acpi_ex_system_wait_event(
392 union acpi_operand_object *time,
393 union acpi_operand_object *obj_desc);
396 acpi_ex_system_reset_event(
397 union acpi_operand_object *obj_desc);
400 acpi_ex_system_wait_semaphore (
401 acpi_handle semaphore,
406 * exmonadic - ACPI AML (p-code) execution, monadic operators
410 acpi_ex_opcode_1A_0T_0R (
411 struct acpi_walk_state *walk_state);
414 acpi_ex_opcode_1A_0T_1R (
415 struct acpi_walk_state *walk_state);
418 acpi_ex_opcode_1A_1T_1R (
419 struct acpi_walk_state *walk_state);
422 acpi_ex_opcode_1A_1T_0R (
423 struct acpi_walk_state *walk_state);
426 * exdyadic - ACPI AML (p-code) execution, dyadic operators
430 acpi_ex_opcode_2A_0T_0R (
431 struct acpi_walk_state *walk_state);
434 acpi_ex_opcode_2A_0T_1R (
435 struct acpi_walk_state *walk_state);
438 acpi_ex_opcode_2A_1T_1R (
439 struct acpi_walk_state *walk_state);
442 acpi_ex_opcode_2A_2T_1R (
443 struct acpi_walk_state *walk_state);
447 * exresolv - Object resolution and get value functions
451 acpi_ex_resolve_to_value (
452 union acpi_operand_object **stack_ptr,
453 struct acpi_walk_state *walk_state);
456 acpi_ex_resolve_node_to_value (
457 struct acpi_namespace_node **stack_ptr,
458 struct acpi_walk_state *walk_state);
461 acpi_ex_resolve_object_to_value (
462 union acpi_operand_object **stack_ptr,
463 struct acpi_walk_state *walk_state);
467 * exdump - Scanner debug output routines
471 acpi_ex_dump_operand (
472 union acpi_operand_object *entry_desc);
475 acpi_ex_dump_operands (
476 union acpi_operand_object **operands,
477 acpi_interpreter_mode interpreter_mode,
485 acpi_ex_dump_object_descriptor (
486 union acpi_operand_object *object,
491 struct acpi_namespace_node *node,
500 acpi_ex_out_pointer (
505 acpi_ex_out_integer (
510 acpi_ex_out_address (
512 acpi_physical_address value);
516 * exnames - interpreter/scanner name load/execute
520 acpi_ex_allocate_name_string (
529 acpi_ex_name_segment (
534 acpi_ex_get_name_string (
535 acpi_object_type data_type,
537 char **out_name_string,
538 u32 *out_name_length);
542 acpi_object_type data_type,
543 acpi_interpreter_mode load_exec_mode);
547 * exstore - Object store support
552 union acpi_operand_object *val_desc,
553 union acpi_operand_object *dest_desc,
554 struct acpi_walk_state *walk_state);
557 acpi_ex_store_object_to_index (
558 union acpi_operand_object *val_desc,
559 union acpi_operand_object *dest_desc,
560 struct acpi_walk_state *walk_state);
563 acpi_ex_store_object_to_node (
564 union acpi_operand_object *source_desc,
565 struct acpi_namespace_node *node,
566 struct acpi_walk_state *walk_state);
574 acpi_ex_resolve_object (
575 union acpi_operand_object **source_desc_ptr,
576 acpi_object_type target_type,
577 struct acpi_walk_state *walk_state);
580 acpi_ex_store_object_to_object (
581 union acpi_operand_object *source_desc,
582 union acpi_operand_object *dest_desc,
583 union acpi_operand_object **new_desc,
584 struct acpi_walk_state *walk_state);
588 * excopy - object copy
592 acpi_ex_store_buffer_to_buffer (
593 union acpi_operand_object *source_desc,
594 union acpi_operand_object *target_desc);
597 acpi_ex_store_string_to_string (
598 union acpi_operand_object *source_desc,
599 union acpi_operand_object *target_desc);
602 acpi_ex_copy_integer_to_index_field (
603 union acpi_operand_object *source_desc,
604 union acpi_operand_object *target_desc);
607 acpi_ex_copy_integer_to_bank_field (
608 union acpi_operand_object *source_desc,
609 union acpi_operand_object *target_desc);
612 acpi_ex_copy_data_to_named_field (
613 union acpi_operand_object *source_desc,
614 struct acpi_namespace_node *node);
617 acpi_ex_copy_integer_to_buffer_field (
618 union acpi_operand_object *source_desc,
619 union acpi_operand_object *target_desc);
622 * exutils - interpreter/scanner utilities
626 acpi_ex_enter_interpreter (
630 acpi_ex_exit_interpreter (
634 acpi_ex_truncate_for32bit_table (
635 union acpi_operand_object *obj_desc);
638 acpi_ex_acquire_global_lock (
642 acpi_ex_release_global_lock (
646 acpi_ex_digits_needed (
651 acpi_ex_eisa_id_to_string (
656 acpi_ex_unsigned_integer_to_string (
662 * exregion - default op_region handlers
666 acpi_ex_system_memory_space_handler (
668 acpi_physical_address address,
671 void *handler_context,
672 void *region_context);
675 acpi_ex_system_io_space_handler (
677 acpi_physical_address address,
680 void *handler_context,
681 void *region_context);
684 acpi_ex_pci_config_space_handler (
686 acpi_physical_address address,
689 void *handler_context,
690 void *region_context);
693 acpi_ex_cmos_space_handler (
695 acpi_physical_address address,
698 void *handler_context,
699 void *region_context);
702 acpi_ex_pci_bar_space_handler (
704 acpi_physical_address address,
707 void *handler_context,
708 void *region_context);
711 acpi_ex_embedded_controller_space_handler (
713 acpi_physical_address address,
716 void *handler_context,
717 void *region_context);
720 acpi_ex_sm_bus_space_handler (
722 acpi_physical_address address,
725 void *handler_context,
726 void *region_context);
730 acpi_ex_data_table_space_handler (
732 acpi_physical_address address,
735 void *handler_context,
736 void *region_context);
738 #endif /* __INTERP_H__ */