blob: 2d074ba1db429ab6fbde1559ddd00ed34b0551ac [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Name: acpixf.h - External interfaces to the ACPI subsystem
4 *
5 *****************************************************************************/
6
7/*
Bob Moorefbb7a2d2014-02-08 09:42:25 +08008 * Copyright (C) 2000 - 2014, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#ifndef __ACXFACE_H__
45#define __ACXFACE_H__
46
Bob Moore50df4d82008-12-31 03:01:23 +080047/* Current ACPICA subsystem version in YYYYMMDD format */
48
Bob Moore35476c72014-04-04 12:40:16 +080049#define ACPI_CA_VERSION 0x20140325
Bob Moore50df4d82008-12-31 03:01:23 +080050
David Howellsa1ce3922012-10-02 18:01:25 +010051#include <acpi/acconfig.h>
52#include <acpi/actypes.h>
53#include <acpi/actbl.h>
Linus Torvaldsd8dc91b2012-10-08 07:14:06 +090054#include <acpi/acbuffer.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Lin Ming889c78b2008-12-31 09:23:57 +080056extern u8 acpi_gbl_permanent_mmap;
57
Robert Moore44f6c012005-04-18 22:49:35 -040058/*
Lv Zheng3035ff72014-04-30 10:03:52 +080059 * Ensure that the globals are actually defined and initialized only once.
60 *
61 * The use of these macros allows a single list of globals (here) in order
62 * to simplify maintenance of the code.
63 */
64#ifdef DEFINE_ACPI_GLOBALS
65#define ACPI_GLOBAL(type,name) \
66 extern type name; \
67 type name
68
69#define ACPI_INIT_GLOBAL(type,name,value) \
70 type name=value
71
72#else
73#ifndef ACPI_GLOBAL
74#define ACPI_GLOBAL(type,name) \
75 extern type name
76#endif
77
78#ifndef ACPI_INIT_GLOBAL
79#define ACPI_INIT_GLOBAL(type,name,value) \
80 extern type name
81#endif
82#endif
83
Lv Zheng8b9c1152014-04-30 10:05:08 +080084/* ACPICA prototypes */
85
86#ifndef ACPI_EXTERNAL_RETURN_STATUS
87#define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
88 prototype;
89#endif
90
91#ifndef ACPI_EXTERNAL_RETURN_OK
92#define ACPI_EXTERNAL_RETURN_OK(prototype) \
93 prototype;
94#endif
95
96#ifndef ACPI_EXTERNAL_RETURN_VOID
97#define ACPI_EXTERNAL_RETURN_VOID(prototype) \
98 prototype;
99#endif
100
101#ifndef ACPI_EXTERNAL_RETURN_UINT32
102#define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
103 prototype;
104#endif
105
106#ifndef ACPI_EXTERNAL_RETURN_PTR
107#define ACPI_EXTERNAL_RETURN_PTR(prototype) \
108 prototype;
109#endif
110
Lv Zheng3035ff72014-04-30 10:03:52 +0800111/* Public globals, available from outside ACPICA subsystem */
112
113/*****************************************************************************
114 *
115 * Runtime configuration (static defaults that can be overriden at runtime)
116 *
117 ****************************************************************************/
118
119/*
120 * Enable "slack" in the AML interpreter? Default is FALSE, and the
121 * interpreter strictly follows the ACPI specification. Setting to TRUE
122 * allows the interpreter to ignore certain errors and/or bad AML constructs.
123 *
124 * Currently, these features are enabled by this flag:
125 *
126 * 1) Allow "implicit return" of last value in a control method
127 * 2) Allow access beyond the end of an operation region
128 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
129 * 4) Allow ANY object type to be a source operand for the Store() operator
130 * 5) Allow unresolved references (invalid target name) in package objects
131 * 6) Enable warning messages for behavior that is not ACPI spec compliant
132 */
133ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
134
135/*
136 * Automatically serialize all methods that create named objects? Default
137 * is TRUE, meaning that all non_serialized methods are scanned once at
138 * table load time to determine those that create named objects. Methods
139 * that create named objects are marked Serialized in order to prevent
140 * possible run-time problems if they are entered by more than one thread.
141 */
142ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
143
144/*
145 * Create the predefined _OSI method in the namespace? Default is TRUE
146 * because ACPICA is fully compatible with other ACPI implementations.
147 * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
148 */
149ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
150
151/*
152 * Optionally use default values for the ACPI register widths. Set this to
153 * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
154 */
155ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
156
157/*
158 * Optionally enable output from the AML Debug Object.
159 */
160ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
161
162/*
163 * Optionally copy the entire DSDT to local memory (instead of simply
164 * mapping it.) There are some BIOSs that corrupt or replace the original
165 * DSDT, creating the need for this option. Default is FALSE, do not copy
166 * the DSDT.
167 */
168ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
169
170/*
171 * Optionally ignore an XSDT if present and use the RSDT instead.
172 * Although the ACPI specification requires that an XSDT be used instead
173 * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
174 * some machines. Default behavior is to use the XSDT if present.
175 */
176ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
177
178/*
179 * Optionally use 32-bit FADT addresses if and when there is a conflict
180 * (address mismatch) between the 32-bit and 64-bit versions of the
181 * address. Although ACPICA adheres to the ACPI specification which
182 * requires the use of the corresponding 64-bit address if it is non-zero,
183 * some machines have been found to have a corrupted non-zero 64-bit
184 * address. Default is FALSE, do not favor the 32-bit addresses.
185 */
186ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
187
188/*
189 * Optionally truncate I/O addresses to 16 bits. Provides compatibility
190 * with other ACPI implementations. NOTE: During ACPICA initialization,
191 * this value is set to TRUE if any Windows OSI strings have been
192 * requested by the BIOS.
193 */
194ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
195
196/*
197 * Disable runtime checking and repair of values returned by control methods.
198 * Use only if the repair is causing a problem on a particular machine.
199 */
200ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
201
202/*
203 * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
204 * This can be useful for debugging ACPI problems on some machines.
205 */
206ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
207
208/*
209 * We keep track of the latest version of Windows that has been requested by
Bob Moorefea79bc2014-04-30 10:05:34 +0800210 * the BIOS. ACPI 5.0.
Lv Zheng3035ff72014-04-30 10:03:52 +0800211 */
212ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
213
214/*
Lv Zheng3a2f3a32014-04-30 10:04:35 +0800215 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
216 * that the ACPI hardware is no longer required. A flag in the FADT indicates
217 * a reduced HW machine, and that flag is duplicated here for convenience.
Bob Moore50df4d82008-12-31 03:01:23 +0800218 */
Lv Zheng3a2f3a32014-04-30 10:04:35 +0800219ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
Lv Zheng3e8214e2012-12-19 05:37:15 +0000220
Lv Zheng3a2f3a32014-04-30 10:04:35 +0800221/*
222 * This mechanism is used to trace a specified AML method. The method is
223 * traced each time it is executed.
224 */
225ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
226ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0);
Lv Zheng3e8214e2012-12-19 05:37:15 +0000227
Lv Zheng3a2f3a32014-04-30 10:04:35 +0800228/*
229 * Runtime configuration of debug output control masks. We want the debug
230 * switches statically initialized so they are already set when the debugger
231 * is entered.
232 */
233ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
234ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
Lv Zheng3e8214e2012-12-19 05:37:15 +0000235
Lv Zheng3a2f3a32014-04-30 10:04:35 +0800236/*
237 * Globals that are publically available
238 */
239ACPI_GLOBAL(u32, acpi_current_gpe_count);
240ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
241ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
Bob Moore50df4d82008-12-31 03:01:23 +0800242
Bob Moore33620c52012-02-14 18:14:27 +0800243/*
244 * Hardware-reduced prototypes. All interfaces that use these macros will
245 * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
246 * is set to TRUE.
247 */
248#if (!ACPI_REDUCED_HARDWARE)
249#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
Lv Zheng8b9c1152014-04-30 10:05:08 +0800250 ACPI_EXTERNAL_RETURN_STATUS(prototype)
Bob Moore33620c52012-02-14 18:14:27 +0800251
252#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
Lv Zheng8b9c1152014-04-30 10:05:08 +0800253 ACPI_EXTERNAL_RETURN_OK(prototype)
Bob Moore33620c52012-02-14 18:14:27 +0800254
255#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
Lv Zheng8b9c1152014-04-30 10:05:08 +0800256 ACPI_EXTERNAL_RETURN_VOID(prototype)
Bob Moore33620c52012-02-14 18:14:27 +0800257
258#else
259#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
260 static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
261
262#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
263 static ACPI_INLINE prototype {return(AE_OK);}
264
265#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
Bob Moorec26f3c92013-10-29 09:29:16 +0800266 static ACPI_INLINE prototype {return;}
Bob Moore33620c52012-02-14 18:14:27 +0800267
268#endif /* !ACPI_REDUCED_HARDWARE */
269
Bob Moore50df4d82008-12-31 03:01:23 +0800270/*
Lv Zheng407e22a2014-04-30 10:04:48 +0800271 * Error-message prototypes. All interfaces that use these macros will
272 * be configured out of the ACPICA build if the ACPI_NO_ERROR_MESSAGE flag
273 * is defined.
274 */
275#ifndef ACPI_NO_ERROR_MESSAGES
276#define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
277 prototype;
278
279#else
280#define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
281 static ACPI_INLINE prototype {return;}
282
283#endif /* ACPI_NO_ERROR_MESSAGES */
284
285/*
Lv Zheng1ce28c32014-04-30 10:04:55 +0800286 * Debugging-output prototypes. All interfaces that use these macros will
287 * be configured out of the ACPICA build if the ACPI_DEBUG_OUTPUT flag is
288 * not defined.
289 */
290#ifdef ACPI_DEBUG_OUTPUT
291#define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
292 prototype;
293
294#else
295#define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
296 static ACPI_INLINE prototype {return;}
297
298#endif /* ACPI_DEBUG_OUTPUT */
299
300/*
Lv Zheng75c80442012-12-19 05:36:49 +0000301 * Initialization
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800303ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
304 acpi_initialize_tables(struct acpi_table_desc
305 *initial_storage,
306 u32 initial_table_count,
307 u8 allow_resize))
308ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void))
Bob Mooref3d2e782007-02-02 19:48:18 +0300309
Lv Zheng8b9c1152014-04-30 10:05:08 +0800310ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311
Lv Zheng8b9c1152014-04-30 10:05:08 +0800312ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
313 acpi_initialize_objects(u32 flags))
314ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315
Lv Zheng75c80442012-12-19 05:36:49 +0000316/*
317 * Miscellaneous global interfaces
318 */
Bob Moore33620c52012-02-14 18:14:27 +0800319ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
320ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000321#ifdef ACPI_FUTURE_USAGE
Lv Zheng8b9c1152014-04-30 10:05:08 +0800322ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000323#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324
325#ifdef ACPI_FUTURE_USAGE
Lv Zheng8b9c1152014-04-30 10:05:08 +0800326ACPI_EXTERNAL_RETURN_STATUS(acpi_status
327 acpi_get_system_info(struct acpi_buffer
328 *ret_buffer))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329#endif
Lv Zheng8b9c1152014-04-30 10:05:08 +0800330ACPI_EXTERNAL_RETURN_STATUS(acpi_status
331 acpi_get_statistics(struct acpi_statistics *stats))
332ACPI_EXTERNAL_RETURN_PTR(const char
333 *acpi_format_exception(acpi_status exception))
334ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335
Lv Zheng8b9c1152014-04-30 10:05:08 +0800336ACPI_EXTERNAL_RETURN_STATUS(acpi_status
337 acpi_install_interface(acpi_string interface_name))
Lv Zheng9187a412013-10-31 09:30:28 +0800338
Lv Zheng8b9c1152014-04-30 10:05:08 +0800339ACPI_EXTERNAL_RETURN_STATUS(acpi_status
340 acpi_remove_interface(acpi_string interface_name))
341ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342
Lv Zheng8b9c1152014-04-30 10:05:08 +0800343ACPI_EXTERNAL_RETURN_UINT32(u32
344 acpi_check_address_range(acpi_adr_space_type
345 space_id,
346 acpi_physical_address
347 address, acpi_size length,
348 u8 warn))
349ACPI_EXTERNAL_RETURN_STATUS(acpi_status
350 acpi_decode_pld_buffer(u8 *in_buffer,
351 acpi_size length,
352 struct acpi_pld_info
353 **return_buffer))
Bob Moorebe030a52012-08-17 13:07:54 +0800354
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355/*
Bob Mooref60d8182012-07-16 10:21:34 +0800356 * ACPI table load/unload interfaces
357 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800358ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
359 acpi_install_table(acpi_physical_address address,
360 u8 physical))
Lv Zhengcaf4a152014-04-04 12:39:18 +0800361
Lv Zheng8b9c1152014-04-30 10:05:08 +0800362ACPI_EXTERNAL_RETURN_STATUS(acpi_status
363 acpi_load_table(struct acpi_table_header *table))
Bob Mooref60d8182012-07-16 10:21:34 +0800364
Lv Zheng8b9c1152014-04-30 10:05:08 +0800365ACPI_EXTERNAL_RETURN_STATUS(acpi_status
366 acpi_unload_parent_table(acpi_handle object))
367ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void))
Bob Mooref60d8182012-07-16 10:21:34 +0800368
369/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 * ACPI table manipulation interfaces
371 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800372ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void))
Bob Mooref3d2e782007-02-02 19:48:18 +0300373
Lv Zheng8b9c1152014-04-30 10:05:08 +0800374ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
375 acpi_find_root_pointer(acpi_size * rsdp_address))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376
Lv Zheng8b9c1152014-04-30 10:05:08 +0800377ACPI_EXTERNAL_RETURN_STATUS(acpi_status
378 acpi_get_table_header(acpi_string signature,
379 u32 instance,
380 struct acpi_table_header
381 *out_table_header))
382ACPI_EXTERNAL_RETURN_STATUS(acpi_status
383 acpi_get_table(acpi_string signature, u32 instance,
384 struct acpi_table_header
385 **out_table))
386ACPI_EXTERNAL_RETURN_STATUS(acpi_status
387 acpi_get_table_by_index(u32 table_index,
388 struct acpi_table_header
389 **out_table))
390ACPI_EXTERNAL_RETURN_STATUS(acpi_status
391 acpi_install_table_handler(acpi_table_handler
392 handler, void *context))
393ACPI_EXTERNAL_RETURN_STATUS(acpi_status
394 acpi_remove_table_handler(acpi_table_handler
395 handler))
Lin Ming3e08e2d2008-04-10 19:06:38 +0400396
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397/*
398 * Namespace and name interfaces
399 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800400ACPI_EXTERNAL_RETURN_STATUS(acpi_status
401 acpi_walk_namespace(acpi_object_type type,
402 acpi_handle start_object,
403 u32 max_depth,
404 acpi_walk_callback
405 descending_callback,
406 acpi_walk_callback
407 ascending_callback,
408 void *context,
409 void **return_value))
410ACPI_EXTERNAL_RETURN_STATUS(acpi_status
411 acpi_get_devices(const char *HID,
412 acpi_walk_callback user_function,
413 void *context,
414 void **return_value))
415ACPI_EXTERNAL_RETURN_STATUS(acpi_status
416 acpi_get_name(acpi_handle object, u32 name_type,
417 struct acpi_buffer *ret_path_ptr))
418ACPI_EXTERNAL_RETURN_STATUS(acpi_status
419 acpi_get_handle(acpi_handle parent,
420 acpi_string pathname,
421 acpi_handle * ret_handle))
422ACPI_EXTERNAL_RETURN_STATUS(acpi_status
423 acpi_attach_data(acpi_handle object,
424 acpi_object_handler handler,
425 void *data))
426ACPI_EXTERNAL_RETURN_STATUS(acpi_status
427 acpi_detach_data(acpi_handle object,
428 acpi_object_handler handler))
429ACPI_EXTERNAL_RETURN_STATUS(acpi_status
430 acpi_get_data(acpi_handle object,
431 acpi_object_handler handler,
432 void **data))
433ACPI_EXTERNAL_RETURN_STATUS(acpi_status
434 acpi_debug_trace(char *name, u32 debug_level,
435 u32 debug_layer, u32 flags))
Bob Moore50eca3e2005-09-30 19:03:00 -0400436
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437/*
438 * Object manipulation and enumeration
439 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800440ACPI_EXTERNAL_RETURN_STATUS(acpi_status
441 acpi_evaluate_object(acpi_handle object,
442 acpi_string pathname,
443 struct acpi_object_list
444 *parameter_objects,
445 struct acpi_buffer
446 *return_object_buffer))
447ACPI_EXTERNAL_RETURN_STATUS(acpi_status
448 acpi_evaluate_object_typed(acpi_handle object,
449 acpi_string pathname,
450 struct acpi_object_list
451 *external_params,
452 struct acpi_buffer
453 *return_buffer,
454 acpi_object_type
455 return_type))
456ACPI_EXTERNAL_RETURN_STATUS(acpi_status
457 acpi_get_object_info(acpi_handle object,
458 struct acpi_device_info
459 **return_buffer))
460ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461
Lv Zheng8b9c1152014-04-30 10:05:08 +0800462ACPI_EXTERNAL_RETURN_STATUS(acpi_status
463 acpi_get_next_object(acpi_object_type type,
464 acpi_handle parent,
465 acpi_handle child,
466 acpi_handle * out_handle))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467
Lv Zheng8b9c1152014-04-30 10:05:08 +0800468ACPI_EXTERNAL_RETURN_STATUS(acpi_status
469 acpi_get_type(acpi_handle object,
470 acpi_object_type * out_type))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471
Lv Zheng8b9c1152014-04-30 10:05:08 +0800472ACPI_EXTERNAL_RETURN_STATUS(acpi_status
473 acpi_get_parent(acpi_handle object,
474 acpi_handle * out_handle))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475
476/*
Bob Mooreecfbbc72008-12-31 02:55:32 +0800477 * Handler interfaces
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800479ACPI_EXTERNAL_RETURN_STATUS(acpi_status
480 acpi_install_initialization_handler
481 (acpi_init_handler handler, u32 function))
Bob Moore33620c52012-02-14 18:14:27 +0800482ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
Lv Zheng8b9c1152014-04-30 10:05:08 +0800483 acpi_install_sci_handler(acpi_sci_handler
484 address,
485 void *context))
Lv Zhenga2fd4b42013-09-23 09:52:05 +0800486ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
487 acpi_remove_sci_handler(acpi_sci_handler
488 address))
489ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
490 acpi_install_global_event_handler
491 (acpi_gbl_event_handler handler,
492 void *context))
Bob Moore33620c52012-02-14 18:14:27 +0800493ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
494 acpi_install_fixed_event_handler(u32
495 acpi_event,
496 acpi_event_handler
497 handler,
498 void
499 *context))
500ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
501 acpi_remove_fixed_event_handler(u32 acpi_event,
502 acpi_event_handler
503 handler))
504ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
505 acpi_install_gpe_handler(acpi_handle
506 gpe_device,
507 u32 gpe_number,
508 u32 type,
509 acpi_gpe_handler
510 address,
511 void *context))
512ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
513 acpi_remove_gpe_handler(acpi_handle gpe_device,
514 u32 gpe_number,
515 acpi_gpe_handler
516 address))
Lv Zheng8b9c1152014-04-30 10:05:08 +0800517ACPI_EXTERNAL_RETURN_STATUS(acpi_status
518 acpi_install_notify_handler(acpi_handle device,
519 u32 handler_type,
520 acpi_notify_handler
521 handler,
522 void *context))
523ACPI_EXTERNAL_RETURN_STATUS(acpi_status
524 acpi_remove_notify_handler(acpi_handle device,
525 u32 handler_type,
526 acpi_notify_handler
527 handler))
528ACPI_EXTERNAL_RETURN_STATUS(acpi_status
529 acpi_install_address_space_handler(acpi_handle
530 device,
531 acpi_adr_space_type
532 space_id,
533 acpi_adr_space_handler
534 handler,
535 acpi_adr_space_setup
536 setup,
537 void *context))
538ACPI_EXTERNAL_RETURN_STATUS(acpi_status
539 acpi_remove_address_space_handler(acpi_handle
540 device,
541 acpi_adr_space_type
542 space_id,
543 acpi_adr_space_handler
544 handler))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545#ifdef ACPI_FUTURE_USAGE
Lv Zheng8b9c1152014-04-30 10:05:08 +0800546ACPI_EXTERNAL_RETURN_STATUS(acpi_status
547 acpi_install_exception_handler
548 (acpi_exception_handler handler))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549#endif
Lv Zheng8b9c1152014-04-30 10:05:08 +0800550ACPI_EXTERNAL_RETURN_STATUS(acpi_status
551 acpi_install_interface_handler
552 (acpi_interface_handler handler))
Lin Mingb0ed7a92010-08-06 09:35:51 +0800553
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554/*
Lin Mingffef6822011-11-16 11:08:30 +0800555 * Global Lock interfaces
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 */
Bob Moore33620c52012-02-14 18:14:27 +0800557ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
558 acpi_acquire_global_lock(u16 timeout,
559 u32 *handle))
Lv Zhengcd27d792013-10-29 09:30:22 +0800560
Bob Moore33620c52012-02-14 18:14:27 +0800561ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
562 acpi_release_global_lock(u32 handle))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700563
Lin Mingffef6822011-11-16 11:08:30 +0800564/*
565 * Interfaces to AML mutex objects
566 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800567ACPI_EXTERNAL_RETURN_STATUS(acpi_status
568 acpi_acquire_mutex(acpi_handle handle,
569 acpi_string pathname,
570 u16 timeout))
Lin Mingffef6822011-11-16 11:08:30 +0800571
Lv Zheng8b9c1152014-04-30 10:05:08 +0800572ACPI_EXTERNAL_RETURN_STATUS(acpi_status
573 acpi_release_mutex(acpi_handle handle,
574 acpi_string pathname))
Lin Mingffef6822011-11-16 11:08:30 +0800575
576/*
577 * Fixed Event interfaces
578 */
Bob Moore33620c52012-02-14 18:14:27 +0800579ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
580 acpi_enable_event(u32 event, u32 flags))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581
Bob Moore33620c52012-02-14 18:14:27 +0800582ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
583 acpi_disable_event(u32 event, u32 flags))
Bob Moore33620c52012-02-14 18:14:27 +0800584ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585
Bob Moore33620c52012-02-14 18:14:27 +0800586ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
587 acpi_get_event_status(u32 event,
588 acpi_event_status
589 *event_status))
Lv Zhengcd27d792013-10-29 09:30:22 +0800590
Bob Moore08ac07b2008-12-30 09:55:48 +0800591/*
Lin Mingffef6822011-11-16 11:08:30 +0800592 * General Purpose Event (GPE) Interfaces
Bob Moore08ac07b2008-12-30 09:55:48 +0800593 */
Bob Moore33620c52012-02-14 18:14:27 +0800594ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
Len Brown4be44fc2005-08-05 00:44:28 -0400595
Bob Moore33620c52012-02-14 18:14:27 +0800596ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
597 acpi_enable_gpe(acpi_handle gpe_device,
598 u32 gpe_number))
Len Brown4be44fc2005-08-05 00:44:28 -0400599
Bob Moore33620c52012-02-14 18:14:27 +0800600ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
601 acpi_disable_gpe(acpi_handle gpe_device,
602 u32 gpe_number))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603
Bob Moore33620c52012-02-14 18:14:27 +0800604ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
605 acpi_clear_gpe(acpi_handle gpe_device,
606 u32 gpe_number))
Lin Mingbba63a22010-12-13 13:39:17 +0800607
Bob Moore33620c52012-02-14 18:14:27 +0800608ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
609 acpi_set_gpe(acpi_handle gpe_device,
610 u32 gpe_number, u8 action))
Rafael J. Wysockie8b6f972010-06-25 01:18:39 +0200611
Bob Moore33620c52012-02-14 18:14:27 +0800612ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
613 acpi_finish_gpe(acpi_handle gpe_device,
614 u32 gpe_number))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700615
Bob Moore33620c52012-02-14 18:14:27 +0800616ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
617 acpi_setup_gpe_for_wake(acpi_handle
618 parent_device,
619 acpi_handle gpe_device,
620 u32 gpe_number))
621ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
622 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
623 u32 gpe_number,
624 u8 action))
625ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
626 acpi_get_gpe_status(acpi_handle gpe_device,
627 u32 gpe_number,
628 acpi_event_status
629 *event_status))
Bob Moore33620c52012-02-14 18:14:27 +0800630ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
Bob Moore33620c52012-02-14 18:14:27 +0800631ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
Bob Mooree97d6bf2008-12-30 09:45:17 +0800632
Bob Moore33620c52012-02-14 18:14:27 +0800633ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
634 acpi_get_gpe_device(u32 gpe_index,
635 acpi_handle * gpe_device))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636
Bob Moore33620c52012-02-14 18:14:27 +0800637ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
638 acpi_install_gpe_block(acpi_handle gpe_device,
639 struct
640 acpi_generic_address
641 *gpe_block_address,
642 u32 register_count,
643 u32 interrupt_number))
644ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
645 acpi_remove_gpe_block(acpi_handle gpe_device))
Rafael J. Wysockia2100802010-09-16 00:30:43 +0200646
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647/*
648 * Resource interfaces
649 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700650typedef
Bob Moore616861242006-03-17 16:44:00 -0500651acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
Len Brown4be44fc2005-08-05 00:44:28 -0400652 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653
Lv Zheng8b9c1152014-04-30 10:05:08 +0800654ACPI_EXTERNAL_RETURN_STATUS(acpi_status
655 acpi_get_vendor_resource(acpi_handle device,
656 char *name,
657 struct acpi_vendor_uuid
658 *uuid,
659 struct acpi_buffer
660 *ret_buffer))
661ACPI_EXTERNAL_RETURN_STATUS(acpi_status
662 acpi_get_current_resources(acpi_handle device,
663 struct acpi_buffer
664 *ret_buffer))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665#ifdef ACPI_FUTURE_USAGE
Lv Zheng8b9c1152014-04-30 10:05:08 +0800666ACPI_EXTERNAL_RETURN_STATUS(acpi_status
667 acpi_get_possible_resources(acpi_handle device,
668 struct acpi_buffer
669 *ret_buffer))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700670#endif
Lv Zheng8b9c1152014-04-30 10:05:08 +0800671ACPI_EXTERNAL_RETURN_STATUS(acpi_status
672 acpi_get_event_resources(acpi_handle device_handle,
673 struct acpi_buffer
674 *ret_buffer))
675ACPI_EXTERNAL_RETURN_STATUS(acpi_status
676 acpi_walk_resource_buffer(struct acpi_buffer
677 *buffer,
678 acpi_walk_resource_callback
679 user_function,
680 void *context))
681ACPI_EXTERNAL_RETURN_STATUS(acpi_status
682 acpi_walk_resources(acpi_handle device, char *name,
683 acpi_walk_resource_callback
684 user_function, void *context))
685ACPI_EXTERNAL_RETURN_STATUS(acpi_status
686 acpi_set_current_resources(acpi_handle device,
687 struct acpi_buffer
688 *in_buffer))
689ACPI_EXTERNAL_RETURN_STATUS(acpi_status
690 acpi_get_irq_routing_table(acpi_handle device,
691 struct acpi_buffer
692 *ret_buffer))
693ACPI_EXTERNAL_RETURN_STATUS(acpi_status
694 acpi_resource_to_address64(struct acpi_resource
695 *resource,
696 struct
697 acpi_resource_address64
698 *out))
699ACPI_EXTERNAL_RETURN_STATUS(acpi_status
700 acpi_buffer_to_resource(u8 *aml_buffer,
701 u16 aml_buffer_length,
702 struct acpi_resource
703 **resource_ptr))
Bob Moore0e243172011-11-16 14:51:01 +0800704
Linus Torvalds1da177e2005-04-16 15:20:36 -0700705/*
706 * Hardware (ACPI device) interfaces
707 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800708ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
Bob Moored3fd9022008-12-30 11:11:57 +0800709
Lv Zheng8b9c1152014-04-30 10:05:08 +0800710ACPI_EXTERNAL_RETURN_STATUS(acpi_status
711 acpi_read(u64 *value,
712 struct acpi_generic_address *reg))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000713
Lv Zheng8b9c1152014-04-30 10:05:08 +0800714ACPI_EXTERNAL_RETURN_STATUS(acpi_status
715 acpi_write(u64 value,
716 struct acpi_generic_address *reg))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000717
Bob Moore33620c52012-02-14 18:14:27 +0800718ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
719 acpi_read_bit_register(u32 register_id,
720 u32 *return_value))
Len Brown4be44fc2005-08-05 00:44:28 -0400721
Bob Moore33620c52012-02-14 18:14:27 +0800722ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
723 acpi_write_bit_register(u32 register_id,
724 u32 value))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725
Bob Moore33620c52012-02-14 18:14:27 +0800726/*
727 * Sleep/Wake interfaces
728 */
Lv Zheng8b9c1152014-04-30 10:05:08 +0800729ACPI_EXTERNAL_RETURN_STATUS(acpi_status
730 acpi_get_sleep_type_data(u8 sleep_state,
731 u8 *slp_typ_a,
732 u8 *slp_typ_b))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733
Lv Zheng8b9c1152014-04-30 10:05:08 +0800734ACPI_EXTERNAL_RETURN_STATUS(acpi_status
735 acpi_enter_sleep_state_prep(u8 sleep_state))
736ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737
Lv Zheng40bce102013-10-31 09:31:18 +0800738ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739
Lv Zheng8b9c1152014-04-30 10:05:08 +0800740ACPI_EXTERNAL_RETURN_STATUS(acpi_status
741 acpi_leave_sleep_state_prep(u8 sleep_state))
742ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743
Lv Zheng739dcbb2012-12-20 01:07:26 +0000744ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
745 acpi_set_firmware_waking_vector(u32
746 physical_address))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000747#if ACPI_MACHINE_WIDTH == 64
748ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
749 acpi_set_firmware_waking_vector64(u64
750 physical_address))
751#endif
Bob Moore50df4d82008-12-31 03:01:23 +0800752/*
Bob Moored08310f2012-02-14 15:22:51 +0800753 * ACPI Timer interfaces
754 */
755#ifdef ACPI_FUTURE_USAGE
Bob Moore33620c52012-02-14 18:14:27 +0800756ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
757 acpi_get_timer_resolution(u32 *resolution))
Bob Moore33620c52012-02-14 18:14:27 +0800758ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
Bob Moored08310f2012-02-14 15:22:51 +0800759
Bob Moore33620c52012-02-14 18:14:27 +0800760ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
761 acpi_get_timer_duration(u32 start_ticks,
762 u32 end_ticks,
763 u32 *time_elapsed))
Bob Moored08310f2012-02-14 15:22:51 +0800764#endif /* ACPI_FUTURE_USAGE */
765
766/*
Bob Mooreb74be612009-04-22 10:20:23 +0800767 * Error/Warning output
Bob Moore50df4d82008-12-31 03:01:23 +0800768 */
Lv Zheng407e22a2014-04-30 10:04:48 +0800769ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
770 void ACPI_INTERNAL_VAR_XFACE
771 acpi_error(const char *module_name,
772 u32 line_number,
773 const char *format, ...))
774ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
775 void ACPI_INTERNAL_VAR_XFACE
776 acpi_exception(const char *module_name,
777 u32 line_number,
778 acpi_status status,
779 const char *format, ...))
780ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
781 void ACPI_INTERNAL_VAR_XFACE
782 acpi_warning(const char *module_name,
783 u32 line_number,
784 const char *format, ...))
785ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
786 void ACPI_INTERNAL_VAR_XFACE
787 acpi_info(const char *module_name,
788 u32 line_number,
789 const char *format, ...))
790ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
791 void ACPI_INTERNAL_VAR_XFACE
792 acpi_bios_error(const char *module_name,
793 u32 line_number,
794 const char *format, ...))
795ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
796 void ACPI_INTERNAL_VAR_XFACE
797 acpi_bios_warning(const char *module_name,
798 u32 line_number,
799 const char *format, ...))
Bob Moore62cdd142012-07-16 09:25:27 +0800800
Bob Mooreb74be612009-04-22 10:20:23 +0800801/*
802 * Debug output
803 */
Lv Zheng1ce28c32014-04-30 10:04:55 +0800804ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
805 void ACPI_INTERNAL_VAR_XFACE
806 acpi_debug_print(u32 requested_debug_level,
807 u32 line_number,
808 const char *function_name,
809 const char *module_name,
810 u32 component_id,
811 const char *format, ...))
812ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
813 void ACPI_INTERNAL_VAR_XFACE
814 acpi_debug_print_raw(u32 requested_debug_level,
815 u32 line_number,
816 const char *function_name,
817 const char *module_name,
818 u32 component_id,
819 const char *format, ...))
Lv Zheng0dedb3c2014-04-30 10:05:02 +0800820
821/*
822 * Divergences
823 */
824acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
825
826acpi_status acpi_unload_table_id(acpi_owner_id id);
827
828acpi_status
829acpi_get_table_with_size(acpi_string signature,
830 u32 instance, struct acpi_table_header **out_table,
831 acpi_size *tbl_size);
832
833acpi_status
834acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data,
835 void (*callback)(void *));
836
Len Brown4be44fc2005-08-05 00:44:28 -0400837#endif /* __ACXFACE_H__ */