Merge /spare/repo/linux-2.6/
[deliverable/linux.git] / include / acpi / acdispat.h
CommitLineData
1da177e4
LT
1/******************************************************************************
2 *
3 * Name: acdispat.h - dispatcher (parser to interpreter interface)
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
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.
25 *
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.
29 *
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.
42 */
43
44
45#ifndef _ACDISPAT_H_
46#define _ACDISPAT_H_
47
48
49#define NAMEOF_LOCAL_NTE "__L0"
50#define NAMEOF_ARG_NTE "__A0"
51
52
44f6c012
RM
53/*
54 * dsopcode - support for late evaluation
55 */
1da177e4
LT
56acpi_status
57acpi_ds_get_buffer_field_arguments (
58 union acpi_operand_object *obj_desc);
59
60acpi_status
61acpi_ds_get_region_arguments (
62 union acpi_operand_object *rgn_desc);
63
64acpi_status
65acpi_ds_get_buffer_arguments (
66 union acpi_operand_object *obj_desc);
67
68acpi_status
69acpi_ds_get_package_arguments (
70 union acpi_operand_object *obj_desc);
71
1da177e4
LT
72acpi_status
73acpi_ds_eval_buffer_field_operands (
74 struct acpi_walk_state *walk_state,
75 union acpi_parse_object *op);
76
77acpi_status
78acpi_ds_eval_region_operands (
79 struct acpi_walk_state *walk_state,
80 union acpi_parse_object *op);
81
82acpi_status
83acpi_ds_eval_data_object_operands (
84 struct acpi_walk_state *walk_state,
85 union acpi_parse_object *op,
86 union acpi_operand_object *obj_desc);
87
88acpi_status
89acpi_ds_initialize_region (
90 acpi_handle obj_handle);
91
92
44f6c012
RM
93/*
94 * dsctrl - Parser/Interpreter interface, control stack routines
95 */
1da177e4
LT
96acpi_status
97acpi_ds_exec_begin_control_op (
98 struct acpi_walk_state *walk_state,
99 union acpi_parse_object *op);
100
101acpi_status
102acpi_ds_exec_end_control_op (
103 struct acpi_walk_state *walk_state,
104 union acpi_parse_object *op);
105
106
44f6c012
RM
107/*
108 * dsexec - Parser/Interpreter interface, method execution callbacks
109 */
1da177e4
LT
110acpi_status
111acpi_ds_get_predicate_value (
112 struct acpi_walk_state *walk_state,
113 union acpi_operand_object *result_obj);
114
115acpi_status
116acpi_ds_exec_begin_op (
117 struct acpi_walk_state *walk_state,
118 union acpi_parse_object **out_op);
119
120acpi_status
121acpi_ds_exec_end_op (
122 struct acpi_walk_state *state);
123
124
44f6c012
RM
125/*
126 * dsfield - Parser/Interpreter interface for AML fields
127 */
1da177e4
LT
128acpi_status
129acpi_ds_create_field (
130 union acpi_parse_object *op,
131 struct acpi_namespace_node *region_node,
132 struct acpi_walk_state *walk_state);
133
134acpi_status
135acpi_ds_create_bank_field (
136 union acpi_parse_object *op,
137 struct acpi_namespace_node *region_node,
138 struct acpi_walk_state *walk_state);
139
140acpi_status
141acpi_ds_create_index_field (
142 union acpi_parse_object *op,
143 struct acpi_namespace_node *region_node,
144 struct acpi_walk_state *walk_state);
145
146acpi_status
147acpi_ds_create_buffer_field (
148 union acpi_parse_object *op,
149 struct acpi_walk_state *walk_state);
150
151acpi_status
152acpi_ds_init_field_objects (
153 union acpi_parse_object *op,
154 struct acpi_walk_state *walk_state);
155
156
44f6c012
RM
157/*
158 * dsload - Parser/Interpreter interface, namespace load callbacks
159 */
1da177e4
LT
160acpi_status
161acpi_ds_load1_begin_op (
162 struct acpi_walk_state *walk_state,
163 union acpi_parse_object **out_op);
164
165acpi_status
166acpi_ds_load1_end_op (
167 struct acpi_walk_state *walk_state);
168
169acpi_status
170acpi_ds_load2_begin_op (
171 struct acpi_walk_state *walk_state,
172 union acpi_parse_object **out_op);
173
174acpi_status
175acpi_ds_load2_end_op (
176 struct acpi_walk_state *walk_state);
177
178acpi_status
179acpi_ds_init_callbacks (
180 struct acpi_walk_state *walk_state,
181 u32 pass_number);
182
183
44f6c012
RM
184/*
185 * dsmthdat - method data (locals/args)
186 */
1da177e4
LT
187acpi_status
188acpi_ds_store_object_to_local (
189 u16 opcode,
190 u32 index,
191 union acpi_operand_object *src_desc,
192 struct acpi_walk_state *walk_state);
193
194acpi_status
195acpi_ds_method_data_get_entry (
196 u16 opcode,
197 u32 index,
198 struct acpi_walk_state *walk_state,
199 union acpi_operand_object ***node);
200
201void
202acpi_ds_method_data_delete_all (
203 struct acpi_walk_state *walk_state);
204
205u8
206acpi_ds_is_method_value (
207 union acpi_operand_object *obj_desc);
208
1da177e4
LT
209acpi_status
210acpi_ds_method_data_get_value (
211 u16 opcode,
212 u32 index,
213 struct acpi_walk_state *walk_state,
214 union acpi_operand_object **dest_desc);
215
1da177e4
LT
216acpi_status
217acpi_ds_method_data_init_args (
218 union acpi_operand_object **params,
219 u32 max_param_count,
220 struct acpi_walk_state *walk_state);
221
222acpi_status
223acpi_ds_method_data_get_node (
224 u16 opcode,
225 u32 index,
226 struct acpi_walk_state *walk_state,
227 struct acpi_namespace_node **node);
228
229void
230acpi_ds_method_data_init (
231 struct acpi_walk_state *walk_state);
232
1da177e4 233
44f6c012
RM
234/*
235 * dsmethod - Parser/Interpreter interface - control method parsing
236 */
1da177e4
LT
237acpi_status
238acpi_ds_parse_method (
239 acpi_handle obj_handle);
240
241acpi_status
242acpi_ds_call_control_method (
243 struct acpi_thread_state *thread,
244 struct acpi_walk_state *walk_state,
245 union acpi_parse_object *op);
246
247acpi_status
248acpi_ds_restart_control_method (
249 struct acpi_walk_state *walk_state,
250 union acpi_operand_object *return_desc);
251
252acpi_status
253acpi_ds_terminate_control_method (
254 struct acpi_walk_state *walk_state);
255
256acpi_status
257acpi_ds_begin_method_execution (
258 struct acpi_namespace_node *method_node,
259 union acpi_operand_object *obj_desc,
260 struct acpi_namespace_node *calling_method_node);
261
262
44f6c012
RM
263/*
264 * dsinit
265 */
1da177e4
LT
266acpi_status
267acpi_ds_initialize_objects (
268 struct acpi_table_desc *table_desc,
269 struct acpi_namespace_node *start_node);
270
44f6c012
RM
271
272/*
273 * dsobject - Parser/Interpreter interface - object initialization and conversion
274 */
1da177e4
LT
275acpi_status
276acpi_ds_build_internal_buffer_obj (
277 struct acpi_walk_state *walk_state,
278 union acpi_parse_object *op,
279 u32 buffer_length,
280 union acpi_operand_object **obj_desc_ptr);
281
282acpi_status
283acpi_ds_build_internal_package_obj (
284 struct acpi_walk_state *walk_state,
285 union acpi_parse_object *op,
286 u32 package_length,
287 union acpi_operand_object **obj_desc);
288
1da177e4
LT
289acpi_status
290acpi_ds_init_object_from_op (
291 struct acpi_walk_state *walk_state,
292 union acpi_parse_object *op,
293 u16 opcode,
294 union acpi_operand_object **obj_desc);
295
296acpi_status
297acpi_ds_create_node (
298 struct acpi_walk_state *walk_state,
299 struct acpi_namespace_node *node,
300 union acpi_parse_object *op);
301
302
44f6c012
RM
303/*
304 * dsutils - Parser/Interpreter interface utility routines
305 */
1da177e4
LT
306void
307acpi_ds_clear_implicit_return (
308 struct acpi_walk_state *walk_state);
309
310u8
311acpi_ds_do_implicit_return (
312 union acpi_operand_object *return_desc,
313 struct acpi_walk_state *walk_state,
314 u8 add_reference);
315
316u8
317acpi_ds_is_result_used (
318 union acpi_parse_object *op,
319 struct acpi_walk_state *walk_state);
320
321void
322acpi_ds_delete_result_if_not_used (
323 union acpi_parse_object *op,
324 union acpi_operand_object *result_obj,
325 struct acpi_walk_state *walk_state);
326
327acpi_status
328acpi_ds_create_operand (
329 struct acpi_walk_state *walk_state,
330 union acpi_parse_object *arg,
331 u32 args_remaining);
332
333acpi_status
334acpi_ds_create_operands (
335 struct acpi_walk_state *walk_state,
336 union acpi_parse_object *first_arg);
337
338acpi_status
339acpi_ds_resolve_operands (
340 struct acpi_walk_state *walk_state);
341
342void
343acpi_ds_clear_operands (
344 struct acpi_walk_state *walk_state);
345
346
347/*
348 * dswscope - Scope Stack manipulation
349 */
1da177e4
LT
350acpi_status
351acpi_ds_scope_stack_push (
352 struct acpi_namespace_node *node,
353 acpi_object_type type,
354 struct acpi_walk_state *walk_state);
355
356
357acpi_status
358acpi_ds_scope_stack_pop (
359 struct acpi_walk_state *walk_state);
360
361void
362acpi_ds_scope_stack_clear (
363 struct acpi_walk_state *walk_state);
364
365
44f6c012
RM
366/*
367 * dswstate - parser WALK_STATE management routines
368 */
369acpi_status
370acpi_ds_obj_stack_push (
371 void *object,
372 struct acpi_walk_state *walk_state);
373
374acpi_status
375acpi_ds_obj_stack_pop (
376 u32 pop_count,
377 struct acpi_walk_state *walk_state);
1da177e4
LT
378
379struct acpi_walk_state *
380acpi_ds_create_walk_state (
381 acpi_owner_id owner_id,
382 union acpi_parse_object *origin,
383 union acpi_operand_object *mth_desc,
384 struct acpi_thread_state *thread);
385
386acpi_status
387acpi_ds_init_aml_walk (
388 struct acpi_walk_state *walk_state,
389 union acpi_parse_object *op,
390 struct acpi_namespace_node *method_node,
391 u8 *aml_start,
392 u32 aml_length,
393 struct acpi_parameter_info *info,
394 u32 pass_number);
395
1da177e4
LT
396acpi_status
397acpi_ds_obj_stack_pop_and_delete (
398 u32 pop_count,
399 struct acpi_walk_state *walk_state);
400
401void
402acpi_ds_delete_walk_state (
403 struct acpi_walk_state *walk_state);
404
405struct acpi_walk_state *
406acpi_ds_pop_walk_state (
407 struct acpi_thread_state *thread);
408
409void
410acpi_ds_push_walk_state (
411 struct acpi_walk_state *walk_state,
412 struct acpi_thread_state *thread);
413
414acpi_status
415acpi_ds_result_stack_pop (
416 struct acpi_walk_state *walk_state);
417
418acpi_status
419acpi_ds_result_stack_push (
420 struct acpi_walk_state *walk_state);
421
422acpi_status
423acpi_ds_result_stack_clear (
424 struct acpi_walk_state *walk_state);
425
426struct acpi_walk_state *
427acpi_ds_get_current_walk_state (
428 struct acpi_thread_state *thread);
429
1da177e4 430#ifdef ACPI_FUTURE_USAGE
1da177e4
LT
431acpi_status
432acpi_ds_result_remove (
433 union acpi_operand_object **object,
434 u32 index,
435 struct acpi_walk_state *walk_state);
436#endif
437
438acpi_status
439acpi_ds_result_pop (
440 union acpi_operand_object **object,
441 struct acpi_walk_state *walk_state);
442
443acpi_status
444acpi_ds_result_push (
445 union acpi_operand_object *object,
446 struct acpi_walk_state *walk_state);
447
448acpi_status
449acpi_ds_result_pop_from_bottom (
450 union acpi_operand_object **object,
451 struct acpi_walk_state *walk_state);
452
44f6c012
RM
453#ifdef ACPI_ENABLE_OBJECT_CACHE
454void
455acpi_ds_delete_walk_state_cache (
456 void);
457#endif
458
1da177e4 459#endif /* _ACDISPAT_H_ */
This page took 0.0619 seconds and 5 git commands to generate.