Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver...
[linux-2.6/verdex.git] / include / acpi / acdispat.h
blob237d63433581cfa6d753a52cf3b6b2adbf94c572
1 /******************************************************************************
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2005, 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.
45 #ifndef _ACDISPAT_H_
46 #define _ACDISPAT_H_
49 #define NAMEOF_LOCAL_NTE "__L0"
50 #define NAMEOF_ARG_NTE "__A0"
53 /* Common interfaces */
55 acpi_status
56 acpi_ds_obj_stack_push (
57 void *object,
58 struct acpi_walk_state *walk_state);
60 acpi_status
61 acpi_ds_obj_stack_pop (
62 u32 pop_count,
63 struct acpi_walk_state *walk_state);
65 #ifdef ACPI_FUTURE_USAGE
66 void *
67 acpi_ds_obj_stack_get_value (
68 u32 index,
69 struct acpi_walk_state *walk_state);
70 #endif
72 acpi_status
73 acpi_ds_obj_stack_pop_object (
74 union acpi_operand_object **object,
75 struct acpi_walk_state *walk_state);
78 /* dsopcode - support for late evaluation */
80 acpi_status
81 acpi_ds_execute_arguments (
82 struct acpi_namespace_node *node,
83 struct acpi_namespace_node *scope_node,
84 u32 aml_length,
85 u8 *aml_start);
87 acpi_status
88 acpi_ds_get_buffer_field_arguments (
89 union acpi_operand_object *obj_desc);
91 acpi_status
92 acpi_ds_get_region_arguments (
93 union acpi_operand_object *rgn_desc);
95 acpi_status
96 acpi_ds_get_buffer_arguments (
97 union acpi_operand_object *obj_desc);
99 acpi_status
100 acpi_ds_get_package_arguments (
101 union acpi_operand_object *obj_desc);
103 acpi_status
104 acpi_ds_init_buffer_field (
105 u16 aml_opcode,
106 union acpi_operand_object *obj_desc,
107 union acpi_operand_object *buffer_desc,
108 union acpi_operand_object *offset_desc,
109 union acpi_operand_object *length_desc,
110 union acpi_operand_object *result_desc);
112 acpi_status
113 acpi_ds_eval_buffer_field_operands (
114 struct acpi_walk_state *walk_state,
115 union acpi_parse_object *op);
117 acpi_status
118 acpi_ds_eval_region_operands (
119 struct acpi_walk_state *walk_state,
120 union acpi_parse_object *op);
122 acpi_status
123 acpi_ds_eval_data_object_operands (
124 struct acpi_walk_state *walk_state,
125 union acpi_parse_object *op,
126 union acpi_operand_object *obj_desc);
128 acpi_status
129 acpi_ds_initialize_region (
130 acpi_handle obj_handle);
133 /* dsctrl - Parser/Interpreter interface, control stack routines */
136 acpi_status
137 acpi_ds_exec_begin_control_op (
138 struct acpi_walk_state *walk_state,
139 union acpi_parse_object *op);
141 acpi_status
142 acpi_ds_exec_end_control_op (
143 struct acpi_walk_state *walk_state,
144 union acpi_parse_object *op);
147 /* dsexec - Parser/Interpreter interface, method execution callbacks */
150 acpi_status
151 acpi_ds_get_predicate_value (
152 struct acpi_walk_state *walk_state,
153 union acpi_operand_object *result_obj);
155 acpi_status
156 acpi_ds_exec_begin_op (
157 struct acpi_walk_state *walk_state,
158 union acpi_parse_object **out_op);
160 acpi_status
161 acpi_ds_exec_end_op (
162 struct acpi_walk_state *state);
165 /* dsfield - Parser/Interpreter interface for AML fields */
167 acpi_status
168 acpi_ds_get_field_names (
169 struct acpi_create_field_info *info,
170 struct acpi_walk_state *walk_state,
171 union acpi_parse_object *arg);
173 acpi_status
174 acpi_ds_create_field (
175 union acpi_parse_object *op,
176 struct acpi_namespace_node *region_node,
177 struct acpi_walk_state *walk_state);
179 acpi_status
180 acpi_ds_create_bank_field (
181 union acpi_parse_object *op,
182 struct acpi_namespace_node *region_node,
183 struct acpi_walk_state *walk_state);
185 acpi_status
186 acpi_ds_create_index_field (
187 union acpi_parse_object *op,
188 struct acpi_namespace_node *region_node,
189 struct acpi_walk_state *walk_state);
191 acpi_status
192 acpi_ds_create_buffer_field (
193 union acpi_parse_object *op,
194 struct acpi_walk_state *walk_state);
196 acpi_status
197 acpi_ds_init_field_objects (
198 union acpi_parse_object *op,
199 struct acpi_walk_state *walk_state);
202 /* dsload - Parser/Interpreter interface, namespace load callbacks */
204 acpi_status
205 acpi_ds_load1_begin_op (
206 struct acpi_walk_state *walk_state,
207 union acpi_parse_object **out_op);
209 acpi_status
210 acpi_ds_load1_end_op (
211 struct acpi_walk_state *walk_state);
213 acpi_status
214 acpi_ds_load2_begin_op (
215 struct acpi_walk_state *walk_state,
216 union acpi_parse_object **out_op);
218 acpi_status
219 acpi_ds_load2_end_op (
220 struct acpi_walk_state *walk_state);
222 acpi_status
223 acpi_ds_init_callbacks (
224 struct acpi_walk_state *walk_state,
225 u32 pass_number);
228 /* dsmthdat - method data (locals/args) */
231 acpi_status
232 acpi_ds_store_object_to_local (
233 u16 opcode,
234 u32 index,
235 union acpi_operand_object *src_desc,
236 struct acpi_walk_state *walk_state);
238 acpi_status
239 acpi_ds_method_data_get_entry (
240 u16 opcode,
241 u32 index,
242 struct acpi_walk_state *walk_state,
243 union acpi_operand_object ***node);
245 void
246 acpi_ds_method_data_delete_all (
247 struct acpi_walk_state *walk_state);
250 acpi_ds_is_method_value (
251 union acpi_operand_object *obj_desc);
253 #ifdef ACPI_FUTURE_USAGE
254 acpi_object_type
255 acpi_ds_method_data_get_type (
256 u16 opcode,
257 u32 index,
258 struct acpi_walk_state *walk_state);
259 #endif
261 acpi_status
262 acpi_ds_method_data_get_value (
263 u16 opcode,
264 u32 index,
265 struct acpi_walk_state *walk_state,
266 union acpi_operand_object **dest_desc);
268 void
269 acpi_ds_method_data_delete_value (
270 u16 opcode,
271 u32 index,
272 struct acpi_walk_state *walk_state);
274 acpi_status
275 acpi_ds_method_data_init_args (
276 union acpi_operand_object **params,
277 u32 max_param_count,
278 struct acpi_walk_state *walk_state);
280 acpi_status
281 acpi_ds_method_data_get_node (
282 u16 opcode,
283 u32 index,
284 struct acpi_walk_state *walk_state,
285 struct acpi_namespace_node **node);
287 void
288 acpi_ds_method_data_init (
289 struct acpi_walk_state *walk_state);
291 acpi_status
292 acpi_ds_method_data_set_value (
293 u16 opcode,
294 u32 index,
295 union acpi_operand_object *object,
296 struct acpi_walk_state *walk_state);
299 /* dsmethod - Parser/Interpreter interface - control method parsing */
301 acpi_status
302 acpi_ds_parse_method (
303 acpi_handle obj_handle);
305 acpi_status
306 acpi_ds_call_control_method (
307 struct acpi_thread_state *thread,
308 struct acpi_walk_state *walk_state,
309 union acpi_parse_object *op);
311 acpi_status
312 acpi_ds_restart_control_method (
313 struct acpi_walk_state *walk_state,
314 union acpi_operand_object *return_desc);
316 acpi_status
317 acpi_ds_terminate_control_method (
318 struct acpi_walk_state *walk_state);
320 acpi_status
321 acpi_ds_begin_method_execution (
322 struct acpi_namespace_node *method_node,
323 union acpi_operand_object *obj_desc,
324 struct acpi_namespace_node *calling_method_node);
327 /* dsobj - Parser/Interpreter interface - object initialization and conversion */
329 acpi_status
330 acpi_ds_init_one_object (
331 acpi_handle obj_handle,
332 u32 level,
333 void *context,
334 void **return_value);
336 acpi_status
337 acpi_ds_initialize_objects (
338 struct acpi_table_desc *table_desc,
339 struct acpi_namespace_node *start_node);
341 acpi_status
342 acpi_ds_build_internal_buffer_obj (
343 struct acpi_walk_state *walk_state,
344 union acpi_parse_object *op,
345 u32 buffer_length,
346 union acpi_operand_object **obj_desc_ptr);
348 acpi_status
349 acpi_ds_build_internal_package_obj (
350 struct acpi_walk_state *walk_state,
351 union acpi_parse_object *op,
352 u32 package_length,
353 union acpi_operand_object **obj_desc);
355 acpi_status
356 acpi_ds_build_internal_object (
357 struct acpi_walk_state *walk_state,
358 union acpi_parse_object *op,
359 union acpi_operand_object **obj_desc_ptr);
361 acpi_status
362 acpi_ds_init_object_from_op (
363 struct acpi_walk_state *walk_state,
364 union acpi_parse_object *op,
365 u16 opcode,
366 union acpi_operand_object **obj_desc);
368 acpi_status
369 acpi_ds_create_node (
370 struct acpi_walk_state *walk_state,
371 struct acpi_namespace_node *node,
372 union acpi_parse_object *op);
375 /* dsutils - Parser/Interpreter interface utility routines */
377 void
378 acpi_ds_clear_implicit_return (
379 struct acpi_walk_state *walk_state);
382 acpi_ds_do_implicit_return (
383 union acpi_operand_object *return_desc,
384 struct acpi_walk_state *walk_state,
385 u8 add_reference);
388 acpi_ds_is_result_used (
389 union acpi_parse_object *op,
390 struct acpi_walk_state *walk_state);
392 void
393 acpi_ds_delete_result_if_not_used (
394 union acpi_parse_object *op,
395 union acpi_operand_object *result_obj,
396 struct acpi_walk_state *walk_state);
398 acpi_status
399 acpi_ds_create_operand (
400 struct acpi_walk_state *walk_state,
401 union acpi_parse_object *arg,
402 u32 args_remaining);
404 acpi_status
405 acpi_ds_create_operands (
406 struct acpi_walk_state *walk_state,
407 union acpi_parse_object *first_arg);
409 acpi_status
410 acpi_ds_resolve_operands (
411 struct acpi_walk_state *walk_state);
413 void
414 acpi_ds_clear_operands (
415 struct acpi_walk_state *walk_state);
419 * dswscope - Scope Stack manipulation
422 acpi_status
423 acpi_ds_scope_stack_push (
424 struct acpi_namespace_node *node,
425 acpi_object_type type,
426 struct acpi_walk_state *walk_state);
429 acpi_status
430 acpi_ds_scope_stack_pop (
431 struct acpi_walk_state *walk_state);
433 void
434 acpi_ds_scope_stack_clear (
435 struct acpi_walk_state *walk_state);
438 /* dswstate - parser WALK_STATE management routines */
440 struct acpi_walk_state *
441 acpi_ds_create_walk_state (
442 acpi_owner_id owner_id,
443 union acpi_parse_object *origin,
444 union acpi_operand_object *mth_desc,
445 struct acpi_thread_state *thread);
447 acpi_status
448 acpi_ds_init_aml_walk (
449 struct acpi_walk_state *walk_state,
450 union acpi_parse_object *op,
451 struct acpi_namespace_node *method_node,
452 u8 *aml_start,
453 u32 aml_length,
454 struct acpi_parameter_info *info,
455 u32 pass_number);
457 #ifdef ACPI_FUTURE_USAGE
458 acpi_status
459 acpi_ds_obj_stack_delete_all (
460 struct acpi_walk_state *walk_state);
461 #endif
463 acpi_status
464 acpi_ds_obj_stack_pop_and_delete (
465 u32 pop_count,
466 struct acpi_walk_state *walk_state);
468 void
469 acpi_ds_delete_walk_state (
470 struct acpi_walk_state *walk_state);
472 struct acpi_walk_state *
473 acpi_ds_pop_walk_state (
474 struct acpi_thread_state *thread);
476 void
477 acpi_ds_push_walk_state (
478 struct acpi_walk_state *walk_state,
479 struct acpi_thread_state *thread);
481 acpi_status
482 acpi_ds_result_stack_pop (
483 struct acpi_walk_state *walk_state);
485 acpi_status
486 acpi_ds_result_stack_push (
487 struct acpi_walk_state *walk_state);
489 acpi_status
490 acpi_ds_result_stack_clear (
491 struct acpi_walk_state *walk_state);
493 struct acpi_walk_state *
494 acpi_ds_get_current_walk_state (
495 struct acpi_thread_state *thread);
497 #ifdef ACPI_ENABLE_OBJECT_CACHE
498 void
499 acpi_ds_delete_walk_state_cache (
500 void);
501 #endif
503 #ifdef ACPI_FUTURE_USAGE
504 acpi_status
505 acpi_ds_result_insert (
506 void *object,
507 u32 index,
508 struct acpi_walk_state *walk_state);
510 acpi_status
511 acpi_ds_result_remove (
512 union acpi_operand_object **object,
513 u32 index,
514 struct acpi_walk_state *walk_state);
515 #endif
517 acpi_status
518 acpi_ds_result_pop (
519 union acpi_operand_object **object,
520 struct acpi_walk_state *walk_state);
522 acpi_status
523 acpi_ds_result_push (
524 union acpi_operand_object *object,
525 struct acpi_walk_state *walk_state);
527 acpi_status
528 acpi_ds_result_pop_from_bottom (
529 union acpi_operand_object **object,
530 struct acpi_walk_state *walk_state);
532 #endif /* _ACDISPAT_H_ */