]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/acpi/acinterp.h
[ARM] 3118/1: fix and reenable nwfpe extended precision emulation for big-endian
[mirror_ubuntu-artful-kernel.git] / include / acpi / acinterp.h
CommitLineData
1da177e4
LT
1/******************************************************************************
2 *
3 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
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#ifndef __ACINTERP_H__
45#define __ACINTERP_H__
46
1da177e4
LT
47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
48
1da177e4
LT
49/*
50 * exconvrt - object conversion
51 */
1da177e4 52acpi_status
4be44fcd
LB
53acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
54 union acpi_operand_object **result_desc, u32 flags);
1da177e4
LT
55
56acpi_status
4be44fcd
LB
57acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
58 union acpi_operand_object **result_desc);
1da177e4
LT
59
60acpi_status
4be44fcd
LB
61acpi_ex_convert_to_string(union acpi_operand_object *obj_desc,
62 union acpi_operand_object **result_desc, u32 type);
1da177e4
LT
63
64/* Types for ->String conversion */
65
66#define ACPI_EXPLICIT_BYTE_COPY 0x00000000
67#define ACPI_EXPLICIT_CONVERT_HEX 0x00000001
68#define ACPI_IMPLICIT_CONVERT_HEX 0x00000002
69#define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003
70
71acpi_status
4be44fcd
LB
72acpi_ex_convert_to_target_type(acpi_object_type destination_type,
73 union acpi_operand_object *source_desc,
74 union acpi_operand_object **result_desc,
75 struct acpi_walk_state *walk_state);
1da177e4
LT
76
77/*
78 * exfield - ACPI AML (p-code) execution - field manipulation
79 */
1da177e4 80acpi_status
4be44fcd
LB
81acpi_ex_common_buffer_setup(union acpi_operand_object *obj_desc,
82 u32 buffer_length, u32 * datum_count);
1da177e4 83
1da177e4 84acpi_status
4be44fcd
LB
85acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
86 acpi_integer mask,
87 acpi_integer field_value,
88 u32 field_datum_byte_offset);
1da177e4
LT
89
90void
4be44fcd
LB
91acpi_ex_get_buffer_datum(acpi_integer * datum,
92 void *buffer,
93 u32 buffer_length,
94 u32 byte_granularity, u32 buffer_offset);
1da177e4
LT
95
96void
4be44fcd
LB
97acpi_ex_set_buffer_datum(acpi_integer merged_datum,
98 void *buffer,
99 u32 buffer_length,
100 u32 byte_granularity, u32 buffer_offset);
1da177e4
LT
101
102acpi_status
4be44fcd
LB
103acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
104 union acpi_operand_object *obj_desc,
105 union acpi_operand_object **ret_buffer_desc);
1da177e4
LT
106
107acpi_status
4be44fcd
LB
108acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
109 union acpi_operand_object *obj_desc,
110 union acpi_operand_object **result_desc);
44f6c012 111
1da177e4 112/*
44f6c012 113 * exfldio - low level field I/O
1da177e4 114 */
1da177e4 115acpi_status
4be44fcd
LB
116acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
117 void *buffer, u32 buffer_length);
1da177e4
LT
118
119acpi_status
4be44fcd
LB
120acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
121 void *buffer, u32 buffer_length);
1da177e4
LT
122
123acpi_status
4be44fcd
LB
124acpi_ex_access_region(union acpi_operand_object *obj_desc,
125 u32 field_datum_byte_offset,
126 acpi_integer * value, u32 read_write);
1da177e4 127
44f6c012
RM
128/*
129 * exmisc - misc support routines
130 */
1da177e4 131acpi_status
4be44fcd
LB
132acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
133 union acpi_operand_object **return_desc,
134 struct acpi_walk_state *walk_state);
1da177e4 135
1da177e4 136acpi_status
4be44fcd
LB
137acpi_ex_concat_template(union acpi_operand_object *obj_desc,
138 union acpi_operand_object *obj_desc2,
139 union acpi_operand_object **actual_return_desc,
140 struct acpi_walk_state *walk_state);
1da177e4
LT
141
142acpi_status
4be44fcd
LB
143acpi_ex_do_concatenate(union acpi_operand_object *obj_desc,
144 union acpi_operand_object *obj_desc2,
145 union acpi_operand_object **actual_return_desc,
146 struct acpi_walk_state *walk_state);
1da177e4
LT
147
148acpi_status
4be44fcd
LB
149acpi_ex_do_logical_numeric_op(u16 opcode,
150 acpi_integer integer0,
151 acpi_integer integer1, u8 * logical_result);
1da177e4
LT
152
153acpi_status
4be44fcd
LB
154acpi_ex_do_logical_op(u16 opcode,
155 union acpi_operand_object *operand0,
156 union acpi_operand_object *operand1, u8 * logical_result);
1da177e4
LT
157
158acpi_integer
4be44fcd 159acpi_ex_do_math_op(u16 opcode, acpi_integer operand0, acpi_integer operand1);
1da177e4 160
4be44fcd 161acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state);
1da177e4 162
4be44fcd 163acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state);
1da177e4 164
4be44fcd 165acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state);
1da177e4
LT
166
167acpi_status
4be44fcd
LB
168acpi_ex_create_region(u8 * aml_start,
169 u32 aml_length,
170 u8 region_space, struct acpi_walk_state *walk_state);
1da177e4 171
4be44fcd 172acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state);
1da177e4 173
4be44fcd 174acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state);
1da177e4 175
4be44fcd 176acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state);
1da177e4
LT
177
178acpi_status
4be44fcd
LB
179acpi_ex_create_method(u8 * aml_start,
180 u32 aml_length, struct acpi_walk_state *walk_state);
1da177e4
LT
181
182/*
183 * exconfig - dynamic table load/unload
184 */
1da177e4 185acpi_status
4be44fcd
LB
186acpi_ex_load_op(union acpi_operand_object *obj_desc,
187 union acpi_operand_object *target,
188 struct acpi_walk_state *walk_state);
1da177e4
LT
189
190acpi_status
4be44fcd
LB
191acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
192 union acpi_operand_object **return_desc);
1da177e4 193
4be44fcd 194acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle);
1da177e4
LT
195
196/*
197 * exmutex - mutex support
198 */
1da177e4 199acpi_status
4be44fcd
LB
200acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
201 union acpi_operand_object *obj_desc,
202 struct acpi_walk_state *walk_state);
1da177e4
LT
203
204acpi_status
4be44fcd
LB
205acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
206 struct acpi_walk_state *walk_state);
1da177e4 207
4be44fcd 208void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread);
1da177e4 209
4be44fcd 210void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc);
1da177e4
LT
211
212/*
44f6c012 213 * exprep - ACPI AML execution - prep utilities
1da177e4 214 */
1da177e4 215acpi_status
4be44fcd
LB
216acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
217 u8 field_flags,
218 u8 field_attribute,
219 u32 field_bit_position, u32 field_bit_length);
1da177e4 220
4be44fcd 221acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info);
44f6c012 222
1da177e4
LT
223/*
224 * exsystem - Interface to OS services
225 */
1da177e4 226acpi_status
4be44fcd
LB
227acpi_ex_system_do_notify_op(union acpi_operand_object *value,
228 union acpi_operand_object *obj_desc);
1da177e4 229
4be44fcd 230acpi_status acpi_ex_system_do_suspend(acpi_integer time);
1da177e4 231
4be44fcd 232acpi_status acpi_ex_system_do_stall(u32 time);
1da177e4
LT
233
234acpi_status
4be44fcd
LB
235acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
236 union acpi_operand_object *obj_desc);
1da177e4 237
4be44fcd 238acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
1da177e4 239
4be44fcd 240acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
1da177e4
LT
241
242acpi_status
4be44fcd
LB
243acpi_ex_system_wait_event(union acpi_operand_object *time,
244 union acpi_operand_object *obj_desc);
1da177e4 245
4be44fcd 246acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc);
1da177e4 247
4be44fcd 248acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout);
1da177e4
LT
249
250/*
44f6c012 251 * exoparg1 - ACPI AML execution, 1 operand
1da177e4 252 */
4be44fcd 253acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state);
1da177e4 254
4be44fcd 255acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state);
1da177e4 256
4be44fcd 257acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state);
1da177e4 258
4be44fcd 259acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state);
1da177e4 260
4be44fcd 261acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state);
1da177e4
LT
262
263/*
44f6c012 264 * exoparg2 - ACPI AML execution, 2 operands
1da177e4 265 */
4be44fcd 266acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state);
1da177e4 267
4be44fcd 268acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state);
1da177e4 269
4be44fcd 270acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state);
1da177e4 271
4be44fcd 272acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state);
1da177e4
LT
273
274/*
44f6c012
RM
275 * exoparg3 - ACPI AML execution, 3 operands
276 */
4be44fcd 277acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state);
44f6c012 278
4be44fcd 279acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state);
44f6c012
RM
280
281/*
282 * exoparg6 - ACPI AML execution, 6 operands
1da177e4 283 */
4be44fcd 284acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state);
1da177e4 285
44f6c012
RM
286/*
287 * exresolv - Object resolution and get value functions
288 */
1da177e4 289acpi_status
4be44fcd
LB
290acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
291 struct acpi_walk_state *walk_state);
1da177e4
LT
292
293acpi_status
4be44fcd
LB
294acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
295 union acpi_operand_object *operand,
296 acpi_object_type * return_type,
297 union acpi_operand_object **return_desc);
44f6c012
RM
298
299/*
300 * exresnte - resolve namespace node
301 */
302acpi_status
4be44fcd
LB
303acpi_ex_resolve_node_to_value(struct acpi_namespace_node **stack_ptr,
304 struct acpi_walk_state *walk_state);
44f6c012
RM
305
306/*
307 * exresop - resolve operand to value
308 */
1da177e4 309acpi_status
4be44fcd
LB
310acpi_ex_resolve_operands(u16 opcode,
311 union acpi_operand_object **stack_ptr,
312 struct acpi_walk_state *walk_state);
1da177e4
LT
313
314/*
315 * exdump - Interpreter debug output routines
316 */
4be44fcd 317void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth);
1da177e4
LT
318
319void
4be44fcd
LB
320acpi_ex_dump_operands(union acpi_operand_object **operands,
321 acpi_interpreter_mode interpreter_mode,
322 char *ident,
323 u32 num_levels,
324 char *note, char *module_name, u32 line_number);
1da177e4 325
44f6c012 326#ifdef ACPI_FUTURE_USAGE
1da177e4 327void
4be44fcd 328acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags);
1da177e4 329
4be44fcd
LB
330void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags);
331#endif /* ACPI_FUTURE_USAGE */
1da177e4
LT
332
333/*
44f6c012 334 * exnames - AML namestring support
1da177e4 335 */
1da177e4 336acpi_status
4be44fcd
LB
337acpi_ex_get_name_string(acpi_object_type data_type,
338 u8 * in_aml_address,
339 char **out_name_string, u32 * out_name_length);
1da177e4
LT
340
341/*
342 * exstore - Object store support
343 */
1da177e4 344acpi_status
4be44fcd
LB
345acpi_ex_store(union acpi_operand_object *val_desc,
346 union acpi_operand_object *dest_desc,
347 struct acpi_walk_state *walk_state);
1da177e4 348
1da177e4 349acpi_status
4be44fcd
LB
350acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
351 struct acpi_namespace_node *node,
352 struct acpi_walk_state *walk_state,
353 u8 implicit_conversion);
1da177e4
LT
354
355#define ACPI_IMPLICIT_CONVERSION TRUE
356#define ACPI_NO_IMPLICIT_CONVERSION FALSE
357
358/*
44f6c012 359 * exstoren - resolve/store object
1da177e4 360 */
1da177e4 361acpi_status
4be44fcd
LB
362acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
363 acpi_object_type target_type,
364 struct acpi_walk_state *walk_state);
1da177e4
LT
365
366acpi_status
4be44fcd
LB
367acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
368 union acpi_operand_object *dest_desc,
369 union acpi_operand_object **new_desc,
370 struct acpi_walk_state *walk_state);
1da177e4
LT
371
372/*
44f6c012 373 * exstorob - store object - buffer/string
1da177e4 374 */
1da177e4 375acpi_status
4be44fcd
LB
376acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
377 union acpi_operand_object *target_desc);
1da177e4
LT
378
379acpi_status
4be44fcd
LB
380acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
381 union acpi_operand_object *target_desc);
44f6c012
RM
382
383/*
384 * excopy - object copy
385 */
1da177e4 386acpi_status
4be44fcd
LB
387acpi_ex_copy_integer_to_index_field(union acpi_operand_object *source_desc,
388 union acpi_operand_object *target_desc);
1da177e4
LT
389
390acpi_status
4be44fcd
LB
391acpi_ex_copy_integer_to_bank_field(union acpi_operand_object *source_desc,
392 union acpi_operand_object *target_desc);
1da177e4
LT
393
394acpi_status
4be44fcd
LB
395acpi_ex_copy_data_to_named_field(union acpi_operand_object *source_desc,
396 struct acpi_namespace_node *node);
1da177e4
LT
397
398acpi_status
4be44fcd
LB
399acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
400 union acpi_operand_object *target_desc);
44f6c012 401
1da177e4
LT
402/*
403 * exutils - interpreter/scanner utilities
404 */
4be44fcd 405acpi_status acpi_ex_enter_interpreter(void);
1da177e4 406
4be44fcd 407void acpi_ex_exit_interpreter(void);
1da177e4 408
4be44fcd 409void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
1da177e4 410
4be44fcd 411u8 acpi_ex_acquire_global_lock(u32 rule);
1da177e4 412
4be44fcd 413void acpi_ex_release_global_lock(u8 locked);
1da177e4 414
4be44fcd 415void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string);
1da177e4 416
4be44fcd 417void acpi_ex_unsigned_integer_to_string(acpi_integer value, char *out_string);
1da177e4
LT
418
419/*
420 * exregion - default op_region handlers
421 */
1da177e4 422acpi_status
4be44fcd
LB
423acpi_ex_system_memory_space_handler(u32 function,
424 acpi_physical_address address,
425 u32 bit_width,
426 acpi_integer * value,
427 void *handler_context,
428 void *region_context);
429
430acpi_status
431acpi_ex_system_io_space_handler(u32 function,
432 acpi_physical_address address,
433 u32 bit_width,
434 acpi_integer * value,
435 void *handler_context, void *region_context);
436
437acpi_status
438acpi_ex_pci_config_space_handler(u32 function,
439 acpi_physical_address address,
440 u32 bit_width,
441 acpi_integer * value,
442 void *handler_context, void *region_context);
443
444acpi_status
445acpi_ex_cmos_space_handler(u32 function,
446 acpi_physical_address address,
447 u32 bit_width,
448 acpi_integer * value,
449 void *handler_context, void *region_context);
450
451acpi_status
452acpi_ex_pci_bar_space_handler(u32 function,
453 acpi_physical_address address,
454 u32 bit_width,
455 acpi_integer * value,
456 void *handler_context, void *region_context);
457
458acpi_status
459acpi_ex_embedded_controller_space_handler(u32 function,
460 acpi_physical_address address,
461 u32 bit_width,
462 acpi_integer * value,
463 void *handler_context,
464 void *region_context);
465
466acpi_status
467acpi_ex_sm_bus_space_handler(u32 function,
468 acpi_physical_address address,
469 u32 bit_width,
470 acpi_integer * value,
471 void *handler_context, void *region_context);
472
473acpi_status
474acpi_ex_data_table_space_handler(u32 function,
475 acpi_physical_address address,
476 u32 bit_width,
477 acpi_integer * value,
478 void *handler_context, void *region_context);
479
480#endif /* __INTERP_H__ */