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_common_buffer_setup (
122 union acpi_operand_object
*obj_desc
,
127 acpi_ex_extract_from_field (
128 union acpi_operand_object
*obj_desc
,
133 acpi_ex_insert_into_field (
134 union acpi_operand_object
*obj_desc
,
139 acpi_ex_setup_region (
140 union acpi_operand_object
*obj_desc
,
141 u32 field_datum_byte_offset
);
144 acpi_ex_access_region (
145 union acpi_operand_object
*obj_desc
,
146 u32 field_datum_byte_offset
,
151 acpi_ex_register_overflow (
152 union acpi_operand_object
*obj_desc
,
156 acpi_ex_field_datum_io (
157 union acpi_operand_object
*obj_desc
,
158 u32 field_datum_byte_offset
,
163 acpi_ex_write_with_update_rule (
164 union acpi_operand_object
*obj_desc
,
166 acpi_integer field_value
,
167 u32 field_datum_byte_offset
);
170 acpi_ex_get_buffer_datum(
174 u32 byte_granularity
,
178 acpi_ex_set_buffer_datum (
179 acpi_integer merged_datum
,
182 u32 byte_granularity
,
186 acpi_ex_read_data_from_field (
187 struct acpi_walk_state
*walk_state
,
188 union acpi_operand_object
*obj_desc
,
189 union acpi_operand_object
**ret_buffer_desc
);
192 acpi_ex_write_data_to_field (
193 union acpi_operand_object
*source_desc
,
194 union acpi_operand_object
*obj_desc
,
195 union acpi_operand_object
**result_desc
);
198 * exmisc - ACPI AML (p-code) execution - specific opcodes
202 acpi_ex_opcode_3A_0T_0R (
203 struct acpi_walk_state
*walk_state
);
206 acpi_ex_opcode_3A_1T_1R (
207 struct acpi_walk_state
*walk_state
);
210 acpi_ex_opcode_6A_0T_1R (
211 struct acpi_walk_state
*walk_state
);
216 acpi_integer package_value
,
217 acpi_integer match_value
);
220 acpi_ex_get_object_reference (
221 union acpi_operand_object
*obj_desc
,
222 union acpi_operand_object
**return_desc
,
223 struct acpi_walk_state
*walk_state
);
226 acpi_ex_resolve_multiple (
227 struct acpi_walk_state
*walk_state
,
228 union acpi_operand_object
*operand
,
229 acpi_object_type
*return_type
,
230 union acpi_operand_object
**return_desc
);
233 acpi_ex_concat_template (
234 union acpi_operand_object
*obj_desc
,
235 union acpi_operand_object
*obj_desc2
,
236 union acpi_operand_object
**actual_return_desc
,
237 struct acpi_walk_state
*walk_state
);
240 acpi_ex_do_concatenate (
241 union acpi_operand_object
*obj_desc
,
242 union acpi_operand_object
*obj_desc2
,
243 union acpi_operand_object
**actual_return_desc
,
244 struct acpi_walk_state
*walk_state
);
247 acpi_ex_do_logical_op (
249 union acpi_operand_object
*obj_desc
,
250 union acpi_operand_object
*obj_desc2
);
255 acpi_integer operand0
,
256 acpi_integer operand1
);
259 acpi_ex_create_mutex (
260 struct acpi_walk_state
*walk_state
);
263 acpi_ex_create_processor (
264 struct acpi_walk_state
*walk_state
);
267 acpi_ex_create_power_resource (
268 struct acpi_walk_state
*walk_state
);
271 acpi_ex_create_region (
275 struct acpi_walk_state
*walk_state
);
278 acpi_ex_create_table_region (
279 struct acpi_walk_state
*walk_state
);
282 acpi_ex_create_event (
283 struct acpi_walk_state
*walk_state
);
286 acpi_ex_create_alias (
287 struct acpi_walk_state
*walk_state
);
290 acpi_ex_create_method (
293 struct acpi_walk_state
*walk_state
);
297 * exconfig - dynamic table load/unload
302 struct acpi_table_header
*table
,
303 struct acpi_namespace_node
*parent_node
,
304 union acpi_operand_object
**ddb_handle
);
308 union acpi_operand_object
*obj_desc
,
309 union acpi_operand_object
*target
,
310 struct acpi_walk_state
*walk_state
);
313 acpi_ex_load_table_op (
314 struct acpi_walk_state
*walk_state
,
315 union acpi_operand_object
**return_desc
);
318 acpi_ex_unload_table (
319 union acpi_operand_object
*ddb_handle
);
323 * exmutex - mutex support
327 acpi_ex_acquire_mutex (
328 union acpi_operand_object
*time_desc
,
329 union acpi_operand_object
*obj_desc
,
330 struct acpi_walk_state
*walk_state
);
333 acpi_ex_release_mutex (
334 union acpi_operand_object
*obj_desc
,
335 struct acpi_walk_state
*walk_state
);
338 acpi_ex_release_all_mutexes (
339 struct acpi_thread_state
*thread
);
342 acpi_ex_unlink_mutex (
343 union acpi_operand_object
*obj_desc
);
347 union acpi_operand_object
*obj_desc
,
348 struct acpi_thread_state
*thread
);
351 * exprep - ACPI AML (p-code) execution - prep utilities
355 acpi_ex_prep_common_field_object (
356 union acpi_operand_object
*obj_desc
,
359 u32 field_bit_position
,
360 u32 field_bit_length
);
363 acpi_ex_prep_field_value (
364 struct acpi_create_field_info
*info
);
367 * exsystem - Interface to OS services
371 acpi_ex_system_do_notify_op (
372 union acpi_operand_object
*value
,
373 union acpi_operand_object
*obj_desc
);
376 acpi_ex_system_do_suspend(
380 acpi_ex_system_do_stall (
384 acpi_ex_system_acquire_mutex(
385 union acpi_operand_object
*time
,
386 union acpi_operand_object
*obj_desc
);
389 acpi_ex_system_release_mutex(
390 union acpi_operand_object
*obj_desc
);
393 acpi_ex_system_signal_event(
394 union acpi_operand_object
*obj_desc
);
397 acpi_ex_system_wait_event(
398 union acpi_operand_object
*time
,
399 union acpi_operand_object
*obj_desc
);
402 acpi_ex_system_reset_event(
403 union acpi_operand_object
*obj_desc
);
406 acpi_ex_system_wait_semaphore (
407 acpi_handle semaphore
,
412 * exmonadic - ACPI AML (p-code) execution, monadic operators
416 acpi_ex_opcode_1A_0T_0R (
417 struct acpi_walk_state
*walk_state
);
420 acpi_ex_opcode_1A_0T_1R (
421 struct acpi_walk_state
*walk_state
);
424 acpi_ex_opcode_1A_1T_1R (
425 struct acpi_walk_state
*walk_state
);
428 acpi_ex_opcode_1A_1T_0R (
429 struct acpi_walk_state
*walk_state
);
432 * exdyadic - ACPI AML (p-code) execution, dyadic operators
436 acpi_ex_opcode_2A_0T_0R (
437 struct acpi_walk_state
*walk_state
);
440 acpi_ex_opcode_2A_0T_1R (
441 struct acpi_walk_state
*walk_state
);
444 acpi_ex_opcode_2A_1T_1R (
445 struct acpi_walk_state
*walk_state
);
448 acpi_ex_opcode_2A_2T_1R (
449 struct acpi_walk_state
*walk_state
);
453 * exresolv - Object resolution and get value functions
457 acpi_ex_resolve_to_value (
458 union acpi_operand_object
**stack_ptr
,
459 struct acpi_walk_state
*walk_state
);
462 acpi_ex_resolve_node_to_value (
463 struct acpi_namespace_node
**stack_ptr
,
464 struct acpi_walk_state
*walk_state
);
467 acpi_ex_resolve_object_to_value (
468 union acpi_operand_object
**stack_ptr
,
469 struct acpi_walk_state
*walk_state
);
473 * exdump - Scanner debug output routines
477 acpi_ex_dump_operand (
478 union acpi_operand_object
*entry_desc
);
481 acpi_ex_dump_operands (
482 union acpi_operand_object
**operands
,
483 acpi_interpreter_mode interpreter_mode
,
491 acpi_ex_dump_object_descriptor (
492 union acpi_operand_object
*object
,
497 struct acpi_namespace_node
*node
,
506 acpi_ex_out_pointer (
511 acpi_ex_out_integer (
516 acpi_ex_out_address (
518 acpi_physical_address value
);
522 * exnames - interpreter/scanner name load/execute
526 acpi_ex_allocate_name_string (
535 acpi_ex_name_segment (
540 acpi_ex_get_name_string (
541 acpi_object_type data_type
,
543 char **out_name_string
,
544 u32
*out_name_length
);
548 acpi_object_type data_type
,
549 acpi_interpreter_mode load_exec_mode
);
553 * exstore - Object store support
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_index (
564 union acpi_operand_object
*val_desc
,
565 union acpi_operand_object
*dest_desc
,
566 struct acpi_walk_state
*walk_state
);
569 acpi_ex_store_object_to_node (
570 union acpi_operand_object
*source_desc
,
571 struct acpi_namespace_node
*node
,
572 struct acpi_walk_state
*walk_state
,
573 u8 implicit_conversion
);
575 #define ACPI_IMPLICIT_CONVERSION TRUE
576 #define ACPI_NO_IMPLICIT_CONVERSION FALSE
583 acpi_ex_resolve_object (
584 union acpi_operand_object
**source_desc_ptr
,
585 acpi_object_type target_type
,
586 struct acpi_walk_state
*walk_state
);
589 acpi_ex_store_object_to_object (
590 union acpi_operand_object
*source_desc
,
591 union acpi_operand_object
*dest_desc
,
592 union acpi_operand_object
**new_desc
,
593 struct acpi_walk_state
*walk_state
);
597 * excopy - object copy
601 acpi_ex_store_buffer_to_buffer (
602 union acpi_operand_object
*source_desc
,
603 union acpi_operand_object
*target_desc
);
606 acpi_ex_store_string_to_string (
607 union acpi_operand_object
*source_desc
,
608 union acpi_operand_object
*target_desc
);
611 acpi_ex_copy_integer_to_index_field (
612 union acpi_operand_object
*source_desc
,
613 union acpi_operand_object
*target_desc
);
616 acpi_ex_copy_integer_to_bank_field (
617 union acpi_operand_object
*source_desc
,
618 union acpi_operand_object
*target_desc
);
621 acpi_ex_copy_data_to_named_field (
622 union acpi_operand_object
*source_desc
,
623 struct acpi_namespace_node
*node
);
626 acpi_ex_copy_integer_to_buffer_field (
627 union acpi_operand_object
*source_desc
,
628 union acpi_operand_object
*target_desc
);
631 * exutils - interpreter/scanner utilities
635 acpi_ex_enter_interpreter (
639 acpi_ex_exit_interpreter (
643 acpi_ex_truncate_for32bit_table (
644 union acpi_operand_object
*obj_desc
);
647 acpi_ex_acquire_global_lock (
651 acpi_ex_release_global_lock (
655 acpi_ex_digits_needed (
660 acpi_ex_eisa_id_to_string (
665 acpi_ex_unsigned_integer_to_string (
671 * exregion - default op_region handlers
675 acpi_ex_system_memory_space_handler (
677 acpi_physical_address address
,
680 void *handler_context
,
681 void *region_context
);
684 acpi_ex_system_io_space_handler (
686 acpi_physical_address address
,
689 void *handler_context
,
690 void *region_context
);
693 acpi_ex_pci_config_space_handler (
695 acpi_physical_address address
,
698 void *handler_context
,
699 void *region_context
);
702 acpi_ex_cmos_space_handler (
704 acpi_physical_address address
,
707 void *handler_context
,
708 void *region_context
);
711 acpi_ex_pci_bar_space_handler (
713 acpi_physical_address address
,
716 void *handler_context
,
717 void *region_context
);
720 acpi_ex_embedded_controller_space_handler (
722 acpi_physical_address address
,
725 void *handler_context
,
726 void *region_context
);
729 acpi_ex_sm_bus_space_handler (
731 acpi_physical_address address
,
734 void *handler_context
,
735 void *region_context
);
739 acpi_ex_data_table_space_handler (
741 acpi_physical_address address
,
744 void *handler_context
,
745 void *region_context
);
747 #endif /* __INTERP_H__ */