aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acdispat.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/acpi/acdispat.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/acpi/acdispat.h')
-rw-r--r--include/acpi/acdispat.h532
1 files changed, 532 insertions, 0 deletions
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
new file mode 100644
index 000000000000..237d63433581
--- /dev/null
+++ b/include/acpi/acdispat.h
@@ -0,0 +1,532 @@
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
53/* Common interfaces */
54
55acpi_status
56acpi_ds_obj_stack_push (
57 void *object,
58 struct acpi_walk_state *walk_state);
59
60acpi_status
61acpi_ds_obj_stack_pop (
62 u32 pop_count,
63 struct acpi_walk_state *walk_state);
64
65#ifdef ACPI_FUTURE_USAGE
66void *
67acpi_ds_obj_stack_get_value (
68 u32 index,
69 struct acpi_walk_state *walk_state);
70#endif
71
72acpi_status
73acpi_ds_obj_stack_pop_object (
74 union acpi_operand_object **object,
75 struct acpi_walk_state *walk_state);
76
77
78/* dsopcode - support for late evaluation */
79
80acpi_status
81acpi_ds_execute_arguments (
82 struct acpi_namespace_node *node,
83 struct acpi_namespace_node *scope_node,
84 u32 aml_length,
85 u8 *aml_start);
86
87acpi_status
88acpi_ds_get_buffer_field_arguments (
89 union acpi_operand_object *obj_desc);
90
91acpi_status
92acpi_ds_get_region_arguments (
93 union acpi_operand_object *rgn_desc);
94
95acpi_status
96acpi_ds_get_buffer_arguments (
97 union acpi_operand_object *obj_desc);
98
99acpi_status
100acpi_ds_get_package_arguments (
101 union acpi_operand_object *obj_desc);
102
103acpi_status
104acpi_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);
111
112acpi_status
113acpi_ds_eval_buffer_field_operands (
114 struct acpi_walk_state *walk_state,
115 union acpi_parse_object *op);
116
117acpi_status
118acpi_ds_eval_region_operands (
119 struct acpi_walk_state *walk_state,
120 union acpi_parse_object *op);
121
122acpi_status
123acpi_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);
127
128acpi_status
129acpi_ds_initialize_region (
130 acpi_handle obj_handle);
131
132
133/* dsctrl - Parser/Interpreter interface, control stack routines */
134
135
136acpi_status
137acpi_ds_exec_begin_control_op (
138 struct acpi_walk_state *walk_state,
139 union acpi_parse_object *op);
140
141acpi_status
142acpi_ds_exec_end_control_op (
143 struct acpi_walk_state *walk_state,
144 union acpi_parse_object *op);
145
146
147/* dsexec - Parser/Interpreter interface, method execution callbacks */
148
149
150acpi_status
151acpi_ds_get_predicate_value (
152 struct acpi_walk_state *walk_state,
153 union acpi_operand_object *result_obj);
154
155acpi_status
156acpi_ds_exec_begin_op (
157 struct acpi_walk_state *walk_state,
158 union acpi_parse_object **out_op);
159
160acpi_status
161acpi_ds_exec_end_op (
162 struct acpi_walk_state *state);
163
164
165/* dsfield - Parser/Interpreter interface for AML fields */
166
167acpi_status
168acpi_ds_get_field_names (
169 struct acpi_create_field_info *info,
170 struct acpi_walk_state *walk_state,
171 union acpi_parse_object *arg);
172
173acpi_status
174acpi_ds_create_field (
175 union acpi_parse_object *op,
176 struct acpi_namespace_node *region_node,
177 struct acpi_walk_state *walk_state);
178
179acpi_status
180acpi_ds_create_bank_field (
181 union acpi_parse_object *op,
182 struct acpi_namespace_node *region_node,
183 struct acpi_walk_state *walk_state);
184
185acpi_status
186acpi_ds_create_index_field (
187 union acpi_parse_object *op,
188 struct acpi_namespace_node *region_node,
189 struct acpi_walk_state *walk_state);
190
191acpi_status
192acpi_ds_create_buffer_field (
193 union acpi_parse_object *op,
194 struct acpi_walk_state *walk_state);
195
196acpi_status
197acpi_ds_init_field_objects (
198 union acpi_parse_object *op,
199 struct acpi_walk_state *walk_state);
200
201
202/* dsload - Parser/Interpreter interface, namespace load callbacks */
203
204acpi_status
205acpi_ds_load1_begin_op (
206 struct acpi_walk_state *walk_state,
207 union acpi_parse_object **out_op);
208
209acpi_status
210acpi_ds_load1_end_op (
211 struct acpi_walk_state *walk_state);
212
213acpi_status
214acpi_ds_load2_begin_op (
215 struct acpi_walk_state *walk_state,
216 union acpi_parse_object **out_op);
217
218acpi_status
219acpi_ds_load2_end_op (
220 struct acpi_walk_state *walk_state);
221
222acpi_status
223acpi_ds_init_callbacks (
224 struct acpi_walk_state *walk_state,
225 u32 pass_number);
226
227
228/* dsmthdat - method data (locals/args) */
229
230
231acpi_status
232acpi_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);
237
238acpi_status
239acpi_ds_method_data_get_entry (
240 u16 opcode,
241 u32 index,
242 struct acpi_walk_state *walk_state,
243 union acpi_operand_object ***node);
244
245void
246acpi_ds_method_data_delete_all (
247 struct acpi_walk_state *walk_state);
248
249u8
250acpi_ds_is_method_value (
251 union acpi_operand_object *obj_desc);
252
253#ifdef ACPI_FUTURE_USAGE
254acpi_object_type
255acpi_ds_method_data_get_type (
256 u16 opcode,
257 u32 index,
258 struct acpi_walk_state *walk_state);
259#endif
260
261acpi_status
262acpi_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);
267
268void
269acpi_ds_method_data_delete_value (
270 u16 opcode,
271 u32 index,
272 struct acpi_walk_state *walk_state);
273
274acpi_status
275acpi_ds_method_data_init_args (
276 union acpi_operand_object **params,
277 u32 max_param_count,
278 struct acpi_walk_state *walk_state);
279
280acpi_status
281acpi_ds_method_data_get_node (
282 u16 opcode,
283 u32 index,
284 struct acpi_walk_state *walk_state,
285 struct acpi_namespace_node **node);
286
287void
288acpi_ds_method_data_init (
289 struct acpi_walk_state *walk_state);
290
291acpi_status
292acpi_ds_method_data_set_value (
293 u16 opcode,
294 u32 index,
295 union acpi_operand_object *object,
296 struct acpi_walk_state *walk_state);
297
298
299/* dsmethod - Parser/Interpreter interface - control method parsing */
300
301acpi_status
302acpi_ds_parse_method (
303 acpi_handle obj_handle);
304
305acpi_status
306acpi_ds_call_control_method (
307 struct acpi_thread_state *thread,
308 struct acpi_walk_state *walk_state,
309 union acpi_parse_object *op);
310
311acpi_status
312acpi_ds_restart_control_method (
313 struct acpi_walk_state *walk_state,
314 union acpi_operand_object *return_desc);
315
316acpi_status
317acpi_ds_terminate_control_method (
318 struct acpi_walk_state *walk_state);
319
320acpi_status
321acpi_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);
325
326
327/* dsobj - Parser/Interpreter interface - object initialization and conversion */
328
329acpi_status
330acpi_ds_init_one_object (
331 acpi_handle obj_handle,
332 u32 level,
333 void *context,
334 void **return_value);
335
336acpi_status
337acpi_ds_initialize_objects (
338 struct acpi_table_desc *table_desc,
339 struct acpi_namespace_node *start_node);
340
341acpi_status
342acpi_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);
347
348acpi_status
349acpi_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);
354
355acpi_status
356acpi_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);
360
361acpi_status
362acpi_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);
367
368acpi_status
369acpi_ds_create_node (
370 struct acpi_walk_state *walk_state,
371 struct acpi_namespace_node *node,
372 union acpi_parse_object *op);
373
374
375/* dsutils - Parser/Interpreter interface utility routines */
376
377void
378acpi_ds_clear_implicit_return (
379 struct acpi_walk_state *walk_state);
380
381u8
382acpi_ds_do_implicit_return (
383 union acpi_operand_object *return_desc,
384 struct acpi_walk_state *walk_state,
385 u8 add_reference);
386
387u8
388acpi_ds_is_result_used (
389 union acpi_parse_object *op,
390 struct acpi_walk_state *walk_state);
391
392void
393acpi_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);
397
398acpi_status
399acpi_ds_create_operand (
400 struct acpi_walk_state *walk_state,
401 union acpi_parse_object *arg,
402 u32 args_remaining);
403
404acpi_status
405acpi_ds_create_operands (
406 struct acpi_walk_state *walk_state,
407 union acpi_parse_object *first_arg);
408
409acpi_status
410acpi_ds_resolve_operands (
411 struct acpi_walk_state *walk_state);
412
413void
414acpi_ds_clear_operands (
415 struct acpi_walk_state *walk_state);
416
417
418/*
419 * dswscope - Scope Stack manipulation
420 */
421
422acpi_status
423acpi_ds_scope_stack_push (
424 struct acpi_namespace_node *node,
425 acpi_object_type type,
426 struct acpi_walk_state *walk_state);
427
428
429acpi_status
430acpi_ds_scope_stack_pop (
431 struct acpi_walk_state *walk_state);
432
433void
434acpi_ds_scope_stack_clear (
435 struct acpi_walk_state *walk_state);
436
437
438/* dswstate - parser WALK_STATE management routines */
439
440struct acpi_walk_state *
441acpi_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);
446
447acpi_status
448acpi_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);
456
457#ifdef ACPI_FUTURE_USAGE
458acpi_status
459acpi_ds_obj_stack_delete_all (
460 struct acpi_walk_state *walk_state);
461#endif
462
463acpi_status
464acpi_ds_obj_stack_pop_and_delete (
465 u32 pop_count,
466 struct acpi_walk_state *walk_state);
467
468void
469acpi_ds_delete_walk_state (
470 struct acpi_walk_state *walk_state);
471
472struct acpi_walk_state *
473acpi_ds_pop_walk_state (
474 struct acpi_thread_state *thread);
475
476void
477acpi_ds_push_walk_state (
478 struct acpi_walk_state *walk_state,
479 struct acpi_thread_state *thread);
480
481acpi_status
482acpi_ds_result_stack_pop (
483 struct acpi_walk_state *walk_state);
484
485acpi_status
486acpi_ds_result_stack_push (
487 struct acpi_walk_state *walk_state);
488
489acpi_status
490acpi_ds_result_stack_clear (
491 struct acpi_walk_state *walk_state);
492
493struct acpi_walk_state *
494acpi_ds_get_current_walk_state (
495 struct acpi_thread_state *thread);
496
497#ifdef ACPI_ENABLE_OBJECT_CACHE
498void
499acpi_ds_delete_walk_state_cache (
500 void);
501#endif
502
503#ifdef ACPI_FUTURE_USAGE
504acpi_status
505acpi_ds_result_insert (
506 void *object,
507 u32 index,
508 struct acpi_walk_state *walk_state);
509
510acpi_status
511acpi_ds_result_remove (
512 union acpi_operand_object **object,
513 u32 index,
514 struct acpi_walk_state *walk_state);
515#endif
516
517acpi_status
518acpi_ds_result_pop (
519 union acpi_operand_object **object,
520 struct acpi_walk_state *walk_state);
521
522acpi_status
523acpi_ds_result_push (
524 union acpi_operand_object *object,
525 struct acpi_walk_state *walk_state);
526
527acpi_status
528acpi_ds_result_pop_from_bottom (
529 union acpi_operand_object **object,
530 struct acpi_walk_state *walk_state);
531
532#endif /* _ACDISPAT_H_ */