1 /******************************************************************************
3 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
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.
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
,
89 acpi_ex_convert_to_buffer (
90 union acpi_operand_object
*obj_desc
,
91 union acpi_operand_object
**result_desc
);
94 acpi_ex_convert_to_string (
95 union acpi_operand_object
*obj_desc
,
96 union acpi_operand_object
**result_desc
,
99 /* Types for ->String conversion */
101 #define ACPI_EXPLICIT_BYTE_COPY 0x00000000
102 #define ACPI_EXPLICIT_CONVERT_HEX 0x00000001
103 #define ACPI_IMPLICIT_CONVERT_HEX 0x00000002
104 #define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003
107 acpi_ex_convert_to_target_type (
108 acpi_object_type destination_type
,
109 union acpi_operand_object
*source_desc
,
110 union acpi_operand_object
**result_desc
,
111 struct acpi_walk_state
*walk_state
);
114 acpi_ex_convert_to_ascii (
115 acpi_integer integer
,
121 * exfield - ACPI AML (p-code) execution - field manipulation
125 acpi_ex_common_buffer_setup (
126 union acpi_operand_object
*obj_desc
,
131 acpi_ex_extract_from_field (
132 union acpi_operand_object
*obj_desc
,
137 acpi_ex_insert_into_field (
138 union acpi_operand_object
*obj_desc
,
143 acpi_ex_setup_region (
144 union acpi_operand_object
*obj_desc
,
145 u32 field_datum_byte_offset
);
148 acpi_ex_access_region (
149 union acpi_operand_object
*obj_desc
,
150 u32 field_datum_byte_offset
,
155 acpi_ex_register_overflow (
156 union acpi_operand_object
*obj_desc
,
160 acpi_ex_field_datum_io (
161 union acpi_operand_object
*obj_desc
,
162 u32 field_datum_byte_offset
,
167 acpi_ex_write_with_update_rule (
168 union acpi_operand_object
*obj_desc
,
170 acpi_integer field_value
,
171 u32 field_datum_byte_offset
);
174 acpi_ex_get_buffer_datum(
178 u32 byte_granularity
,
182 acpi_ex_set_buffer_datum (
183 acpi_integer merged_datum
,
186 u32 byte_granularity
,
190 acpi_ex_read_data_from_field (
191 struct acpi_walk_state
*walk_state
,
192 union acpi_operand_object
*obj_desc
,
193 union acpi_operand_object
**ret_buffer_desc
);
196 acpi_ex_write_data_to_field (
197 union acpi_operand_object
*source_desc
,
198 union acpi_operand_object
*obj_desc
,
199 union acpi_operand_object
**result_desc
);
202 * exmisc - ACPI AML (p-code) execution - specific opcodes
206 acpi_ex_opcode_3A_0T_0R (
207 struct acpi_walk_state
*walk_state
);
210 acpi_ex_opcode_3A_1T_1R (
211 struct acpi_walk_state
*walk_state
);
214 acpi_ex_opcode_6A_0T_1R (
215 struct acpi_walk_state
*walk_state
);
220 union acpi_operand_object
*package_obj
,
221 union acpi_operand_object
*match_obj
);
224 acpi_ex_get_object_reference (
225 union acpi_operand_object
*obj_desc
,
226 union acpi_operand_object
**return_desc
,
227 struct acpi_walk_state
*walk_state
);
230 acpi_ex_resolve_multiple (
231 struct acpi_walk_state
*walk_state
,
232 union acpi_operand_object
*operand
,
233 acpi_object_type
*return_type
,
234 union acpi_operand_object
**return_desc
);
237 acpi_ex_concat_template (
238 union acpi_operand_object
*obj_desc
,
239 union acpi_operand_object
*obj_desc2
,
240 union acpi_operand_object
**actual_return_desc
,
241 struct acpi_walk_state
*walk_state
);
244 acpi_ex_do_concatenate (
245 union acpi_operand_object
*obj_desc
,
246 union acpi_operand_object
*obj_desc2
,
247 union acpi_operand_object
**actual_return_desc
,
248 struct acpi_walk_state
*walk_state
);
251 acpi_ex_do_logical_numeric_op (
253 acpi_integer integer0
,
254 acpi_integer integer1
,
258 acpi_ex_do_logical_op (
260 union acpi_operand_object
*operand0
,
261 union acpi_operand_object
*operand1
,
267 acpi_integer operand0
,
268 acpi_integer operand1
);
271 acpi_ex_create_mutex (
272 struct acpi_walk_state
*walk_state
);
275 acpi_ex_create_processor (
276 struct acpi_walk_state
*walk_state
);
279 acpi_ex_create_power_resource (
280 struct acpi_walk_state
*walk_state
);
283 acpi_ex_create_region (
287 struct acpi_walk_state
*walk_state
);
290 acpi_ex_create_table_region (
291 struct acpi_walk_state
*walk_state
);
294 acpi_ex_create_event (
295 struct acpi_walk_state
*walk_state
);
298 acpi_ex_create_alias (
299 struct acpi_walk_state
*walk_state
);
302 acpi_ex_create_method (
305 struct acpi_walk_state
*walk_state
);
309 * exconfig - dynamic table load/unload
314 struct acpi_table_header
*table
,
315 struct acpi_namespace_node
*parent_node
,
316 union acpi_operand_object
**ddb_handle
);
320 union acpi_operand_object
*obj_desc
,
321 union acpi_operand_object
*target
,
322 struct acpi_walk_state
*walk_state
);
325 acpi_ex_load_table_op (
326 struct acpi_walk_state
*walk_state
,
327 union acpi_operand_object
**return_desc
);
330 acpi_ex_unload_table (
331 union acpi_operand_object
*ddb_handle
);
335 * exmutex - mutex support
339 acpi_ex_acquire_mutex (
340 union acpi_operand_object
*time_desc
,
341 union acpi_operand_object
*obj_desc
,
342 struct acpi_walk_state
*walk_state
);
345 acpi_ex_release_mutex (
346 union acpi_operand_object
*obj_desc
,
347 struct acpi_walk_state
*walk_state
);
350 acpi_ex_release_all_mutexes (
351 struct acpi_thread_state
*thread
);
354 acpi_ex_unlink_mutex (
355 union acpi_operand_object
*obj_desc
);
359 union acpi_operand_object
*obj_desc
,
360 struct acpi_thread_state
*thread
);
363 * exprep - ACPI AML (p-code) execution - prep utilities
367 acpi_ex_prep_common_field_object (
368 union acpi_operand_object
*obj_desc
,
371 u32 field_bit_position
,
372 u32 field_bit_length
);
375 acpi_ex_prep_field_value (
376 struct acpi_create_field_info
*info
);
379 * exsystem - Interface to OS services
383 acpi_ex_system_do_notify_op (
384 union acpi_operand_object
*value
,
385 union acpi_operand_object
*obj_desc
);
388 acpi_ex_system_do_suspend(
392 acpi_ex_system_do_stall (
396 acpi_ex_system_acquire_mutex(
397 union acpi_operand_object
*time
,
398 union acpi_operand_object
*obj_desc
);
401 acpi_ex_system_release_mutex(
402 union acpi_operand_object
*obj_desc
);
405 acpi_ex_system_signal_event(
406 union acpi_operand_object
*obj_desc
);
409 acpi_ex_system_wait_event(
410 union acpi_operand_object
*time
,
411 union acpi_operand_object
*obj_desc
);
414 acpi_ex_system_reset_event(
415 union acpi_operand_object
*obj_desc
);
418 acpi_ex_system_wait_semaphore (
419 acpi_handle semaphore
,
424 * exmonadic - ACPI AML (p-code) execution, monadic operators
428 acpi_ex_opcode_0A_0T_1R (
429 struct acpi_walk_state
*walk_state
);
432 acpi_ex_opcode_1A_0T_0R (
433 struct acpi_walk_state
*walk_state
);
436 acpi_ex_opcode_1A_0T_1R (
437 struct acpi_walk_state
*walk_state
);
440 acpi_ex_opcode_1A_1T_1R (
441 struct acpi_walk_state
*walk_state
);
444 acpi_ex_opcode_1A_1T_0R (
445 struct acpi_walk_state
*walk_state
);
448 * exdyadic - ACPI AML (p-code) execution, dyadic operators
452 acpi_ex_opcode_2A_0T_0R (
453 struct acpi_walk_state
*walk_state
);
456 acpi_ex_opcode_2A_0T_1R (
457 struct acpi_walk_state
*walk_state
);
460 acpi_ex_opcode_2A_1T_1R (
461 struct acpi_walk_state
*walk_state
);
464 acpi_ex_opcode_2A_2T_1R (
465 struct acpi_walk_state
*walk_state
);
469 * exresolv - Object resolution and get value functions
473 acpi_ex_resolve_to_value (
474 union acpi_operand_object
**stack_ptr
,
475 struct acpi_walk_state
*walk_state
);
478 acpi_ex_resolve_node_to_value (
479 struct acpi_namespace_node
**stack_ptr
,
480 struct acpi_walk_state
*walk_state
);
483 acpi_ex_resolve_object_to_value (
484 union acpi_operand_object
**stack_ptr
,
485 struct acpi_walk_state
*walk_state
);
489 * exdump - Interpreter debug output routines
493 acpi_ex_dump_operand (
494 union acpi_operand_object
*obj_desc
,
498 acpi_ex_dump_operands (
499 union acpi_operand_object
**operands
,
500 acpi_interpreter_mode interpreter_mode
,
507 #ifdef ACPI_FUTURE_USAGE
509 acpi_ex_dump_object_descriptor (
510 union acpi_operand_object
*object
,
515 struct acpi_namespace_node
*node
,
524 acpi_ex_out_pointer (
529 acpi_ex_out_integer (
534 acpi_ex_out_address (
536 acpi_physical_address value
);
537 #endif /* ACPI_FUTURE_USAGE */
540 * exnames - interpreter/scanner name load/execute
544 acpi_ex_allocate_name_string (
553 acpi_ex_name_segment (
558 acpi_ex_get_name_string (
559 acpi_object_type data_type
,
561 char **out_name_string
,
562 u32
*out_name_length
);
566 acpi_object_type data_type
,
567 acpi_interpreter_mode load_exec_mode
);
571 * exstore - Object store support
576 union acpi_operand_object
*val_desc
,
577 union acpi_operand_object
*dest_desc
,
578 struct acpi_walk_state
*walk_state
);
581 acpi_ex_store_object_to_index (
582 union acpi_operand_object
*val_desc
,
583 union acpi_operand_object
*dest_desc
,
584 struct acpi_walk_state
*walk_state
);
587 acpi_ex_store_object_to_node (
588 union acpi_operand_object
*source_desc
,
589 struct acpi_namespace_node
*node
,
590 struct acpi_walk_state
*walk_state
,
591 u8 implicit_conversion
);
593 #define ACPI_IMPLICIT_CONVERSION TRUE
594 #define ACPI_NO_IMPLICIT_CONVERSION FALSE
601 acpi_ex_resolve_object (
602 union acpi_operand_object
**source_desc_ptr
,
603 acpi_object_type target_type
,
604 struct acpi_walk_state
*walk_state
);
607 acpi_ex_store_object_to_object (
608 union acpi_operand_object
*source_desc
,
609 union acpi_operand_object
*dest_desc
,
610 union acpi_operand_object
**new_desc
,
611 struct acpi_walk_state
*walk_state
);
615 * excopy - object copy
619 acpi_ex_store_buffer_to_buffer (
620 union acpi_operand_object
*source_desc
,
621 union acpi_operand_object
*target_desc
);
624 acpi_ex_store_string_to_string (
625 union acpi_operand_object
*source_desc
,
626 union acpi_operand_object
*target_desc
);
629 acpi_ex_copy_integer_to_index_field (
630 union acpi_operand_object
*source_desc
,
631 union acpi_operand_object
*target_desc
);
634 acpi_ex_copy_integer_to_bank_field (
635 union acpi_operand_object
*source_desc
,
636 union acpi_operand_object
*target_desc
);
639 acpi_ex_copy_data_to_named_field (
640 union acpi_operand_object
*source_desc
,
641 struct acpi_namespace_node
*node
);
644 acpi_ex_copy_integer_to_buffer_field (
645 union acpi_operand_object
*source_desc
,
646 union acpi_operand_object
*target_desc
);
649 * exutils - interpreter/scanner utilities
653 acpi_ex_enter_interpreter (
657 acpi_ex_exit_interpreter (
661 acpi_ex_truncate_for32bit_table (
662 union acpi_operand_object
*obj_desc
);
665 acpi_ex_acquire_global_lock (
669 acpi_ex_release_global_lock (
673 acpi_ex_digits_needed (
678 acpi_ex_eisa_id_to_string (
683 acpi_ex_unsigned_integer_to_string (
689 * exregion - default op_region handlers
693 acpi_ex_system_memory_space_handler (
695 acpi_physical_address address
,
698 void *handler_context
,
699 void *region_context
);
702 acpi_ex_system_io_space_handler (
704 acpi_physical_address address
,
707 void *handler_context
,
708 void *region_context
);
711 acpi_ex_pci_config_space_handler (
713 acpi_physical_address address
,
716 void *handler_context
,
717 void *region_context
);
720 acpi_ex_cmos_space_handler (
722 acpi_physical_address address
,
725 void *handler_context
,
726 void *region_context
);
729 acpi_ex_pci_bar_space_handler (
731 acpi_physical_address address
,
734 void *handler_context
,
735 void *region_context
);
738 acpi_ex_embedded_controller_space_handler (
740 acpi_physical_address address
,
743 void *handler_context
,
744 void *region_context
);
747 acpi_ex_sm_bus_space_handler (
749 acpi_physical_address address
,
752 void *handler_context
,
753 void *region_context
);
757 acpi_ex_data_table_space_handler (
759 acpi_physical_address address
,
762 void *handler_context
,
763 void *region_context
);
765 #endif /* __INTERP_H__ */