MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / acpi / acinterp.h
bloba43e91fb972cf51c75b0df281cf37df92e3dcb48
1 /******************************************************************************
3 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2004, R. Byron Moore
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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]))
51 acpi_status
52 acpi_ex_resolve_operands (
53 u16 opcode,
54 union acpi_operand_object **stack_ptr,
55 struct acpi_walk_state *walk_state);
57 acpi_status
58 acpi_ex_check_object_type (
59 acpi_object_type type_needed,
60 acpi_object_type this_type,
61 void *object);
64 * exxface - External interpreter interfaces
67 acpi_status
68 acpi_ex_load_table (
69 acpi_table_type table_id);
71 acpi_status
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
82 acpi_status
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);
88 acpi_status
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);
94 acpi_status
95 acpi_ex_convert_to_string (
96 union acpi_operand_object *obj_desc,
97 union acpi_operand_object **result_desc,
98 u32 base,
99 u32 max_length,
100 struct acpi_walk_state *walk_state);
102 acpi_status
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,
112 u32 base,
113 u8 *string,
114 u8 max_length);
117 * exfield - ACPI AML (p-code) execution - field manipulation
120 acpi_status
121 acpi_ex_common_buffer_setup (
122 union acpi_operand_object *obj_desc,
123 u32 buffer_length,
124 u32 *datum_count);
126 acpi_status
127 acpi_ex_extract_from_field (
128 union acpi_operand_object *obj_desc,
129 void *buffer,
130 u32 buffer_length);
132 acpi_status
133 acpi_ex_insert_into_field (
134 union acpi_operand_object *obj_desc,
135 void *buffer,
136 u32 buffer_length);
138 acpi_status
139 acpi_ex_setup_region (
140 union acpi_operand_object *obj_desc,
141 u32 field_datum_byte_offset);
143 acpi_status
144 acpi_ex_access_region (
145 union acpi_operand_object *obj_desc,
146 u32 field_datum_byte_offset,
147 acpi_integer *value,
148 u32 read_write);
151 acpi_ex_register_overflow (
152 union acpi_operand_object *obj_desc,
153 acpi_integer value);
155 acpi_status
156 acpi_ex_field_datum_io (
157 union acpi_operand_object *obj_desc,
158 u32 field_datum_byte_offset,
159 acpi_integer *value,
160 u32 read_write);
162 acpi_status
163 acpi_ex_write_with_update_rule (
164 union acpi_operand_object *obj_desc,
165 acpi_integer mask,
166 acpi_integer field_value,
167 u32 field_datum_byte_offset);
169 void
170 acpi_ex_get_buffer_datum(
171 acpi_integer *datum,
172 void *buffer,
173 u32 buffer_length,
174 u32 byte_granularity,
175 u32 buffer_offset);
177 void
178 acpi_ex_set_buffer_datum (
179 acpi_integer merged_datum,
180 void *buffer,
181 u32 buffer_length,
182 u32 byte_granularity,
183 u32 buffer_offset);
185 acpi_status
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);
191 acpi_status
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
201 acpi_status
202 acpi_ex_opcode_3A_0T_0R (
203 struct acpi_walk_state *walk_state);
205 acpi_status
206 acpi_ex_opcode_3A_1T_1R (
207 struct acpi_walk_state *walk_state);
209 acpi_status
210 acpi_ex_opcode_6A_0T_1R (
211 struct acpi_walk_state *walk_state);
214 acpi_ex_do_match (
215 u32 match_op,
216 acpi_integer package_value,
217 acpi_integer match_value);
219 acpi_status
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);
225 acpi_status
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);
232 acpi_status
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);
239 acpi_status
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 (
248 u16 opcode,
249 union acpi_operand_object *obj_desc,
250 union acpi_operand_object *obj_desc2);
252 acpi_integer
253 acpi_ex_do_math_op (
254 u16 opcode,
255 acpi_integer operand0,
256 acpi_integer operand1);
258 acpi_status
259 acpi_ex_create_mutex (
260 struct acpi_walk_state *walk_state);
262 acpi_status
263 acpi_ex_create_processor (
264 struct acpi_walk_state *walk_state);
266 acpi_status
267 acpi_ex_create_power_resource (
268 struct acpi_walk_state *walk_state);
270 acpi_status
271 acpi_ex_create_region (
272 u8 *aml_start,
273 u32 aml_length,
274 u8 region_space,
275 struct acpi_walk_state *walk_state);
277 acpi_status
278 acpi_ex_create_table_region (
279 struct acpi_walk_state *walk_state);
281 acpi_status
282 acpi_ex_create_event (
283 struct acpi_walk_state *walk_state);
285 acpi_status
286 acpi_ex_create_alias (
287 struct acpi_walk_state *walk_state);
289 acpi_status
290 acpi_ex_create_method (
291 u8 *aml_start,
292 u32 aml_length,
293 struct acpi_walk_state *walk_state);
297 * exconfig - dynamic table load/unload
300 acpi_status
301 acpi_ex_add_table (
302 struct acpi_table_header *table,
303 struct acpi_namespace_node *parent_node,
304 union acpi_operand_object **ddb_handle);
306 acpi_status
307 acpi_ex_load_op (
308 union acpi_operand_object *obj_desc,
309 union acpi_operand_object *target,
310 struct acpi_walk_state *walk_state);
312 acpi_status
313 acpi_ex_load_table_op (
314 struct acpi_walk_state *walk_state,
315 union acpi_operand_object **return_desc);
317 acpi_status
318 acpi_ex_unload_table (
319 union acpi_operand_object *ddb_handle);
323 * exmutex - mutex support
326 acpi_status
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);
332 acpi_status
333 acpi_ex_release_mutex (
334 union acpi_operand_object *obj_desc,
335 struct acpi_walk_state *walk_state);
337 void
338 acpi_ex_release_all_mutexes (
339 struct acpi_thread_state *thread);
341 void
342 acpi_ex_unlink_mutex (
343 union acpi_operand_object *obj_desc);
345 void
346 acpi_ex_link_mutex (
347 union acpi_operand_object *obj_desc,
348 struct acpi_thread_state *thread);
351 * exprep - ACPI AML (p-code) execution - prep utilities
354 acpi_status
355 acpi_ex_prep_common_field_object (
356 union acpi_operand_object *obj_desc,
357 u8 field_flags,
358 u8 field_attribute,
359 u32 field_bit_position,
360 u32 field_bit_length);
362 acpi_status
363 acpi_ex_prep_field_value (
364 struct acpi_create_field_info *info);
367 * exsystem - Interface to OS services
370 acpi_status
371 acpi_ex_system_do_notify_op (
372 union acpi_operand_object *value,
373 union acpi_operand_object *obj_desc);
375 acpi_status
376 acpi_ex_system_do_suspend(
377 u32 time);
379 acpi_status
380 acpi_ex_system_do_stall (
381 u32 time);
383 acpi_status
384 acpi_ex_system_acquire_mutex(
385 union acpi_operand_object *time,
386 union acpi_operand_object *obj_desc);
388 acpi_status
389 acpi_ex_system_release_mutex(
390 union acpi_operand_object *obj_desc);
392 acpi_status
393 acpi_ex_system_signal_event(
394 union acpi_operand_object *obj_desc);
396 acpi_status
397 acpi_ex_system_wait_event(
398 union acpi_operand_object *time,
399 union acpi_operand_object *obj_desc);
401 acpi_status
402 acpi_ex_system_reset_event(
403 union acpi_operand_object *obj_desc);
405 acpi_status
406 acpi_ex_system_wait_semaphore (
407 acpi_handle semaphore,
408 u16 timeout);
412 * exmonadic - ACPI AML (p-code) execution, monadic operators
415 acpi_status
416 acpi_ex_opcode_1A_0T_0R (
417 struct acpi_walk_state *walk_state);
419 acpi_status
420 acpi_ex_opcode_1A_0T_1R (
421 struct acpi_walk_state *walk_state);
423 acpi_status
424 acpi_ex_opcode_1A_1T_1R (
425 struct acpi_walk_state *walk_state);
427 acpi_status
428 acpi_ex_opcode_1A_1T_0R (
429 struct acpi_walk_state *walk_state);
432 * exdyadic - ACPI AML (p-code) execution, dyadic operators
435 acpi_status
436 acpi_ex_opcode_2A_0T_0R (
437 struct acpi_walk_state *walk_state);
439 acpi_status
440 acpi_ex_opcode_2A_0T_1R (
441 struct acpi_walk_state *walk_state);
443 acpi_status
444 acpi_ex_opcode_2A_1T_1R (
445 struct acpi_walk_state *walk_state);
447 acpi_status
448 acpi_ex_opcode_2A_2T_1R (
449 struct acpi_walk_state *walk_state);
453 * exresolv - Object resolution and get value functions
456 acpi_status
457 acpi_ex_resolve_to_value (
458 union acpi_operand_object **stack_ptr,
459 struct acpi_walk_state *walk_state);
461 acpi_status
462 acpi_ex_resolve_node_to_value (
463 struct acpi_namespace_node **stack_ptr,
464 struct acpi_walk_state *walk_state);
466 acpi_status
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
476 void
477 acpi_ex_dump_operand (
478 union acpi_operand_object *entry_desc);
480 void
481 acpi_ex_dump_operands (
482 union acpi_operand_object **operands,
483 acpi_interpreter_mode interpreter_mode,
484 char *ident,
485 u32 num_levels,
486 char *note,
487 char *module_name,
488 u32 line_number);
490 void
491 acpi_ex_dump_object_descriptor (
492 union acpi_operand_object *object,
493 u32 flags);
495 void
496 acpi_ex_dump_node (
497 struct acpi_namespace_node *node,
498 u32 flags);
500 void
501 acpi_ex_out_string (
502 char *title,
503 char *value);
505 void
506 acpi_ex_out_pointer (
507 char *title,
508 void *value);
510 void
511 acpi_ex_out_integer (
512 char *title,
513 u32 value);
515 void
516 acpi_ex_out_address (
517 char *title,
518 acpi_physical_address value);
522 * exnames - interpreter/scanner name load/execute
525 char *
526 acpi_ex_allocate_name_string (
527 u32 prefix_count,
528 u32 num_name_segs);
531 acpi_ex_good_char (
532 u32 character);
534 acpi_status
535 acpi_ex_name_segment (
536 u8 **in_aml_address,
537 char *name_string);
539 acpi_status
540 acpi_ex_get_name_string (
541 acpi_object_type data_type,
542 u8 *in_aml_address,
543 char **out_name_string,
544 u32 *out_name_length);
546 acpi_status
547 acpi_ex_do_name (
548 acpi_object_type data_type,
549 acpi_interpreter_mode load_exec_mode);
553 * exstore - Object store support
556 acpi_status
557 acpi_ex_store (
558 union acpi_operand_object *val_desc,
559 union acpi_operand_object *dest_desc,
560 struct acpi_walk_state *walk_state);
562 acpi_status
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);
568 acpi_status
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
579 * exstoren
582 acpi_status
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);
588 acpi_status
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
600 acpi_status
601 acpi_ex_store_buffer_to_buffer (
602 union acpi_operand_object *source_desc,
603 union acpi_operand_object *target_desc);
605 acpi_status
606 acpi_ex_store_string_to_string (
607 union acpi_operand_object *source_desc,
608 union acpi_operand_object *target_desc);
610 acpi_status
611 acpi_ex_copy_integer_to_index_field (
612 union acpi_operand_object *source_desc,
613 union acpi_operand_object *target_desc);
615 acpi_status
616 acpi_ex_copy_integer_to_bank_field (
617 union acpi_operand_object *source_desc,
618 union acpi_operand_object *target_desc);
620 acpi_status
621 acpi_ex_copy_data_to_named_field (
622 union acpi_operand_object *source_desc,
623 struct acpi_namespace_node *node);
625 acpi_status
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
634 acpi_status
635 acpi_ex_enter_interpreter (
636 void);
638 void
639 acpi_ex_exit_interpreter (
640 void);
642 void
643 acpi_ex_truncate_for32bit_table (
644 union acpi_operand_object *obj_desc);
647 acpi_ex_acquire_global_lock (
648 u32 rule);
650 void
651 acpi_ex_release_global_lock (
652 u8 locked);
655 acpi_ex_digits_needed (
656 acpi_integer value,
657 u32 base);
659 void
660 acpi_ex_eisa_id_to_string (
661 u32 numeric_id,
662 char *out_string);
664 void
665 acpi_ex_unsigned_integer_to_string (
666 acpi_integer value,
667 char *out_string);
671 * exregion - default op_region handlers
674 acpi_status
675 acpi_ex_system_memory_space_handler (
676 u32 function,
677 acpi_physical_address address,
678 u32 bit_width,
679 acpi_integer *value,
680 void *handler_context,
681 void *region_context);
683 acpi_status
684 acpi_ex_system_io_space_handler (
685 u32 function,
686 acpi_physical_address address,
687 u32 bit_width,
688 acpi_integer *value,
689 void *handler_context,
690 void *region_context);
692 acpi_status
693 acpi_ex_pci_config_space_handler (
694 u32 function,
695 acpi_physical_address address,
696 u32 bit_width,
697 acpi_integer *value,
698 void *handler_context,
699 void *region_context);
701 acpi_status
702 acpi_ex_cmos_space_handler (
703 u32 function,
704 acpi_physical_address address,
705 u32 bit_width,
706 acpi_integer *value,
707 void *handler_context,
708 void *region_context);
710 acpi_status
711 acpi_ex_pci_bar_space_handler (
712 u32 function,
713 acpi_physical_address address,
714 u32 bit_width,
715 acpi_integer *value,
716 void *handler_context,
717 void *region_context);
719 acpi_status
720 acpi_ex_embedded_controller_space_handler (
721 u32 function,
722 acpi_physical_address address,
723 u32 bit_width,
724 acpi_integer *value,
725 void *handler_context,
726 void *region_context);
728 acpi_status
729 acpi_ex_sm_bus_space_handler (
730 u32 function,
731 acpi_physical_address address,
732 u32 bit_width,
733 acpi_integer *value,
734 void *handler_context,
735 void *region_context);
738 acpi_status
739 acpi_ex_data_table_space_handler (
740 u32 function,
741 acpi_physical_address address,
742 u32 bit_width,
743 acpi_integer *value,
744 void *handler_context,
745 void *region_context);
747 #endif /* __INTERP_H__ */