xref: /openbmc/linux/include/acpi/acpixf.h (revision 0ce792d6)
195857638SErik Schmauss /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
21da177e4SLinus Torvalds /******************************************************************************
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * Name: acpixf.h - External interfaces to the ACPI subsystem
51da177e4SLinus Torvalds  *
6800ba7c5SBob Moore  * Copyright (C) 2000 - 2020, Intel Corp.
71da177e4SLinus Torvalds  *
895857638SErik Schmauss  *****************************************************************************/
91da177e4SLinus Torvalds 
101da177e4SLinus Torvalds #ifndef __ACXFACE_H__
111da177e4SLinus Torvalds #define __ACXFACE_H__
121da177e4SLinus Torvalds 
1350df4d8bSBob Moore /* Current ACPICA subsystem version in YYYYMMDD format */
1450df4d8bSBob Moore 
15be91c442SBob Moore #define ACPI_CA_VERSION                 0x20200110
1650df4d8bSBob Moore 
17a1ce3928SDavid Howells #include <acpi/acconfig.h>
18a1ce3928SDavid Howells #include <acpi/actypes.h>
19a1ce3928SDavid Howells #include <acpi/actbl.h>
20d8dc91b7SLinus Torvalds #include <acpi/acbuffer.h>
211da177e4SLinus Torvalds 
221011080dSBob Moore /*****************************************************************************
233035ff70SLv Zheng  *
241011080dSBob Moore  * Macros used for ACPICA globals and configuration
251011080dSBob Moore  *
261011080dSBob Moore  ****************************************************************************/
271011080dSBob Moore 
281da177e4SLinus Torvalds /*
291011080dSBob Moore  * Ensure that global variables are defined and initialized only once.
301011080dSBob Moore  *
311011080dSBob Moore  * The use of these macros allows for a single list of globals (here)
321011080dSBob Moore  * in order to simplify maintenance of the code.
3350df4d8bSBob Moore  */
343035ff70SLv Zheng #ifdef DEFINE_ACPI_GLOBALS
353035ff70SLv Zheng #define ACPI_GLOBAL(type,name) \
363035ff70SLv Zheng 	extern type name; \
373035ff70SLv Zheng 	type name
383e8214e5SLv Zheng 
393035ff70SLv Zheng #define ACPI_INIT_GLOBAL(type,name,value) \
403035ff70SLv Zheng 	type name=value
413e8214e5SLv Zheng 
423035ff70SLv Zheng #else
433035ff70SLv Zheng #ifndef ACPI_GLOBAL
443035ff70SLv Zheng #define ACPI_GLOBAL(type,name) \
453035ff70SLv Zheng 	extern type name
463035ff70SLv Zheng #endif
473e8214e5SLv Zheng 
483035ff70SLv Zheng #ifndef ACPI_INIT_GLOBAL
493035ff70SLv Zheng #define ACPI_INIT_GLOBAL(type,name,value) \
503035ff70SLv Zheng 	extern type name
513035ff70SLv Zheng #endif
523035ff70SLv Zheng #endif
5350df4d8bSBob Moore 
5433620c54SBob Moore /*
551011080dSBob Moore  * These macros configure the various ACPICA interfaces. They are
561011080dSBob Moore  * useful for generating stub inline functions for features that are
571011080dSBob Moore  * configured out of the current kernel or ACPICA application.
581011080dSBob Moore  */
598b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_STATUS
608b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
618b9c1152SLv Zheng 	prototype;
628b9c1152SLv Zheng #endif
638b9c1152SLv Zheng 
648b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_OK
658b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_OK(prototype) \
668b9c1152SLv Zheng 	prototype;
678b9c1152SLv Zheng #endif
688b9c1152SLv Zheng 
698b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_VOID
708b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_VOID(prototype) \
718b9c1152SLv Zheng 	prototype;
728b9c1152SLv Zheng #endif
738b9c1152SLv Zheng 
748b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_UINT32
758b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
768b9c1152SLv Zheng 	prototype;
778b9c1152SLv Zheng #endif
788b9c1152SLv Zheng 
798b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_PTR
808b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_PTR(prototype) \
818b9c1152SLv Zheng 	prototype;
828b9c1152SLv Zheng #endif
838b9c1152SLv Zheng 
843035ff70SLv Zheng /*****************************************************************************
853035ff70SLv Zheng  *
861011080dSBob Moore  * Public globals and runtime configuration options
873035ff70SLv Zheng  *
883035ff70SLv Zheng  ****************************************************************************/
893035ff70SLv Zheng 
903035ff70SLv Zheng /*
911011080dSBob Moore  * Enable "slack mode" of the AML interpreter?  Default is FALSE, and the
923035ff70SLv Zheng  * interpreter strictly follows the ACPI specification. Setting to TRUE
933035ff70SLv Zheng  * allows the interpreter to ignore certain errors and/or bad AML constructs.
943035ff70SLv Zheng  *
953035ff70SLv Zheng  * Currently, these features are enabled by this flag:
963035ff70SLv Zheng  *
973035ff70SLv Zheng  * 1) Allow "implicit return" of last value in a control method
983035ff70SLv Zheng  * 2) Allow access beyond the end of an operation region
993035ff70SLv Zheng  * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
1003035ff70SLv Zheng  * 4) Allow ANY object type to be a source operand for the Store() operator
1013035ff70SLv Zheng  * 5) Allow unresolved references (invalid target name) in package objects
1023035ff70SLv Zheng  * 6) Enable warning messages for behavior that is not ACPI spec compliant
1033035ff70SLv Zheng  */
1043035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
1053035ff70SLv Zheng 
1063035ff70SLv Zheng /*
1073035ff70SLv Zheng  * Automatically serialize all methods that create named objects? Default
1083035ff70SLv Zheng  * is TRUE, meaning that all non_serialized methods are scanned once at
1093035ff70SLv Zheng  * table load time to determine those that create named objects. Methods
1103035ff70SLv Zheng  * that create named objects are marked Serialized in order to prevent
1113035ff70SLv Zheng  * possible run-time problems if they are entered by more than one thread.
1123035ff70SLv Zheng  */
1133035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
1143035ff70SLv Zheng 
1153035ff70SLv Zheng /*
1163035ff70SLv Zheng  * Create the predefined _OSI method in the namespace? Default is TRUE
1173035ff70SLv Zheng  * because ACPICA is fully compatible with other ACPI implementations.
1183035ff70SLv Zheng  * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
1193035ff70SLv Zheng  */
1203035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
1213035ff70SLv Zheng 
1223035ff70SLv Zheng /*
1233035ff70SLv Zheng  * Optionally use default values for the ACPI register widths. Set this to
1243035ff70SLv Zheng  * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
1253035ff70SLv Zheng  */
1263035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
1273035ff70SLv Zheng 
1283035ff70SLv Zheng /*
129023e2ee1SLv Zheng  * Whether or not to validate (map) an entire table to verify
130023e2ee1SLv Zheng  * checksum/duplication in early stage before install. Set this to TRUE to
131023e2ee1SLv Zheng  * allow early table validation before install it to the table manager.
132023e2ee1SLv Zheng  * Note that enabling this option causes errors to happen in some OSPMs
133023e2ee1SLv Zheng  * during early initialization stages. Default behavior is to allow such
134023e2ee1SLv Zheng  * validation.
13547d68c7fSLv Zheng  */
136023e2ee1SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_table_validation, TRUE);
13747d68c7fSLv Zheng 
13847d68c7fSLv Zheng /*
1393035ff70SLv Zheng  * Optionally enable output from the AML Debug Object.
1403035ff70SLv Zheng  */
1413035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
1423035ff70SLv Zheng 
1433035ff70SLv Zheng /*
1443035ff70SLv Zheng  * Optionally copy the entire DSDT to local memory (instead of simply
1453035ff70SLv Zheng  * mapping it.) There are some BIOSs that corrupt or replace the original
1463035ff70SLv Zheng  * DSDT, creating the need for this option. Default is FALSE, do not copy
1473035ff70SLv Zheng  * the DSDT.
1483035ff70SLv Zheng  */
1493035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
1503035ff70SLv Zheng 
1513035ff70SLv Zheng /*
1523035ff70SLv Zheng  * Optionally ignore an XSDT if present and use the RSDT instead.
1533035ff70SLv Zheng  * Although the ACPI specification requires that an XSDT be used instead
1543035ff70SLv Zheng  * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
1553035ff70SLv Zheng  * some machines. Default behavior is to use the XSDT if present.
1563035ff70SLv Zheng  */
1573035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
1583035ff70SLv Zheng 
1593035ff70SLv Zheng /*
1603035ff70SLv Zheng  * Optionally use 32-bit FADT addresses if and when there is a conflict
1613035ff70SLv Zheng  * (address mismatch) between the 32-bit and 64-bit versions of the
1623035ff70SLv Zheng  * address. Although ACPICA adheres to the ACPI specification which
1633035ff70SLv Zheng  * requires the use of the corresponding 64-bit address if it is non-zero,
1643035ff70SLv Zheng  * some machines have been found to have a corrupted non-zero 64-bit
1650ea61381SLv Zheng  * address. Default is FALSE, do not favor the 32-bit addresses.
1663035ff70SLv Zheng  */
1670ea61381SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
1683035ff70SLv Zheng 
1693035ff70SLv Zheng /*
170c04e1fb4SLv Zheng  * Optionally use 32-bit FACS table addresses.
171c04e1fb4SLv Zheng  * It is reported that some platforms fail to resume from system suspending
172c04e1fb4SLv Zheng  * if 64-bit FACS table address is selected:
173c04e1fb4SLv Zheng  * https://bugzilla.kernel.org/show_bug.cgi?id=74021
174c04e1fb4SLv Zheng  * Default is TRUE, favor the 32-bit addresses.
175c04e1fb4SLv Zheng  */
176c04e1fb4SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_facs_addresses, TRUE);
177c04e1fb4SLv Zheng 
178c04e1fb4SLv Zheng /*
1793035ff70SLv Zheng  * Optionally truncate I/O addresses to 16 bits. Provides compatibility
1803035ff70SLv Zheng  * with other ACPI implementations. NOTE: During ACPICA initialization,
1813035ff70SLv Zheng  * this value is set to TRUE if any Windows OSI strings have been
1823035ff70SLv Zheng  * requested by the BIOS.
1833035ff70SLv Zheng  */
1843035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
1853035ff70SLv Zheng 
1863035ff70SLv Zheng /*
1873035ff70SLv Zheng  * Disable runtime checking and repair of values returned by control methods.
1883035ff70SLv Zheng  * Use only if the repair is causing a problem on a particular machine.
1893035ff70SLv Zheng  */
1903035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
1913035ff70SLv Zheng 
1923035ff70SLv Zheng /*
1933035ff70SLv Zheng  * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
1943035ff70SLv Zheng  * This can be useful for debugging ACPI problems on some machines.
1953035ff70SLv Zheng  */
1963035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
1973035ff70SLv Zheng 
1983035ff70SLv Zheng /*
1998ea98655SBob Moore  * Optionally enable runtime namespace override.
2008ea98655SBob Moore  */
2018ea98655SBob Moore ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE);
2028ea98655SBob Moore 
2038ea98655SBob Moore /*
2043035ff70SLv Zheng  * We keep track of the latest version of Windows that has been requested by
2053035ff70SLv Zheng  * the BIOS. ACPI 5.0.
2063035ff70SLv Zheng  */
2073035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
2083035ff70SLv Zheng 
2093035ff70SLv Zheng /*
2103a2f3a33SLv Zheng  * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
2113a2f3a33SLv Zheng  * that the ACPI hardware is no longer required. A flag in the FADT indicates
2123a2f3a33SLv Zheng  * a reduced HW machine, and that flag is duplicated here for convenience.
2131da177e4SLinus Torvalds  */
2143a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
21550df4d8bSBob Moore 
2163a2f3a33SLv Zheng /*
217164a08ceSLv Zheng  * Maximum timeout for While() loop iterations before forced method abort.
218066118ffSBob Moore  * This mechanism is intended to prevent infinite loops during interpreter
219066118ffSBob Moore  * execution within a host kernel.
220066118ffSBob Moore  */
221164a08ceSLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_TIMEOUT);
222066118ffSBob Moore 
223066118ffSBob Moore /*
22434f206fdSBob Moore  * Optionally ignore AE_NOT_FOUND errors from named reference package elements
22534f206fdSBob Moore  * during DSDT/SSDT table loading. This reduces error "noise" in platforms
22634f206fdSBob Moore  * whose firmware is carrying around a bunch of unused package objects that
22734f206fdSBob Moore  * refer to non-existent named objects. However, If the AML actually tries to
22834f206fdSBob Moore  * use such a package, the unresolved element(s) will be replaced with NULL
22934f206fdSBob Moore  * elements.
23034f206fdSBob Moore  */
23134f206fdSBob Moore ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_package_resolution_errors, FALSE);
23234f206fdSBob Moore 
23334f206fdSBob Moore /*
2343a2f3a33SLv Zheng  * This mechanism is used to trace a specified AML method. The method is
2353a2f3a33SLv Zheng  * traced each time it is executed.
2363a2f3a33SLv Zheng  */
2373a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
238ab6c5733SLv Zheng ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL);
239ab6c5733SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT);
240ab6c5733SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
24150df4d8bSBob Moore 
2423a2f3a33SLv Zheng /*
2433a2f3a33SLv Zheng  * Runtime configuration of debug output control masks. We want the debug
2443a2f3a33SLv Zheng  * switches statically initialized so they are already set when the debugger
2453a2f3a33SLv Zheng  * is entered.
2463a2f3a33SLv Zheng  */
2473a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
2483a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
24950df4d8bSBob Moore 
2505e568304SBob Moore /* Optionally enable timer output with Debug Object output */
2515e568304SBob Moore 
2525e568304SBob Moore ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE);
2535e568304SBob Moore 
2543a2f3a33SLv Zheng /*
255f8d31489SLv Zheng  * Debugger command handshake globals. Host OSes need to access these
256f8d31489SLv Zheng  * variables to implement their own command handshake mechanism.
257f8d31489SLv Zheng  */
258f8d31489SLv Zheng #ifdef ACPI_DEBUGGER
259f8d31489SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
260f8d31489SLv Zheng ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]);
261f8d31489SLv Zheng #endif
262f8d31489SLv Zheng 
263f8d31489SLv Zheng /*
2641011080dSBob Moore  * Other miscellaneous globals
2653a2f3a33SLv Zheng  */
2663a2f3a33SLv Zheng ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
2671011080dSBob Moore ACPI_GLOBAL(u32, acpi_current_gpe_count);
2683a2f3a33SLv Zheng ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
26950df4d8bSBob Moore 
2701011080dSBob Moore /*****************************************************************************
2711011080dSBob Moore  *
2721011080dSBob Moore  * ACPICA public interface configuration.
2731011080dSBob Moore  *
2741011080dSBob Moore  * Interfaces that are configured out of the ACPICA build are replaced
2751011080dSBob Moore  * by inlined stubs by default.
2761011080dSBob Moore  *
2771011080dSBob Moore  ****************************************************************************/
2781011080dSBob Moore 
27933620c54SBob Moore /*
2801011080dSBob Moore  * Hardware-reduced prototypes (default: Not hardware reduced).
2811011080dSBob Moore  *
2821011080dSBob Moore  * All ACPICA hardware-related interfaces that use these macros will be
2831011080dSBob Moore  * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
28433620c54SBob Moore  * is set to TRUE.
2851011080dSBob Moore  *
2861011080dSBob Moore  * Note: This static build option for reduced hardware is intended to
2871011080dSBob Moore  * reduce ACPICA code size if desired or necessary. However, even if this
2881011080dSBob Moore  * option is not specified, the runtime behavior of ACPICA is dependent
2891011080dSBob Moore  * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
2901011080dSBob Moore  * the flag will enable similar behavior -- ACPICA will not attempt
2911011080dSBob Moore  * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
29233620c54SBob Moore  */
29333620c54SBob Moore #if (!ACPI_REDUCED_HARDWARE)
29433620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
2958b9c1152SLv Zheng 	ACPI_EXTERNAL_RETURN_STATUS(prototype)
29633620c54SBob Moore 
29733620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
2988b9c1152SLv Zheng 	ACPI_EXTERNAL_RETURN_OK(prototype)
29933620c54SBob Moore 
3006921de89SRafael J. Wysocki #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
3016921de89SRafael J. Wysocki 	ACPI_EXTERNAL_RETURN_UINT32(prototype)
3026921de89SRafael J. Wysocki 
30333620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
3048b9c1152SLv Zheng 	ACPI_EXTERNAL_RETURN_VOID(prototype)
30533620c54SBob Moore 
30633620c54SBob Moore #else
30733620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
30833620c54SBob Moore 	static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
30933620c54SBob Moore 
31033620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
31133620c54SBob Moore 	static ACPI_INLINE prototype {return(AE_OK);}
31233620c54SBob Moore 
3136921de89SRafael J. Wysocki #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
3146921de89SRafael J. Wysocki 	static ACPI_INLINE prototype {return(0);}
3156921de89SRafael J. Wysocki 
31633620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
317c26f3c90SBob Moore 	static ACPI_INLINE prototype {return;}
31833620c54SBob Moore 
31933620c54SBob Moore #endif				/* !ACPI_REDUCED_HARDWARE */
32033620c54SBob Moore 
32150df4d8bSBob Moore /*
3221011080dSBob Moore  * Error message prototypes (default: error messages enabled).
3231011080dSBob Moore  *
3241011080dSBob Moore  * All interfaces related to error and warning messages
3251011080dSBob Moore  * will be configured out of the ACPICA build if the
3261011080dSBob Moore  * ACPI_NO_ERROR_MESSAGE flag is defined.
327407e22afSLv Zheng  */
328407e22afSLv Zheng #ifndef ACPI_NO_ERROR_MESSAGES
329407e22afSLv Zheng #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
330407e22afSLv Zheng 	prototype;
331407e22afSLv Zheng 
332407e22afSLv Zheng #else
333407e22afSLv Zheng #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
334407e22afSLv Zheng 	static ACPI_INLINE prototype {return;}
335407e22afSLv Zheng 
336407e22afSLv Zheng #endif				/* ACPI_NO_ERROR_MESSAGES */
337407e22afSLv Zheng 
338407e22afSLv Zheng /*
3391011080dSBob Moore  * Debugging output prototypes (default: no debug output).
3401011080dSBob Moore  *
3411011080dSBob Moore  * All interfaces related to debug output messages
3421011080dSBob Moore  * will be configured out of the ACPICA build unless the
3431011080dSBob Moore  * ACPI_DEBUG_OUTPUT flag is defined.
3441ce28c32SLv Zheng  */
3451ce28c32SLv Zheng #ifdef ACPI_DEBUG_OUTPUT
3461ce28c32SLv Zheng #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
3471ce28c32SLv Zheng 	prototype;
3481ce28c32SLv Zheng 
3491ce28c32SLv Zheng #else
3501ce28c32SLv Zheng #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
3511ce28c32SLv Zheng 	static ACPI_INLINE prototype {return;}
3521ce28c32SLv Zheng 
3531ce28c32SLv Zheng #endif				/* ACPI_DEBUG_OUTPUT */
3541ce28c32SLv Zheng 
3552e70da4cSLv Zheng /*
3562e70da4cSLv Zheng  * Application prototypes
3572e70da4cSLv Zheng  *
3582e70da4cSLv Zheng  * All interfaces used by application will be configured
3592e70da4cSLv Zheng  * out of the ACPICA build unless the ACPI_APPLICATION
3602e70da4cSLv Zheng  * flag is defined.
3612e70da4cSLv Zheng  */
3622e70da4cSLv Zheng #ifdef ACPI_APPLICATION
3632e70da4cSLv Zheng #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
3642e70da4cSLv Zheng 	prototype;
3652e70da4cSLv Zheng 
3662e70da4cSLv Zheng #else
3672e70da4cSLv Zheng #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
3682e70da4cSLv Zheng 	static ACPI_INLINE prototype {return;}
3692e70da4cSLv Zheng 
3702e70da4cSLv Zheng #endif				/* ACPI_APPLICATION */
3712e70da4cSLv Zheng 
3728a2a2501SLv Zheng /*
3738a2a2501SLv Zheng  * Debugger prototypes
3748a2a2501SLv Zheng  *
3758a2a2501SLv Zheng  * All interfaces used by debugger will be configured
3768a2a2501SLv Zheng  * out of the ACPICA build unless the ACPI_DEBUGGER
3778a2a2501SLv Zheng  * flag is defined.
3788a2a2501SLv Zheng  */
3798a2a2501SLv Zheng #ifdef ACPI_DEBUGGER
3808a2a2501SLv Zheng #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
3818a2a2501SLv Zheng 	ACPI_EXTERNAL_RETURN_OK(prototype)
3828a2a2501SLv Zheng 
3838a2a2501SLv Zheng #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
3848a2a2501SLv Zheng 	ACPI_EXTERNAL_RETURN_VOID(prototype)
3858a2a2501SLv Zheng 
3868a2a2501SLv Zheng #else
3878a2a2501SLv Zheng #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
3888a2a2501SLv Zheng 	static ACPI_INLINE prototype {return(AE_OK);}
3898a2a2501SLv Zheng 
3908a2a2501SLv Zheng #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
3918a2a2501SLv Zheng 	static ACPI_INLINE prototype {return;}
3928a2a2501SLv Zheng 
3938a2a2501SLv Zheng #endif				/* ACPI_DEBUGGER */
3948a2a2501SLv Zheng 
3951011080dSBob Moore /*****************************************************************************
3961011080dSBob Moore  *
3971011080dSBob Moore  * ACPICA public interface prototypes
3981011080dSBob Moore  *
3991011080dSBob Moore  ****************************************************************************/
4001011080dSBob Moore 
4011ce28c32SLv Zheng /*
40275c8044fSLv Zheng  * Initialization
4031da177e4SLinus Torvalds  */
4042368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4058b9c1152SLv Zheng 			    acpi_initialize_tables(struct acpi_table_desc
4068b9c1152SLv Zheng 						   *initial_storage,
4078b9c1152SLv Zheng 						   u32 initial_table_count,
4088b9c1152SLv Zheng 						   u8 allow_resize))
4092368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4102368b1a1SLv Zheng 			     acpi_initialize_subsystem(void))
4112368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4122368b1a1SLv Zheng 			     acpi_enable_subsystem(u32 flags))
4132368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4148b9c1152SLv Zheng 			     acpi_initialize_objects(u32 flags))
4152368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4162368b1a1SLv Zheng 			     acpi_terminate(void))
4171da177e4SLinus Torvalds 
41875c8044fSLv Zheng /*
41975c8044fSLv Zheng  * Miscellaneous global interfaces
42075c8044fSLv Zheng  */
42133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
42233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
4238b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
4241da177e4SLinus Torvalds 
4258b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4268b9c1152SLv Zheng 			    acpi_get_system_info(struct acpi_buffer
4278b9c1152SLv Zheng 						 *ret_buffer))
4288b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4298b9c1152SLv Zheng 			     acpi_get_statistics(struct acpi_statistics *stats))
4308b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_PTR(const char
4318b9c1152SLv Zheng 			  *acpi_format_exception(acpi_status exception))
4328b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
4331da177e4SLinus Torvalds 
4348b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4358b9c1152SLv Zheng 			    acpi_install_interface(acpi_string interface_name))
4369187a415SLv Zheng 
4378b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4388b9c1152SLv Zheng 			    acpi_remove_interface(acpi_string interface_name))
4398b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
4401da177e4SLinus Torvalds 
4418b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_UINT32(u32
4428b9c1152SLv Zheng 			    acpi_check_address_range(acpi_adr_space_type
4438b9c1152SLv Zheng 						     space_id,
4448b9c1152SLv Zheng 						     acpi_physical_address
4458b9c1152SLv Zheng 						     address, acpi_size length,
4468b9c1152SLv Zheng 						     u8 warn))
4478b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
448be030a57SBob Moore 			     acpi_decode_pld_buffer(u8 *in_buffer,
4498b9c1152SLv Zheng 						    acpi_size length,
4508b9c1152SLv Zheng 						    struct acpi_pld_info
4518b9c1152SLv Zheng 						    **return_buffer))
452be030a57SBob Moore 
4531da177e4SLinus Torvalds /*
454f60d8181SBob Moore  * ACPI table load/unload interfaces
455f60d8181SBob Moore  */
4562368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4578b9c1152SLv Zheng 			    acpi_install_table(acpi_physical_address address,
4588b9c1152SLv Zheng 					       u8 physical))
459f60d8181SBob Moore 
4608b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4611770093cSNikolaus Voss 			    acpi_load_table(struct acpi_table_header *table,
4621770093cSNikolaus Voss 					    u32 *table_idx))
463f60d8181SBob Moore 
4648b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
46542d939faSBob Moore 			    acpi_unload_table(u32 table_index))
46642d939faSBob Moore 
46742d939faSBob Moore ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4688b9c1152SLv Zheng 			    acpi_unload_parent_table(acpi_handle object))
4692368b1a1SLv Zheng 
4702368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4712368b1a1SLv Zheng 			    acpi_load_tables(void))
472f60d8181SBob Moore 
473f60d8181SBob Moore /*
4741da177e4SLinus Torvalds  * ACPI table manipulation interfaces
4751da177e4SLinus Torvalds  */
4762368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
4772368b1a1SLv Zheng 			    acpi_reallocate_root_table(void))
478f3d2e786SBob Moore 
4792368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
480f5c1e1c5SLv Zheng 			    acpi_find_root_pointer(acpi_physical_address
481f5c1e1c5SLv Zheng 						   *rsdp_address))
4828b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
483f3d2e786SBob Moore 			     acpi_get_table_header(acpi_string signature,
4848b9c1152SLv Zheng 						   u32 instance,
4858b9c1152SLv Zheng 						   struct acpi_table_header
4868b9c1152SLv Zheng 						   *out_table_header))
4878b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4888b9c1152SLv Zheng 			     acpi_get_table(acpi_string signature, u32 instance,
4898b9c1152SLv Zheng 					    struct acpi_table_header
4908b9c1152SLv Zheng 					    **out_table))
491174cc718SLv Zheng ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table))
492174cc718SLv Zheng 
4938b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4948b9c1152SLv Zheng 			    acpi_get_table_by_index(u32 table_index,
4958b9c1152SLv Zheng 						    struct acpi_table_header
4968b9c1152SLv Zheng 						    **out_table))
4978b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4988b9c1152SLv Zheng 			     acpi_install_table_handler(acpi_table_handler
4998b9c1152SLv Zheng 							handler, void *context))
5008b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5018b9c1152SLv Zheng 			     acpi_remove_table_handler(acpi_table_handler
5028b9c1152SLv Zheng 						       handler))
5033e08e2d2SLin Ming 
5041da177e4SLinus Torvalds /*
5051da177e4SLinus Torvalds  * Namespace and name interfaces
5061da177e4SLinus Torvalds  */
5078b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5084be44fcdSLen Brown 			    acpi_walk_namespace(acpi_object_type type,
5091da177e4SLinus Torvalds 						acpi_handle start_object,
5101da177e4SLinus Torvalds 						u32 max_depth,
5118b9c1152SLv Zheng 						acpi_walk_callback
5128b9c1152SLv Zheng 						descending_callback,
5138b9c1152SLv Zheng 						acpi_walk_callback
5148b9c1152SLv Zheng 						ascending_callback,
5158b9c1152SLv Zheng 						void *context,
5168b9c1152SLv Zheng 						void **return_value))
5178b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
51870b30fb1SAl Viro 			     acpi_get_devices(const char *HID,
5191da177e4SLinus Torvalds 					      acpi_walk_callback user_function,
5208b9c1152SLv Zheng 					      void *context,
5218b9c1152SLv Zheng 					      void **return_value))
5228b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5238b9c1152SLv Zheng 			     acpi_get_name(acpi_handle object, u32 name_type,
5248b9c1152SLv Zheng 					   struct acpi_buffer *ret_path_ptr))
5258b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5264be44fcdSLen Brown 			     acpi_get_handle(acpi_handle parent,
5278b9c1152SLv Zheng 					     acpi_string pathname,
5288b9c1152SLv Zheng 					     acpi_handle *ret_handle))
5298b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5308b9c1152SLv Zheng 			     acpi_attach_data(acpi_handle object,
5318b9c1152SLv Zheng 					      acpi_object_handler handler,
5328b9c1152SLv Zheng 					      void *data))
5338b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5348b9c1152SLv Zheng 			     acpi_detach_data(acpi_handle object,
5358b9c1152SLv Zheng 					      acpi_object_handler handler))
5368b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5378b9c1152SLv Zheng 			     acpi_get_data(acpi_handle object,
5388b9c1152SLv Zheng 					   acpi_object_handler handler,
5398b9c1152SLv Zheng 					   void **data))
5408b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
541ab6c5733SLv Zheng 			     acpi_debug_trace(const char *name, u32 debug_level,
5428b9c1152SLv Zheng 					      u32 debug_layer, u32 flags))
54350eca3ebSBob Moore 
5441da177e4SLinus Torvalds /*
5451da177e4SLinus Torvalds  * Object manipulation and enumeration
5461da177e4SLinus Torvalds  */
5478b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5484be44fcdSLen Brown 			    acpi_evaluate_object(acpi_handle object,
5491da177e4SLinus Torvalds 						 acpi_string pathname,
5508b9c1152SLv Zheng 						 struct acpi_object_list
5518b9c1152SLv Zheng 						 *parameter_objects,
5528b9c1152SLv Zheng 						 struct acpi_buffer
5538b9c1152SLv Zheng 						 *return_object_buffer))
5548b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5554be44fcdSLen Brown 			     acpi_evaluate_object_typed(acpi_handle object,
5561da177e4SLinus Torvalds 							acpi_string pathname,
5578b9c1152SLv Zheng 							struct acpi_object_list
5588b9c1152SLv Zheng 							*external_params,
5598b9c1152SLv Zheng 							struct acpi_buffer
5608b9c1152SLv Zheng 							*return_buffer,
5618b9c1152SLv Zheng 							acpi_object_type
5628b9c1152SLv Zheng 							return_type))
5638b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
564b47cf58eSBob Moore 			     acpi_get_object_info(acpi_handle object,
5658b9c1152SLv Zheng 						  struct acpi_device_info
5668b9c1152SLv Zheng 						  **return_buffer))
5678b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
5681da177e4SLinus Torvalds 
5698b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5704be44fcdSLen Brown 			    acpi_get_next_object(acpi_object_type type,
5711da177e4SLinus Torvalds 						 acpi_handle parent,
5728b9c1152SLv Zheng 						 acpi_handle child,
5738b9c1152SLv Zheng 						 acpi_handle *out_handle))
5741da177e4SLinus Torvalds 
5758b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5768b9c1152SLv Zheng 			    acpi_get_type(acpi_handle object,
5778b9c1152SLv Zheng 					  acpi_object_type *out_type))
5781da177e4SLinus Torvalds 
5798b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5808b9c1152SLv Zheng 			    acpi_get_parent(acpi_handle object,
5818b9c1152SLv Zheng 					    acpi_handle *out_handle))
5821da177e4SLinus Torvalds 
5831da177e4SLinus Torvalds /*
584ecfbbc7bSBob Moore  * Handler interfaces
5851da177e4SLinus Torvalds  */
5868b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5878b9c1152SLv Zheng 			    acpi_install_initialization_handler
5888b9c1152SLv Zheng 			    (acpi_init_handler handler, u32 function))
58933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
590a2fd4b4bSLv Zheng 				 acpi_install_sci_handler(acpi_sci_handler
591a2fd4b4bSLv Zheng 							  address,
592a2fd4b4bSLv Zheng 							  void *context))
593a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
594a2fd4b4bSLv Zheng 				 acpi_remove_sci_handler(acpi_sci_handler
595a2fd4b4bSLv Zheng 							 address))
596a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
59733620c54SBob Moore 				 acpi_install_global_event_handler
598a2fd4b4bSLv Zheng 				 (acpi_gbl_event_handler handler,
599a2fd4b4bSLv Zheng 				  void *context))
60033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
60133620c54SBob Moore 				 acpi_install_fixed_event_handler(u32
60233620c54SBob Moore 								  acpi_event,
60333620c54SBob Moore 								  acpi_event_handler
60433620c54SBob Moore 								  handler,
60533620c54SBob Moore 								  void
60633620c54SBob Moore 								  *context))
60733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
60833620c54SBob Moore 				 acpi_remove_fixed_event_handler(u32 acpi_event,
60933620c54SBob Moore 								 acpi_event_handler
61033620c54SBob Moore 								 handler))
61133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
61233620c54SBob Moore 				 acpi_install_gpe_handler(acpi_handle
61333620c54SBob Moore 							  gpe_device,
61433620c54SBob Moore 							  u32 gpe_number,
61533620c54SBob Moore 							  u32 type,
61633620c54SBob Moore 							  acpi_gpe_handler
61733620c54SBob Moore 							  address,
61833620c54SBob Moore 							  void *context))
61933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
6200d0988afSLv Zheng 				 acpi_install_gpe_raw_handler(acpi_handle
6210d0988afSLv Zheng 							      gpe_device,
6220d0988afSLv Zheng 							      u32 gpe_number,
6230d0988afSLv Zheng 							      u32 type,
6240d0988afSLv Zheng 							      acpi_gpe_handler
6250d0988afSLv Zheng 							      address,
6260d0988afSLv Zheng 							      void *context))
6270d0988afSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
62833620c54SBob Moore 				 acpi_remove_gpe_handler(acpi_handle gpe_device,
62933620c54SBob Moore 							 u32 gpe_number,
63033620c54SBob Moore 							 acpi_gpe_handler
63133620c54SBob Moore 							 address))
6328b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6338b9c1152SLv Zheng 			     acpi_install_notify_handler(acpi_handle device,
6348b9c1152SLv Zheng 							 u32 handler_type,
6358b9c1152SLv Zheng 							 acpi_notify_handler
6368b9c1152SLv Zheng 							 handler,
6378b9c1152SLv Zheng 							 void *context))
6388b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6394be44fcdSLen Brown 			     acpi_remove_notify_handler(acpi_handle device,
6408b9c1152SLv Zheng 							u32 handler_type,
6418b9c1152SLv Zheng 							acpi_notify_handler
6428b9c1152SLv Zheng 							handler))
6438b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6448b9c1152SLv Zheng 			     acpi_install_address_space_handler(acpi_handle
6458b9c1152SLv Zheng 								device,
6468b9c1152SLv Zheng 								acpi_adr_space_type
6478b9c1152SLv Zheng 								space_id,
6488b9c1152SLv Zheng 								acpi_adr_space_handler
6498b9c1152SLv Zheng 								handler,
6508b9c1152SLv Zheng 								acpi_adr_space_setup
6518b9c1152SLv Zheng 								setup,
6528b9c1152SLv Zheng 								void *context))
6538b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6548b9c1152SLv Zheng 			     acpi_remove_address_space_handler(acpi_handle
6558b9c1152SLv Zheng 							       device,
6568b9c1152SLv Zheng 							       acpi_adr_space_type
6578b9c1152SLv Zheng 							       space_id,
6588b9c1152SLv Zheng 							       acpi_adr_space_handler
6598b9c1152SLv Zheng 							       handler))
6608b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6618b9c1152SLv Zheng 			     acpi_install_exception_handler
6628b9c1152SLv Zheng 			     (acpi_exception_handler handler))
6638b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6648b9c1152SLv Zheng 			     acpi_install_interface_handler
6658b9c1152SLv Zheng 			     (acpi_interface_handler handler))
666b0ed7a91SLin Ming 
6671da177e4SLinus Torvalds /*
668ffef6827SLin Ming  * Global Lock interfaces
6691da177e4SLinus Torvalds  */
67033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
67133620c54SBob Moore 				acpi_acquire_global_lock(u16 timeout,
67233620c54SBob Moore 							 u32 *handle))
673cd27d79fSLv Zheng 
67433620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
67533620c54SBob Moore 				acpi_release_global_lock(u32 handle))
6761da177e4SLinus Torvalds 
677ffef6827SLin Ming /*
678ffef6827SLin Ming  * Interfaces to AML mutex objects
679ffef6827SLin Ming  */
6808b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6818b9c1152SLv Zheng 			    acpi_acquire_mutex(acpi_handle handle,
6828b9c1152SLv Zheng 					       acpi_string pathname,
6838b9c1152SLv Zheng 					       u16 timeout))
684ffef6827SLin Ming 
6858b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6868b9c1152SLv Zheng 			    acpi_release_mutex(acpi_handle handle,
6878b9c1152SLv Zheng 					       acpi_string pathname))
688ffef6827SLin Ming 
689ffef6827SLin Ming /*
690ffef6827SLin Ming  * Fixed Event interfaces
691ffef6827SLin Ming  */
69233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
69333620c54SBob Moore 				acpi_enable_event(u32 event, u32 flags))
6941da177e4SLinus Torvalds 
69533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
69633620c54SBob Moore 				acpi_disable_event(u32 event, u32 flags))
69733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
6981da177e4SLinus Torvalds 
69933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
70033620c54SBob Moore 				acpi_get_event_status(u32 event,
70133620c54SBob Moore 						      acpi_event_status
70233620c54SBob Moore 						      *event_status))
703cd27d79fSLv Zheng 
70408ac07b8SBob Moore /*
705ffef6827SLin Ming  * General Purpose Event (GPE) Interfaces
70608ac07b8SBob Moore  */
70733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
7084be44fcdSLen Brown 
70933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
71033620c54SBob Moore 				acpi_enable_gpe(acpi_handle gpe_device,
71133620c54SBob Moore 						u32 gpe_number))
7124be44fcdSLen Brown 
71333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
71433620c54SBob Moore 				acpi_disable_gpe(acpi_handle gpe_device,
71533620c54SBob Moore 						 u32 gpe_number))
7161da177e4SLinus Torvalds 
71733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
71833620c54SBob Moore 				acpi_clear_gpe(acpi_handle gpe_device,
71933620c54SBob Moore 					       u32 gpe_number))
720bba63a29SLin Ming 
72133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
72233620c54SBob Moore 				acpi_set_gpe(acpi_handle gpe_device,
72333620c54SBob Moore 					     u32 gpe_number, u8 action))
724e8b6f970SRafael J. Wysocki 
72533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
72633620c54SBob Moore 				acpi_finish_gpe(acpi_handle gpe_device,
72733620c54SBob Moore 						u32 gpe_number))
72833620c54SBob Moore 
72933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
7302af52c2bSLv Zheng 				acpi_mask_gpe(acpi_handle gpe_device,
7312af52c2bSLv Zheng 					      u32 gpe_number, u8 is_masked))
7322af52c2bSLv Zheng 
7332af52c2bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
734c12f07d1SRafael J. Wysocki 				acpi_mark_gpe_for_wake(acpi_handle gpe_device,
735c12f07d1SRafael J. Wysocki 						       u32 gpe_number))
736c12f07d1SRafael J. Wysocki 
737c12f07d1SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
73833620c54SBob Moore 				acpi_setup_gpe_for_wake(acpi_handle
73933620c54SBob Moore 							parent_device,
74033620c54SBob Moore 							acpi_handle gpe_device,
74133620c54SBob Moore 							u32 gpe_number))
74233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
74333620c54SBob Moore 				 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
74433620c54SBob Moore 							u32 gpe_number,
74533620c54SBob Moore 							u8 action))
74633620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
7474be44fcdSLen Brown 				 acpi_get_gpe_status(acpi_handle gpe_device,
74833620c54SBob Moore 						     u32 gpe_number,
74933620c54SBob Moore 						     acpi_event_status
75033620c54SBob Moore 						     *event_status))
7516921de89SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number))
75233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
75333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
754e0fa975dSRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
7550ce792d6SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_gpe_status_set(u32 gpe_skip_number))
75663fb9623SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_fixed_event_status_set(void))
75708ac07b8SBob Moore 
75833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
75933620c54SBob Moore 				acpi_get_gpe_device(u32 gpe_index,
76033620c54SBob Moore 						    acpi_handle *gpe_device))
761e97d6bf1SBob Moore 
76233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
7634be44fcdSLen Brown 				acpi_install_gpe_block(acpi_handle gpe_device,
76433620c54SBob Moore 						       struct
76533620c54SBob Moore 						       acpi_generic_address
76633620c54SBob Moore 						       *gpe_block_address,
76733620c54SBob Moore 						       u32 register_count,
76833620c54SBob Moore 						       u32 interrupt_number))
76933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
77033620c54SBob Moore 				 acpi_remove_gpe_block(acpi_handle gpe_device))
771a2100801SRafael J. Wysocki 
7721da177e4SLinus Torvalds /*
7731da177e4SLinus Torvalds  * Resource interfaces
7741da177e4SLinus Torvalds  */
7751da177e4SLinus Torvalds typedef
77661686124SBob Moore acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource,
7771da177e4SLinus Torvalds 					    void *context);
7781da177e4SLinus Torvalds 
7798b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
780b47cf58eSBob Moore 			    acpi_get_vendor_resource(acpi_handle device,
781c51a4de8SBob Moore 						     char *name,
7828b9c1152SLv Zheng 						     struct acpi_vendor_uuid
7838b9c1152SLv Zheng 						     *uuid,
7848b9c1152SLv Zheng 						     struct acpi_buffer
7858b9c1152SLv Zheng 						     *ret_buffer))
7868b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7878b9c1152SLv Zheng 			     acpi_get_current_resources(acpi_handle device,
7888b9c1152SLv Zheng 							struct acpi_buffer
7898b9c1152SLv Zheng 							*ret_buffer))
7908b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7918b9c1152SLv Zheng 			     acpi_get_possible_resources(acpi_handle device,
7928b9c1152SLv Zheng 							 struct acpi_buffer
7938b9c1152SLv Zheng 							 *ret_buffer))
7948b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
795a91cdde2SBob Moore 			     acpi_get_event_resources(acpi_handle device_handle,
7968b9c1152SLv Zheng 						      struct acpi_buffer
7978b9c1152SLv Zheng 						      *ret_buffer))
7988b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7998b9c1152SLv Zheng 			     acpi_walk_resource_buffer(struct acpi_buffer
8008b9c1152SLv Zheng 						       *buffer,
8018b9c1152SLv Zheng 						       acpi_walk_resource_callback
8028b9c1152SLv Zheng 						       user_function,
8038b9c1152SLv Zheng 						       void *context))
8048b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8058b9c1152SLv Zheng 			     acpi_walk_resources(acpi_handle device, char *name,
8068b9c1152SLv Zheng 						 acpi_walk_resource_callback
8078b9c1152SLv Zheng 						 user_function, void *context))
8088b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8098b9c1152SLv Zheng 			     acpi_set_current_resources(acpi_handle device,
8108b9c1152SLv Zheng 							struct acpi_buffer
8118b9c1152SLv Zheng 							*in_buffer))
8128b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8138b9c1152SLv Zheng 			     acpi_get_irq_routing_table(acpi_handle device,
8148b9c1152SLv Zheng 							struct acpi_buffer
8158b9c1152SLv Zheng 							*ret_buffer))
8168b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8178b9c1152SLv Zheng 			     acpi_resource_to_address64(struct acpi_resource
8188b9c1152SLv Zheng 							*resource,
8198b9c1152SLv Zheng 							struct
8208b9c1152SLv Zheng 							acpi_resource_address64
8218b9c1152SLv Zheng 							*out))
8228b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8230e243178SBob Moore 			     acpi_buffer_to_resource(u8 *aml_buffer,
8240e243178SBob Moore 						     u16 aml_buffer_length,
8258b9c1152SLv Zheng 						     struct acpi_resource
8268b9c1152SLv Zheng 						     **resource_ptr))
8270e243178SBob Moore 
8281da177e4SLinus Torvalds /*
8291da177e4SLinus Torvalds  * Hardware (ACPI device) interfaces
8301da177e4SLinus Torvalds  */
8318b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
832d3fd902dSBob Moore 
8338b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8348b9c1152SLv Zheng 			    acpi_read(u64 *value,
8358b9c1152SLv Zheng 				      struct acpi_generic_address *reg))
836739dcbb9SLv Zheng 
8378b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8388b9c1152SLv Zheng 			    acpi_write(u64 value,
8398b9c1152SLv Zheng 				       struct acpi_generic_address *reg))
840739dcbb9SLv Zheng 
84133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
84233620c54SBob Moore 				acpi_read_bit_register(u32 register_id,
84333620c54SBob Moore 						       u32 *return_value))
8444be44fcdSLen Brown 
84533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
84633620c54SBob Moore 				acpi_write_bit_register(u32 register_id,
84733620c54SBob Moore 							u32 value))
8481da177e4SLinus Torvalds 
84933620c54SBob Moore /*
85033620c54SBob Moore  * Sleep/Wake interfaces
85133620c54SBob Moore  */
8528b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8538b9c1152SLv Zheng 			    acpi_get_sleep_type_data(u8 sleep_state,
8548b9c1152SLv Zheng 						     u8 *slp_typ_a,
8558b9c1152SLv Zheng 						     u8 *slp_typ_b))
8561da177e4SLinus Torvalds 
8578b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8588b9c1152SLv Zheng 			    acpi_enter_sleep_state_prep(u8 sleep_state))
8598b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
8601da177e4SLinus Torvalds 
86140bce100SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
8621da177e4SLinus Torvalds 
8638b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8648b9c1152SLv Zheng 			    acpi_leave_sleep_state_prep(u8 sleep_state))
8658b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
8661da177e4SLinus Torvalds 
867739dcbb9SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
868e3e9b577SRafael J. Wysocki 				acpi_set_firmware_waking_vector
869aca2a5d3SLv Zheng 				(acpi_physical_address physical_address,
870aca2a5d3SLv Zheng 				 acpi_physical_address physical_address64))
87150df4d8bSBob Moore /*
872d08310feSBob Moore  * ACPI Timer interfaces
873d08310feSBob Moore  */
87433620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
87533620c54SBob Moore 				acpi_get_timer_resolution(u32 *resolution))
87633620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
877d08310feSBob Moore 
87833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
87933620c54SBob Moore 				acpi_get_timer_duration(u32 start_ticks,
88033620c54SBob Moore 							u32 end_ticks,
88133620c54SBob Moore 							u32 *time_elapsed))
882d08310feSBob Moore 
883d08310feSBob Moore /*
884b74be611SBob Moore  * Error/Warning output
88550df4d8bSBob Moore  */
886407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
88750df4d8bSBob Moore 			       void ACPI_INTERNAL_VAR_XFACE
888407e22afSLv Zheng 			       acpi_error(const char *module_name,
889407e22afSLv Zheng 					  u32 line_number,
890407e22afSLv Zheng 					  const char *format, ...))
891407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
89250df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
89350df4d8bSBob Moore 				acpi_exception(const char *module_name,
894407e22afSLv Zheng 					       u32 line_number,
895407e22afSLv Zheng 					       acpi_status status,
896407e22afSLv Zheng 					       const char *format, ...))
897407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
89850df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
899407e22afSLv Zheng 				acpi_warning(const char *module_name,
900407e22afSLv Zheng 					     u32 line_number,
901407e22afSLv Zheng 					     const char *format, ...))
90205fb04b5SBob Moore ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
90350df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
90405fb04b5SBob Moore 				acpi_info(const char *format, ...))
905407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
90662cdd141SBob Moore 				void ACPI_INTERNAL_VAR_XFACE
90762cdd141SBob Moore 				acpi_bios_error(const char *module_name,
908407e22afSLv Zheng 						u32 line_number,
909407e22afSLv Zheng 						const char *format, ...))
910f13c274dSBob Moore ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
911f13c274dSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
912f13c274dSBob Moore 				acpi_bios_exception(const char *module_name,
913f13c274dSBob Moore 						    u32 line_number,
914f13c274dSBob Moore 						    acpi_status status,
915f13c274dSBob Moore 						    const char *format, ...))
916407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
91762cdd141SBob Moore 				void ACPI_INTERNAL_VAR_XFACE
91862cdd141SBob Moore 				acpi_bios_warning(const char *module_name,
919407e22afSLv Zheng 						  u32 line_number,
920407e22afSLv Zheng 						  const char *format, ...))
92162cdd141SBob Moore 
922b74be611SBob Moore /*
923b74be611SBob Moore  * Debug output
924b74be611SBob Moore  */
9251ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
92650df4d8bSBob Moore 			       void ACPI_INTERNAL_VAR_XFACE
92750df4d8bSBob Moore 			       acpi_debug_print(u32 requested_debug_level,
92850df4d8bSBob Moore 						u32 line_number,
92950df4d8bSBob Moore 						const char *function_name,
93050df4d8bSBob Moore 						const char *module_name,
9311ce28c32SLv Zheng 						u32 component_id,
9321ce28c32SLv Zheng 						const char *format, ...))
9331ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
93450df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
93550df4d8bSBob Moore 				acpi_debug_print_raw(u32 requested_debug_level,
93650df4d8bSBob Moore 						     u32 line_number,
93750df4d8bSBob Moore 						     const char *function_name,
93850df4d8bSBob Moore 						     const char *module_name,
9391ce28c32SLv Zheng 						     u32 component_id,
9401ce28c32SLv Zheng 						     const char *format, ...))
941bab04824SLv Zheng 
942bab04824SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(void
943bab04824SLv Zheng 			       acpi_trace_point(acpi_trace_event_type type,
944bab04824SLv Zheng 						u8 begin,
945bab04824SLv Zheng 						u8 *aml, char *pathname))
946f5c1e1c5SLv Zheng 
947f8fb4c38SLv Zheng acpi_status acpi_initialize_debugger(void);
948f8fb4c38SLv Zheng 
949f8fb4c38SLv Zheng void acpi_terminate_debugger(void);
9500dedb3c4SLv Zheng 
9510dedb3c4SLv Zheng /*
9520dedb3c4SLv Zheng  * Divergences
9530dedb3c4SLv Zheng  */
954a8278efdSLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
955a8278efdSLv Zheng 			    acpi_get_data_full(acpi_handle object,
956a8278efdSLv Zheng 					       acpi_object_handler handler,
957a8278efdSLv Zheng 					       void **data,
958a8278efdSLv Zheng 					       void (*callback)(void *)))
95950df4d8bSBob Moore 
960f8d31489SLv Zheng void acpi_run_debugger(char *batch_buffer);
961f8d31489SLv Zheng 
962f988f24eSLv Zheng void acpi_set_debugger_thread_id(acpi_thread_id thread_id);
963f988f24eSLv Zheng 
9641da177e4SLinus Torvalds #endif				/* __ACXFACE_H__ */
965