xref: /openbmc/linux/include/acpi/acpixf.h (revision f8fb4c38)
11da177e4SLinus Torvalds /******************************************************************************
21da177e4SLinus Torvalds  *
31da177e4SLinus Torvalds  * Name: acpixf.h - External interfaces to the ACPI subsystem
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *****************************************************************************/
61da177e4SLinus Torvalds 
71da177e4SLinus Torvalds /*
882a80941SDavid E. Box  * Copyright (C) 2000 - 2015, Intel Corp.
91da177e4SLinus Torvalds  * All rights reserved.
101da177e4SLinus Torvalds  *
111da177e4SLinus Torvalds  * Redistribution and use in source and binary forms, with or without
121da177e4SLinus Torvalds  * modification, are permitted provided that the following conditions
131da177e4SLinus Torvalds  * are met:
141da177e4SLinus Torvalds  * 1. Redistributions of source code must retain the above copyright
151da177e4SLinus Torvalds  *    notice, this list of conditions, and the following disclaimer,
161da177e4SLinus Torvalds  *    without modification.
171da177e4SLinus Torvalds  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
181da177e4SLinus Torvalds  *    substantially similar to the "NO WARRANTY" disclaimer below
191da177e4SLinus Torvalds  *    ("Disclaimer") and any redistribution must be conditioned upon
201da177e4SLinus Torvalds  *    including a substantially similar Disclaimer requirement for further
211da177e4SLinus Torvalds  *    binary redistribution.
221da177e4SLinus Torvalds  * 3. Neither the names of the above-listed copyright holders nor the names
231da177e4SLinus Torvalds  *    of any contributors may be used to endorse or promote products derived
241da177e4SLinus Torvalds  *    from this software without specific prior written permission.
251da177e4SLinus Torvalds  *
261da177e4SLinus Torvalds  * Alternatively, this software may be distributed under the terms of the
271da177e4SLinus Torvalds  * GNU General Public License ("GPL") version 2 as published by the Free
281da177e4SLinus Torvalds  * Software Foundation.
291da177e4SLinus Torvalds  *
301da177e4SLinus Torvalds  * NO WARRANTY
311da177e4SLinus Torvalds  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
321da177e4SLinus Torvalds  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
331da177e4SLinus Torvalds  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
341da177e4SLinus Torvalds  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
351da177e4SLinus Torvalds  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
361da177e4SLinus Torvalds  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
371da177e4SLinus Torvalds  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
381da177e4SLinus Torvalds  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
391da177e4SLinus Torvalds  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
401da177e4SLinus Torvalds  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
411da177e4SLinus Torvalds  * POSSIBILITY OF SUCH DAMAGES.
421da177e4SLinus Torvalds  */
431da177e4SLinus Torvalds 
441da177e4SLinus Torvalds #ifndef __ACXFACE_H__
451da177e4SLinus Torvalds #define __ACXFACE_H__
461da177e4SLinus Torvalds 
4750df4d8bSBob Moore /* Current ACPICA subsystem version in YYYYMMDD format */
4850df4d8bSBob Moore 
4940913fe6SBob Moore #define ACPI_CA_VERSION                 0x20150717
5050df4d8bSBob Moore 
51a1ce3928SDavid Howells #include <acpi/acconfig.h>
52a1ce3928SDavid Howells #include <acpi/actypes.h>
53a1ce3928SDavid Howells #include <acpi/actbl.h>
54d8dc91b7SLinus Torvalds #include <acpi/acbuffer.h>
551da177e4SLinus Torvalds 
561011080dSBob Moore /*****************************************************************************
573035ff70SLv Zheng  *
581011080dSBob Moore  * Macros used for ACPICA globals and configuration
591011080dSBob Moore  *
601011080dSBob Moore  ****************************************************************************/
611011080dSBob Moore 
621da177e4SLinus Torvalds /*
631011080dSBob Moore  * Ensure that global variables are defined and initialized only once.
641011080dSBob Moore  *
651011080dSBob Moore  * The use of these macros allows for a single list of globals (here)
661011080dSBob Moore  * in order to simplify maintenance of the code.
6750df4d8bSBob Moore  */
683035ff70SLv Zheng #ifdef DEFINE_ACPI_GLOBALS
693035ff70SLv Zheng #define ACPI_GLOBAL(type,name) \
703035ff70SLv Zheng 	extern type name; \
713035ff70SLv Zheng 	type name
723e8214e5SLv Zheng 
733035ff70SLv Zheng #define ACPI_INIT_GLOBAL(type,name,value) \
743035ff70SLv Zheng 	type name=value
753e8214e5SLv Zheng 
763035ff70SLv Zheng #else
773035ff70SLv Zheng #ifndef ACPI_GLOBAL
783035ff70SLv Zheng #define ACPI_GLOBAL(type,name) \
793035ff70SLv Zheng 	extern type name
803035ff70SLv Zheng #endif
813e8214e5SLv Zheng 
823035ff70SLv Zheng #ifndef ACPI_INIT_GLOBAL
833035ff70SLv Zheng #define ACPI_INIT_GLOBAL(type,name,value) \
843035ff70SLv Zheng 	extern type name
853035ff70SLv Zheng #endif
863035ff70SLv Zheng #endif
8750df4d8bSBob Moore 
8833620c54SBob Moore /*
891011080dSBob Moore  * These macros configure the various ACPICA interfaces. They are
901011080dSBob Moore  * useful for generating stub inline functions for features that are
911011080dSBob Moore  * configured out of the current kernel or ACPICA application.
921011080dSBob Moore  */
938b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_STATUS
948b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
958b9c1152SLv Zheng 	prototype;
968b9c1152SLv Zheng #endif
978b9c1152SLv Zheng 
988b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_OK
998b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_OK(prototype) \
1008b9c1152SLv Zheng 	prototype;
1018b9c1152SLv Zheng #endif
1028b9c1152SLv Zheng 
1038b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_VOID
1048b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_VOID(prototype) \
1058b9c1152SLv Zheng 	prototype;
1068b9c1152SLv Zheng #endif
1078b9c1152SLv Zheng 
1088b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_UINT32
1098b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
1108b9c1152SLv Zheng 	prototype;
1118b9c1152SLv Zheng #endif
1128b9c1152SLv Zheng 
1138b9c1152SLv Zheng #ifndef ACPI_EXTERNAL_RETURN_PTR
1148b9c1152SLv Zheng #define ACPI_EXTERNAL_RETURN_PTR(prototype) \
1158b9c1152SLv Zheng 	prototype;
1168b9c1152SLv Zheng #endif
1178b9c1152SLv Zheng 
1183035ff70SLv Zheng /*****************************************************************************
1193035ff70SLv Zheng  *
1201011080dSBob Moore  * Public globals and runtime configuration options
1213035ff70SLv Zheng  *
1223035ff70SLv Zheng  ****************************************************************************/
1233035ff70SLv Zheng 
1243035ff70SLv Zheng /*
1251011080dSBob Moore  * Enable "slack mode" of the AML interpreter?  Default is FALSE, and the
1263035ff70SLv Zheng  * interpreter strictly follows the ACPI specification. Setting to TRUE
1273035ff70SLv Zheng  * allows the interpreter to ignore certain errors and/or bad AML constructs.
1283035ff70SLv Zheng  *
1293035ff70SLv Zheng  * Currently, these features are enabled by this flag:
1303035ff70SLv Zheng  *
1313035ff70SLv Zheng  * 1) Allow "implicit return" of last value in a control method
1323035ff70SLv Zheng  * 2) Allow access beyond the end of an operation region
1333035ff70SLv Zheng  * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
1343035ff70SLv Zheng  * 4) Allow ANY object type to be a source operand for the Store() operator
1353035ff70SLv Zheng  * 5) Allow unresolved references (invalid target name) in package objects
1363035ff70SLv Zheng  * 6) Enable warning messages for behavior that is not ACPI spec compliant
1373035ff70SLv Zheng  */
1383035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
1393035ff70SLv Zheng 
1403035ff70SLv Zheng /*
1413035ff70SLv Zheng  * Automatically serialize all methods that create named objects? Default
1423035ff70SLv Zheng  * is TRUE, meaning that all non_serialized methods are scanned once at
1433035ff70SLv Zheng  * table load time to determine those that create named objects. Methods
1443035ff70SLv Zheng  * that create named objects are marked Serialized in order to prevent
1453035ff70SLv Zheng  * possible run-time problems if they are entered by more than one thread.
1463035ff70SLv Zheng  */
1473035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
1483035ff70SLv Zheng 
1493035ff70SLv Zheng /*
1503035ff70SLv Zheng  * Create the predefined _OSI method in the namespace? Default is TRUE
1513035ff70SLv Zheng  * because ACPICA is fully compatible with other ACPI implementations.
1523035ff70SLv Zheng  * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
1533035ff70SLv Zheng  */
1543035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
1553035ff70SLv Zheng 
1563035ff70SLv Zheng /*
1573035ff70SLv Zheng  * Optionally use default values for the ACPI register widths. Set this to
1583035ff70SLv Zheng  * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
1593035ff70SLv Zheng  */
1603035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
1613035ff70SLv Zheng 
1623035ff70SLv Zheng /*
16347d68c7fSLv Zheng  * Whether or not to verify the table checksum before installation. Set
16447d68c7fSLv Zheng  * this to TRUE to verify the table checksum before install it to the table
16547d68c7fSLv Zheng  * manager. Note that enabling this option causes errors to happen in some
16647d68c7fSLv Zheng  * OSPMs during early initialization stages. Default behavior is to do such
16747d68c7fSLv Zheng  * verification.
16847d68c7fSLv Zheng  */
16947d68c7fSLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, TRUE);
17047d68c7fSLv Zheng 
17147d68c7fSLv Zheng /*
1723035ff70SLv Zheng  * Optionally enable output from the AML Debug Object.
1733035ff70SLv Zheng  */
1743035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
1753035ff70SLv Zheng 
1763035ff70SLv Zheng /*
1773035ff70SLv Zheng  * Optionally copy the entire DSDT to local memory (instead of simply
1783035ff70SLv Zheng  * mapping it.) There are some BIOSs that corrupt or replace the original
1793035ff70SLv Zheng  * DSDT, creating the need for this option. Default is FALSE, do not copy
1803035ff70SLv Zheng  * the DSDT.
1813035ff70SLv Zheng  */
1823035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
1833035ff70SLv Zheng 
1843035ff70SLv Zheng /*
1853035ff70SLv Zheng  * Optionally ignore an XSDT if present and use the RSDT instead.
1863035ff70SLv Zheng  * Although the ACPI specification requires that an XSDT be used instead
1873035ff70SLv Zheng  * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
1883035ff70SLv Zheng  * some machines. Default behavior is to use the XSDT if present.
1893035ff70SLv Zheng  */
1903035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
1913035ff70SLv Zheng 
1923035ff70SLv Zheng /*
1933035ff70SLv Zheng  * Optionally use 32-bit FADT addresses if and when there is a conflict
1943035ff70SLv Zheng  * (address mismatch) between the 32-bit and 64-bit versions of the
1953035ff70SLv Zheng  * address. Although ACPICA adheres to the ACPI specification which
1963035ff70SLv Zheng  * requires the use of the corresponding 64-bit address if it is non-zero,
1973035ff70SLv Zheng  * some machines have been found to have a corrupted non-zero 64-bit
1980ea61381SLv Zheng  * address. Default is FALSE, do not favor the 32-bit addresses.
1993035ff70SLv Zheng  */
2000ea61381SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
2013035ff70SLv Zheng 
2023035ff70SLv Zheng /*
203c04e1fb4SLv Zheng  * Optionally use 32-bit FACS table addresses.
204c04e1fb4SLv Zheng  * It is reported that some platforms fail to resume from system suspending
205c04e1fb4SLv Zheng  * if 64-bit FACS table address is selected:
206c04e1fb4SLv Zheng  * https://bugzilla.kernel.org/show_bug.cgi?id=74021
207c04e1fb4SLv Zheng  * Default is TRUE, favor the 32-bit addresses.
208c04e1fb4SLv Zheng  */
209c04e1fb4SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_facs_addresses, TRUE);
210c04e1fb4SLv Zheng 
211c04e1fb4SLv Zheng /*
2123035ff70SLv Zheng  * Optionally truncate I/O addresses to 16 bits. Provides compatibility
2133035ff70SLv Zheng  * with other ACPI implementations. NOTE: During ACPICA initialization,
2143035ff70SLv Zheng  * this value is set to TRUE if any Windows OSI strings have been
2153035ff70SLv Zheng  * requested by the BIOS.
2163035ff70SLv Zheng  */
2173035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
2183035ff70SLv Zheng 
2193035ff70SLv Zheng /*
2203035ff70SLv Zheng  * Disable runtime checking and repair of values returned by control methods.
2213035ff70SLv Zheng  * Use only if the repair is causing a problem on a particular machine.
2223035ff70SLv Zheng  */
2233035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
2243035ff70SLv Zheng 
2253035ff70SLv Zheng /*
2263035ff70SLv Zheng  * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
2273035ff70SLv Zheng  * This can be useful for debugging ACPI problems on some machines.
2283035ff70SLv Zheng  */
2293035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
2303035ff70SLv Zheng 
2313035ff70SLv Zheng /*
2328ea98655SBob Moore  * Optionally enable runtime namespace override.
2338ea98655SBob Moore  */
2348ea98655SBob Moore ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE);
2358ea98655SBob Moore 
2368ea98655SBob Moore /*
2373035ff70SLv Zheng  * We keep track of the latest version of Windows that has been requested by
2383035ff70SLv Zheng  * the BIOS. ACPI 5.0.
2393035ff70SLv Zheng  */
2403035ff70SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
2413035ff70SLv Zheng 
2423035ff70SLv Zheng /*
2433a2f3a33SLv Zheng  * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
2443a2f3a33SLv Zheng  * that the ACPI hardware is no longer required. A flag in the FADT indicates
2453a2f3a33SLv Zheng  * a reduced HW machine, and that flag is duplicated here for convenience.
2461da177e4SLinus Torvalds  */
2473a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
24850df4d8bSBob Moore 
2493a2f3a33SLv Zheng /*
2503a2f3a33SLv Zheng  * This mechanism is used to trace a specified AML method. The method is
2513a2f3a33SLv Zheng  * traced each time it is executed.
2523a2f3a33SLv Zheng  */
2533a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
254ab6c5733SLv Zheng ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL);
255ab6c5733SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT);
256ab6c5733SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
25750df4d8bSBob Moore 
2583a2f3a33SLv Zheng /*
2593a2f3a33SLv Zheng  * Runtime configuration of debug output control masks. We want the debug
2603a2f3a33SLv Zheng  * switches statically initialized so they are already set when the debugger
2613a2f3a33SLv Zheng  * is entered.
2623a2f3a33SLv Zheng  */
2633a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
2643a2f3a33SLv Zheng ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
26550df4d8bSBob Moore 
2663a2f3a33SLv Zheng /*
2671011080dSBob Moore  * Other miscellaneous globals
2683a2f3a33SLv Zheng  */
2693a2f3a33SLv Zheng ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
2701011080dSBob Moore ACPI_GLOBAL(u32, acpi_current_gpe_count);
2713a2f3a33SLv Zheng ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
27250df4d8bSBob Moore 
2731011080dSBob Moore /*****************************************************************************
2741011080dSBob Moore  *
2751011080dSBob Moore  * ACPICA public interface configuration.
2761011080dSBob Moore  *
2771011080dSBob Moore  * Interfaces that are configured out of the ACPICA build are replaced
2781011080dSBob Moore  * by inlined stubs by default.
2791011080dSBob Moore  *
2801011080dSBob Moore  ****************************************************************************/
2811011080dSBob Moore 
28233620c54SBob Moore /*
2831011080dSBob Moore  * Hardware-reduced prototypes (default: Not hardware reduced).
2841011080dSBob Moore  *
2851011080dSBob Moore  * All ACPICA hardware-related interfaces that use these macros will be
2861011080dSBob Moore  * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
28733620c54SBob Moore  * is set to TRUE.
2881011080dSBob Moore  *
2891011080dSBob Moore  * Note: This static build option for reduced hardware is intended to
2901011080dSBob Moore  * reduce ACPICA code size if desired or necessary. However, even if this
2911011080dSBob Moore  * option is not specified, the runtime behavior of ACPICA is dependent
2921011080dSBob Moore  * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
2931011080dSBob Moore  * the flag will enable similar behavior -- ACPICA will not attempt
2941011080dSBob Moore  * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
29533620c54SBob Moore  */
29633620c54SBob Moore #if (!ACPI_REDUCED_HARDWARE)
29733620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
2988b9c1152SLv Zheng 	ACPI_EXTERNAL_RETURN_STATUS(prototype)
29933620c54SBob Moore 
30033620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
3018b9c1152SLv Zheng 	ACPI_EXTERNAL_RETURN_OK(prototype)
30233620c54SBob Moore 
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 
31333620c54SBob Moore #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
314c26f3c90SBob Moore 	static ACPI_INLINE prototype {return;}
31533620c54SBob Moore 
31633620c54SBob Moore #endif				/* !ACPI_REDUCED_HARDWARE */
31733620c54SBob Moore 
31850df4d8bSBob Moore /*
3191011080dSBob Moore  * Error message prototypes (default: error messages enabled).
3201011080dSBob Moore  *
3211011080dSBob Moore  * All interfaces related to error and warning messages
3221011080dSBob Moore  * will be configured out of the ACPICA build if the
3231011080dSBob Moore  * ACPI_NO_ERROR_MESSAGE flag is defined.
324407e22afSLv Zheng  */
325407e22afSLv Zheng #ifndef ACPI_NO_ERROR_MESSAGES
326407e22afSLv Zheng #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
327407e22afSLv Zheng 	prototype;
328407e22afSLv Zheng 
329407e22afSLv Zheng #else
330407e22afSLv Zheng #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
331407e22afSLv Zheng 	static ACPI_INLINE prototype {return;}
332407e22afSLv Zheng 
333407e22afSLv Zheng #endif				/* ACPI_NO_ERROR_MESSAGES */
334407e22afSLv Zheng 
335407e22afSLv Zheng /*
3361011080dSBob Moore  * Debugging output prototypes (default: no debug output).
3371011080dSBob Moore  *
3381011080dSBob Moore  * All interfaces related to debug output messages
3391011080dSBob Moore  * will be configured out of the ACPICA build unless the
3401011080dSBob Moore  * ACPI_DEBUG_OUTPUT flag is defined.
3411ce28c32SLv Zheng  */
3421ce28c32SLv Zheng #ifdef ACPI_DEBUG_OUTPUT
3431ce28c32SLv Zheng #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
3441ce28c32SLv Zheng 	prototype;
3451ce28c32SLv Zheng 
3461ce28c32SLv Zheng #else
3471ce28c32SLv Zheng #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
3481ce28c32SLv Zheng 	static ACPI_INLINE prototype {return;}
3491ce28c32SLv Zheng 
3501ce28c32SLv Zheng #endif				/* ACPI_DEBUG_OUTPUT */
3511ce28c32SLv Zheng 
3522e70da4cSLv Zheng /*
3532e70da4cSLv Zheng  * Application prototypes
3542e70da4cSLv Zheng  *
3552e70da4cSLv Zheng  * All interfaces used by application will be configured
3562e70da4cSLv Zheng  * out of the ACPICA build unless the ACPI_APPLICATION
3572e70da4cSLv Zheng  * flag is defined.
3582e70da4cSLv Zheng  */
3592e70da4cSLv Zheng #ifdef ACPI_APPLICATION
3602e70da4cSLv Zheng #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
3612e70da4cSLv Zheng 	prototype;
3622e70da4cSLv Zheng 
3632e70da4cSLv Zheng #else
3642e70da4cSLv Zheng #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
3652e70da4cSLv Zheng 	static ACPI_INLINE prototype {return;}
3662e70da4cSLv Zheng 
3672e70da4cSLv Zheng #endif				/* ACPI_APPLICATION */
3682e70da4cSLv Zheng 
3691011080dSBob Moore /*****************************************************************************
3701011080dSBob Moore  *
3711011080dSBob Moore  * ACPICA public interface prototypes
3721011080dSBob Moore  *
3731011080dSBob Moore  ****************************************************************************/
3741011080dSBob Moore 
3751ce28c32SLv Zheng /*
37675c8044fSLv Zheng  * Initialization
3771da177e4SLinus Torvalds  */
3788b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
3798b9c1152SLv Zheng 			    acpi_initialize_tables(struct acpi_table_desc
3808b9c1152SLv Zheng 						   *initial_storage,
3818b9c1152SLv Zheng 						   u32 initial_table_count,
3828b9c1152SLv Zheng 						   u8 allow_resize))
3838b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void))
384f3d2e786SBob Moore 
3858b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags))
3861da177e4SLinus Torvalds 
3878b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
3888b9c1152SLv Zheng 			    acpi_initialize_objects(u32 flags))
3898b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void))
3901da177e4SLinus Torvalds 
39175c8044fSLv Zheng /*
39275c8044fSLv Zheng  * Miscellaneous global interfaces
39375c8044fSLv Zheng  */
39433620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
39533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
396739dcbb9SLv Zheng #ifdef ACPI_FUTURE_USAGE
3978b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
398739dcbb9SLv Zheng #endif
3991da177e4SLinus Torvalds 
4001da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE
4018b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4028b9c1152SLv Zheng 			    acpi_get_system_info(struct acpi_buffer
4038b9c1152SLv Zheng 						 *ret_buffer))
4041da177e4SLinus Torvalds #endif
4058b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4068b9c1152SLv Zheng 			     acpi_get_statistics(struct acpi_statistics *stats))
4078b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_PTR(const char
4088b9c1152SLv Zheng 			  *acpi_format_exception(acpi_status exception))
4098b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
4101da177e4SLinus Torvalds 
4118b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4128b9c1152SLv Zheng 			    acpi_install_interface(acpi_string interface_name))
4139187a415SLv Zheng 
4148b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4158b9c1152SLv Zheng 			    acpi_remove_interface(acpi_string interface_name))
4168b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
4171da177e4SLinus Torvalds 
4188b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_UINT32(u32
4198b9c1152SLv Zheng 			    acpi_check_address_range(acpi_adr_space_type
4208b9c1152SLv Zheng 						     space_id,
4218b9c1152SLv Zheng 						     acpi_physical_address
4228b9c1152SLv Zheng 						     address, acpi_size length,
4238b9c1152SLv Zheng 						     u8 warn))
4248b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
425be030a57SBob Moore 			     acpi_decode_pld_buffer(u8 *in_buffer,
4268b9c1152SLv Zheng 						    acpi_size length,
4278b9c1152SLv Zheng 						    struct acpi_pld_info
4288b9c1152SLv Zheng 						    **return_buffer))
429be030a57SBob Moore 
4301da177e4SLinus Torvalds /*
431f60d8181SBob Moore  * ACPI table load/unload interfaces
432f60d8181SBob Moore  */
4338b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
4348b9c1152SLv Zheng 			    acpi_install_table(acpi_physical_address address,
4358b9c1152SLv Zheng 					       u8 physical))
436f60d8181SBob Moore 
4378b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4388b9c1152SLv Zheng 			    acpi_load_table(struct acpi_table_header *table))
439f60d8181SBob Moore 
4408b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4418b9c1152SLv Zheng 			    acpi_unload_parent_table(acpi_handle object))
4428b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void))
443f60d8181SBob Moore 
444f60d8181SBob Moore /*
4451da177e4SLinus Torvalds  * ACPI table manipulation interfaces
4461da177e4SLinus Torvalds  */
4478b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void))
448f3d2e786SBob Moore 
4498b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
450f254e3c5SLv Zheng 			    acpi_find_root_pointer(acpi_physical_address *
451f254e3c5SLv Zheng 						   rsdp_address))
4528b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
453f3d2e786SBob Moore 			     acpi_get_table_header(acpi_string signature,
4548b9c1152SLv Zheng 						   u32 instance,
4558b9c1152SLv Zheng 						   struct acpi_table_header
4568b9c1152SLv Zheng 						   *out_table_header))
4578b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4588b9c1152SLv Zheng 			     acpi_get_table(acpi_string signature, u32 instance,
4598b9c1152SLv Zheng 					    struct acpi_table_header
4608b9c1152SLv Zheng 					    **out_table))
4618b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4628b9c1152SLv Zheng 			     acpi_get_table_by_index(u32 table_index,
4638b9c1152SLv Zheng 						     struct acpi_table_header
4648b9c1152SLv Zheng 						     **out_table))
4658b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4668b9c1152SLv Zheng 			     acpi_install_table_handler(acpi_table_handler
4678b9c1152SLv Zheng 							handler, void *context))
4688b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4698b9c1152SLv Zheng 			     acpi_remove_table_handler(acpi_table_handler
4708b9c1152SLv Zheng 						       handler))
4713e08e2d2SLin Ming 
4721da177e4SLinus Torvalds /*
4731da177e4SLinus Torvalds  * Namespace and name interfaces
4741da177e4SLinus Torvalds  */
4758b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4764be44fcdSLen Brown 			    acpi_walk_namespace(acpi_object_type type,
4771da177e4SLinus Torvalds 						acpi_handle start_object,
4781da177e4SLinus Torvalds 						u32 max_depth,
4798b9c1152SLv Zheng 						acpi_walk_callback
4808b9c1152SLv Zheng 						descending_callback,
4818b9c1152SLv Zheng 						acpi_walk_callback
4828b9c1152SLv Zheng 						ascending_callback,
4838b9c1152SLv Zheng 						void *context,
4848b9c1152SLv Zheng 						void **return_value))
4858b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
48670b30fb1SAl Viro 			     acpi_get_devices(const char *HID,
4871da177e4SLinus Torvalds 					      acpi_walk_callback user_function,
4888b9c1152SLv Zheng 					      void *context,
4898b9c1152SLv Zheng 					      void **return_value))
4908b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4918b9c1152SLv Zheng 			     acpi_get_name(acpi_handle object, u32 name_type,
4928b9c1152SLv Zheng 					   struct acpi_buffer *ret_path_ptr))
4938b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4944be44fcdSLen Brown 			     acpi_get_handle(acpi_handle parent,
4958b9c1152SLv Zheng 					     acpi_string pathname,
4968b9c1152SLv Zheng 					     acpi_handle * ret_handle))
4978b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
4988b9c1152SLv Zheng 			     acpi_attach_data(acpi_handle object,
4998b9c1152SLv Zheng 					      acpi_object_handler handler,
5008b9c1152SLv Zheng 					      void *data))
5018b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5028b9c1152SLv Zheng 			     acpi_detach_data(acpi_handle object,
5038b9c1152SLv Zheng 					      acpi_object_handler handler))
5048b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5058b9c1152SLv Zheng 			     acpi_get_data(acpi_handle object,
5068b9c1152SLv Zheng 					   acpi_object_handler handler,
5078b9c1152SLv Zheng 					   void **data))
5088b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
509ab6c5733SLv Zheng 			     acpi_debug_trace(const char *name, u32 debug_level,
5108b9c1152SLv Zheng 					      u32 debug_layer, u32 flags))
51150eca3ebSBob Moore 
5121da177e4SLinus Torvalds /*
5131da177e4SLinus Torvalds  * Object manipulation and enumeration
5141da177e4SLinus Torvalds  */
5158b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5164be44fcdSLen Brown 			    acpi_evaluate_object(acpi_handle object,
5171da177e4SLinus Torvalds 						 acpi_string pathname,
5188b9c1152SLv Zheng 						 struct acpi_object_list
5198b9c1152SLv Zheng 						 *parameter_objects,
5208b9c1152SLv Zheng 						 struct acpi_buffer
5218b9c1152SLv Zheng 						 *return_object_buffer))
5228b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5234be44fcdSLen Brown 			     acpi_evaluate_object_typed(acpi_handle object,
5241da177e4SLinus Torvalds 							acpi_string pathname,
5258b9c1152SLv Zheng 							struct acpi_object_list
5268b9c1152SLv Zheng 							*external_params,
5278b9c1152SLv Zheng 							struct acpi_buffer
5288b9c1152SLv Zheng 							*return_buffer,
5298b9c1152SLv Zheng 							acpi_object_type
5308b9c1152SLv Zheng 							return_type))
5318b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
532b47cf58eSBob Moore 			     acpi_get_object_info(acpi_handle object,
5338b9c1152SLv Zheng 						  struct acpi_device_info
5348b9c1152SLv Zheng 						  **return_buffer))
5358b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
5361da177e4SLinus Torvalds 
5378b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5384be44fcdSLen Brown 			    acpi_get_next_object(acpi_object_type type,
5391da177e4SLinus Torvalds 						 acpi_handle parent,
5408b9c1152SLv Zheng 						 acpi_handle child,
5418b9c1152SLv Zheng 						 acpi_handle * out_handle))
5421da177e4SLinus Torvalds 
5438b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5448b9c1152SLv Zheng 			    acpi_get_type(acpi_handle object,
5458b9c1152SLv Zheng 					  acpi_object_type * out_type))
5461da177e4SLinus Torvalds 
5478b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5488b9c1152SLv Zheng 			    acpi_get_parent(acpi_handle object,
5498b9c1152SLv Zheng 					    acpi_handle * out_handle))
5501da177e4SLinus Torvalds 
5511da177e4SLinus Torvalds /*
552ecfbbc7bSBob Moore  * Handler interfaces
5531da177e4SLinus Torvalds  */
5548b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
5558b9c1152SLv Zheng 			    acpi_install_initialization_handler
5568b9c1152SLv Zheng 			    (acpi_init_handler handler, u32 function))
55733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
558a2fd4b4bSLv Zheng 				 acpi_install_sci_handler(acpi_sci_handler
559a2fd4b4bSLv Zheng 							  address,
560a2fd4b4bSLv Zheng 							  void *context))
561a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
562a2fd4b4bSLv Zheng 				 acpi_remove_sci_handler(acpi_sci_handler
563a2fd4b4bSLv Zheng 							 address))
564a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
56533620c54SBob Moore 				 acpi_install_global_event_handler
566a2fd4b4bSLv Zheng 				 (acpi_gbl_event_handler handler,
567a2fd4b4bSLv Zheng 				  void *context))
56833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
56933620c54SBob Moore 				 acpi_install_fixed_event_handler(u32
57033620c54SBob Moore 								  acpi_event,
57133620c54SBob Moore 								  acpi_event_handler
57233620c54SBob Moore 								  handler,
57333620c54SBob Moore 								  void
57433620c54SBob Moore 								  *context))
57533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
57633620c54SBob Moore 				 acpi_remove_fixed_event_handler(u32 acpi_event,
57733620c54SBob Moore 								 acpi_event_handler
57833620c54SBob Moore 								 handler))
57933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
58033620c54SBob Moore 				 acpi_install_gpe_handler(acpi_handle
58133620c54SBob Moore 							  gpe_device,
58233620c54SBob Moore 							  u32 gpe_number,
58333620c54SBob Moore 							  u32 type,
58433620c54SBob Moore 							  acpi_gpe_handler
58533620c54SBob Moore 							  address,
58633620c54SBob Moore 							  void *context))
58733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
5880d0988afSLv Zheng 				 acpi_install_gpe_raw_handler(acpi_handle
5890d0988afSLv Zheng 							      gpe_device,
5900d0988afSLv Zheng 							      u32 gpe_number,
5910d0988afSLv Zheng 							      u32 type,
5920d0988afSLv Zheng 							      acpi_gpe_handler
5930d0988afSLv Zheng 							      address,
5940d0988afSLv Zheng 							      void *context))
5950d0988afSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
59633620c54SBob Moore 				 acpi_remove_gpe_handler(acpi_handle gpe_device,
59733620c54SBob Moore 							 u32 gpe_number,
59833620c54SBob Moore 							 acpi_gpe_handler
59933620c54SBob Moore 							 address))
6008b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6018b9c1152SLv Zheng 			     acpi_install_notify_handler(acpi_handle device,
6028b9c1152SLv Zheng 							 u32 handler_type,
6038b9c1152SLv Zheng 							 acpi_notify_handler
6048b9c1152SLv Zheng 							 handler,
6058b9c1152SLv Zheng 							 void *context))
6068b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6074be44fcdSLen Brown 			     acpi_remove_notify_handler(acpi_handle device,
6088b9c1152SLv Zheng 							u32 handler_type,
6098b9c1152SLv Zheng 							acpi_notify_handler
6108b9c1152SLv Zheng 							handler))
6118b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6128b9c1152SLv Zheng 			     acpi_install_address_space_handler(acpi_handle
6138b9c1152SLv Zheng 								device,
6148b9c1152SLv Zheng 								acpi_adr_space_type
6158b9c1152SLv Zheng 								space_id,
6168b9c1152SLv Zheng 								acpi_adr_space_handler
6178b9c1152SLv Zheng 								handler,
6188b9c1152SLv Zheng 								acpi_adr_space_setup
6198b9c1152SLv Zheng 								setup,
6208b9c1152SLv Zheng 								void *context))
6218b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6228b9c1152SLv Zheng 			     acpi_remove_address_space_handler(acpi_handle
6238b9c1152SLv Zheng 							       device,
6248b9c1152SLv Zheng 							       acpi_adr_space_type
6258b9c1152SLv Zheng 							       space_id,
6268b9c1152SLv Zheng 							       acpi_adr_space_handler
6278b9c1152SLv Zheng 							       handler))
6281da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE
6298b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6308b9c1152SLv Zheng 			     acpi_install_exception_handler
6318b9c1152SLv Zheng 			     (acpi_exception_handler handler))
6321da177e4SLinus Torvalds #endif
6338b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6348b9c1152SLv Zheng 			     acpi_install_interface_handler
6358b9c1152SLv Zheng 			     (acpi_interface_handler handler))
636b0ed7a91SLin Ming 
6371da177e4SLinus Torvalds /*
638ffef6827SLin Ming  * Global Lock interfaces
6391da177e4SLinus Torvalds  */
64033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
64133620c54SBob Moore 				acpi_acquire_global_lock(u16 timeout,
64233620c54SBob Moore 							 u32 *handle))
643cd27d79fSLv Zheng 
64433620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
64533620c54SBob Moore 				acpi_release_global_lock(u32 handle))
6461da177e4SLinus Torvalds 
647ffef6827SLin Ming /*
648ffef6827SLin Ming  * Interfaces to AML mutex objects
649ffef6827SLin Ming  */
6508b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6518b9c1152SLv Zheng 			    acpi_acquire_mutex(acpi_handle handle,
6528b9c1152SLv Zheng 					       acpi_string pathname,
6538b9c1152SLv Zheng 					       u16 timeout))
654ffef6827SLin Ming 
6558b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
6568b9c1152SLv Zheng 			    acpi_release_mutex(acpi_handle handle,
6578b9c1152SLv Zheng 					       acpi_string pathname))
658ffef6827SLin Ming 
659ffef6827SLin Ming /*
660ffef6827SLin Ming  * Fixed Event interfaces
661ffef6827SLin Ming  */
66233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
66333620c54SBob Moore 				acpi_enable_event(u32 event, u32 flags))
6641da177e4SLinus Torvalds 
66533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
66633620c54SBob Moore 				acpi_disable_event(u32 event, u32 flags))
66733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
6681da177e4SLinus Torvalds 
66933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
67033620c54SBob Moore 				acpi_get_event_status(u32 event,
67133620c54SBob Moore 						      acpi_event_status
67233620c54SBob Moore 						      *event_status))
673cd27d79fSLv Zheng 
67408ac07b8SBob Moore /*
675ffef6827SLin Ming  * General Purpose Event (GPE) Interfaces
67608ac07b8SBob Moore  */
67733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
6784be44fcdSLen Brown 
67933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
68033620c54SBob Moore 				acpi_enable_gpe(acpi_handle gpe_device,
68133620c54SBob Moore 						u32 gpe_number))
6824be44fcdSLen Brown 
68333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
68433620c54SBob Moore 				acpi_disable_gpe(acpi_handle gpe_device,
68533620c54SBob Moore 						 u32 gpe_number))
6861da177e4SLinus Torvalds 
68733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
68833620c54SBob Moore 				acpi_clear_gpe(acpi_handle gpe_device,
68933620c54SBob Moore 					       u32 gpe_number))
690bba63a29SLin Ming 
69133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
69233620c54SBob Moore 				acpi_set_gpe(acpi_handle gpe_device,
69333620c54SBob Moore 					     u32 gpe_number, u8 action))
694e8b6f970SRafael J. Wysocki 
69533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
69633620c54SBob Moore 				acpi_finish_gpe(acpi_handle gpe_device,
69733620c54SBob Moore 						u32 gpe_number))
69833620c54SBob Moore 
69933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
700c12f07d1SRafael J. Wysocki 				acpi_mark_gpe_for_wake(acpi_handle gpe_device,
701c12f07d1SRafael J. Wysocki 						       u32 gpe_number))
702c12f07d1SRafael J. Wysocki 
703c12f07d1SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
70433620c54SBob Moore 				acpi_setup_gpe_for_wake(acpi_handle
70533620c54SBob Moore 							parent_device,
70633620c54SBob Moore 							acpi_handle gpe_device,
70733620c54SBob Moore 							u32 gpe_number))
70833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
70933620c54SBob Moore 				 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
71033620c54SBob Moore 							u32 gpe_number,
71133620c54SBob Moore 							u8 action))
71233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
7134be44fcdSLen Brown 				 acpi_get_gpe_status(acpi_handle gpe_device,
71433620c54SBob Moore 						     u32 gpe_number,
71533620c54SBob Moore 						     acpi_event_status
71633620c54SBob Moore 						     *event_status))
71733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
71833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
719e0fa975dSRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
72008ac07b8SBob Moore 
72133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
72233620c54SBob Moore 				acpi_get_gpe_device(u32 gpe_index,
72333620c54SBob Moore 						    acpi_handle * gpe_device))
724e97d6bf1SBob Moore 
72533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
7264be44fcdSLen Brown 				acpi_install_gpe_block(acpi_handle gpe_device,
72733620c54SBob Moore 						       struct
72833620c54SBob Moore 						       acpi_generic_address
72933620c54SBob Moore 						       *gpe_block_address,
73033620c54SBob Moore 						       u32 register_count,
73133620c54SBob Moore 						       u32 interrupt_number))
73233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
73333620c54SBob Moore 				 acpi_remove_gpe_block(acpi_handle gpe_device))
734a2100801SRafael J. Wysocki 
7351da177e4SLinus Torvalds /*
7361da177e4SLinus Torvalds  * Resource interfaces
7371da177e4SLinus Torvalds  */
7381da177e4SLinus Torvalds typedef
73961686124SBob Moore acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
7401da177e4SLinus Torvalds 					   void *context);
7411da177e4SLinus Torvalds 
7428b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
743b47cf58eSBob Moore 			    acpi_get_vendor_resource(acpi_handle device,
744c51a4de8SBob Moore 						     char *name,
7458b9c1152SLv Zheng 						     struct acpi_vendor_uuid
7468b9c1152SLv Zheng 						     *uuid,
7478b9c1152SLv Zheng 						     struct acpi_buffer
7488b9c1152SLv Zheng 						     *ret_buffer))
7498b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7508b9c1152SLv Zheng 			     acpi_get_current_resources(acpi_handle device,
7518b9c1152SLv Zheng 							struct acpi_buffer
7528b9c1152SLv Zheng 							*ret_buffer))
7531da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE
7548b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7558b9c1152SLv Zheng 			     acpi_get_possible_resources(acpi_handle device,
7568b9c1152SLv Zheng 							 struct acpi_buffer
7578b9c1152SLv Zheng 							 *ret_buffer))
7581da177e4SLinus Torvalds #endif
7598b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
760a91cdde2SBob Moore 			     acpi_get_event_resources(acpi_handle device_handle,
7618b9c1152SLv Zheng 						      struct acpi_buffer
7628b9c1152SLv Zheng 						      *ret_buffer))
7638b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7648b9c1152SLv Zheng 			     acpi_walk_resource_buffer(struct acpi_buffer
7658b9c1152SLv Zheng 						       *buffer,
7668b9c1152SLv Zheng 						       acpi_walk_resource_callback
7678b9c1152SLv Zheng 						       user_function,
7688b9c1152SLv Zheng 						       void *context))
7698b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7708b9c1152SLv Zheng 			     acpi_walk_resources(acpi_handle device, char *name,
7718b9c1152SLv Zheng 						 acpi_walk_resource_callback
7728b9c1152SLv Zheng 						 user_function, void *context))
7738b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7748b9c1152SLv Zheng 			     acpi_set_current_resources(acpi_handle device,
7758b9c1152SLv Zheng 							struct acpi_buffer
7768b9c1152SLv Zheng 							*in_buffer))
7778b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7788b9c1152SLv Zheng 			     acpi_get_irq_routing_table(acpi_handle device,
7798b9c1152SLv Zheng 							struct acpi_buffer
7808b9c1152SLv Zheng 							*ret_buffer))
7818b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7828b9c1152SLv Zheng 			     acpi_resource_to_address64(struct acpi_resource
7838b9c1152SLv Zheng 							*resource,
7848b9c1152SLv Zheng 							struct
7858b9c1152SLv Zheng 							acpi_resource_address64
7868b9c1152SLv Zheng 							*out))
7878b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7880e243178SBob Moore 			     acpi_buffer_to_resource(u8 *aml_buffer,
7890e243178SBob Moore 						     u16 aml_buffer_length,
7908b9c1152SLv Zheng 						     struct acpi_resource
7918b9c1152SLv Zheng 						     **resource_ptr))
7920e243178SBob Moore 
7931da177e4SLinus Torvalds /*
7941da177e4SLinus Torvalds  * Hardware (ACPI device) interfaces
7951da177e4SLinus Torvalds  */
7968b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
797d3fd902dSBob Moore 
7988b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
7998b9c1152SLv Zheng 			    acpi_read(u64 *value,
8008b9c1152SLv Zheng 				      struct acpi_generic_address *reg))
801739dcbb9SLv Zheng 
8028b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8038b9c1152SLv Zheng 			    acpi_write(u64 value,
8048b9c1152SLv Zheng 				       struct acpi_generic_address *reg))
805739dcbb9SLv Zheng 
80633620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
80733620c54SBob Moore 				acpi_read_bit_register(u32 register_id,
80833620c54SBob Moore 						       u32 *return_value))
8094be44fcdSLen Brown 
81033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
81133620c54SBob Moore 				acpi_write_bit_register(u32 register_id,
81233620c54SBob Moore 							u32 value))
8131da177e4SLinus Torvalds 
81433620c54SBob Moore /*
81533620c54SBob Moore  * Sleep/Wake interfaces
81633620c54SBob Moore  */
8178b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8188b9c1152SLv Zheng 			    acpi_get_sleep_type_data(u8 sleep_state,
8198b9c1152SLv Zheng 						     u8 *slp_typ_a,
8208b9c1152SLv Zheng 						     u8 *slp_typ_b))
8211da177e4SLinus Torvalds 
8228b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8238b9c1152SLv Zheng 			    acpi_enter_sleep_state_prep(u8 sleep_state))
8248b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
8251da177e4SLinus Torvalds 
82640bce100SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
8271da177e4SLinus Torvalds 
8288b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
8298b9c1152SLv Zheng 			    acpi_leave_sleep_state_prep(u8 sleep_state))
8308b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
8311da177e4SLinus Torvalds 
832739dcbb9SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
833aca2a5d3SLv Zheng 				acpi_set_firmware_waking_vectors
834aca2a5d3SLv Zheng 				(acpi_physical_address physical_address,
835aca2a5d3SLv Zheng 				 acpi_physical_address physical_address64))
836aca2a5d3SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
837739dcbb9SLv Zheng 				 acpi_set_firmware_waking_vector(u32
838739dcbb9SLv Zheng 								 physical_address))
839739dcbb9SLv Zheng #if ACPI_MACHINE_WIDTH == 64
840739dcbb9SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
841739dcbb9SLv Zheng 				acpi_set_firmware_waking_vector64(u64
842739dcbb9SLv Zheng 								  physical_address))
843739dcbb9SLv Zheng #endif
84450df4d8bSBob Moore /*
845d08310feSBob Moore  * ACPI Timer interfaces
846d08310feSBob Moore  */
847d08310feSBob Moore #ifdef ACPI_FUTURE_USAGE
84833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
84933620c54SBob Moore 				acpi_get_timer_resolution(u32 *resolution))
85033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
851d08310feSBob Moore 
85233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
85333620c54SBob Moore 				acpi_get_timer_duration(u32 start_ticks,
85433620c54SBob Moore 							u32 end_ticks,
85533620c54SBob Moore 							u32 *time_elapsed))
856d08310feSBob Moore #endif				/* ACPI_FUTURE_USAGE */
857d08310feSBob Moore 
858d08310feSBob Moore /*
859b74be611SBob Moore  * Error/Warning output
86050df4d8bSBob Moore  */
861407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
86250df4d8bSBob Moore 			       void ACPI_INTERNAL_VAR_XFACE
863407e22afSLv Zheng 			       acpi_error(const char *module_name,
864407e22afSLv Zheng 					  u32 line_number,
865407e22afSLv Zheng 					  const char *format, ...))
866407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
86750df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
86850df4d8bSBob Moore 				acpi_exception(const char *module_name,
869407e22afSLv Zheng 					       u32 line_number,
870407e22afSLv Zheng 					       acpi_status status,
871407e22afSLv Zheng 					       const char *format, ...))
872407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
87350df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
874407e22afSLv Zheng 				acpi_warning(const char *module_name,
875407e22afSLv Zheng 					     u32 line_number,
876407e22afSLv Zheng 					     const char *format, ...))
877407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
87850df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
879407e22afSLv Zheng 				acpi_info(const char *module_name,
880407e22afSLv Zheng 					  u32 line_number,
881407e22afSLv Zheng 					  const char *format, ...))
882407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
88362cdd141SBob Moore 				void ACPI_INTERNAL_VAR_XFACE
88462cdd141SBob Moore 				acpi_bios_error(const char *module_name,
885407e22afSLv Zheng 						u32 line_number,
886407e22afSLv Zheng 						const char *format, ...))
887407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
88862cdd141SBob Moore 				void ACPI_INTERNAL_VAR_XFACE
88962cdd141SBob Moore 				acpi_bios_warning(const char *module_name,
890407e22afSLv Zheng 						  u32 line_number,
891407e22afSLv Zheng 						  const char *format, ...))
89262cdd141SBob Moore 
893b74be611SBob Moore /*
894b74be611SBob Moore  * Debug output
895b74be611SBob Moore  */
8961ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
89750df4d8bSBob Moore 			       void ACPI_INTERNAL_VAR_XFACE
89850df4d8bSBob Moore 			       acpi_debug_print(u32 requested_debug_level,
89950df4d8bSBob Moore 						u32 line_number,
90050df4d8bSBob Moore 						const char *function_name,
90150df4d8bSBob Moore 						const char *module_name,
9021ce28c32SLv Zheng 						u32 component_id,
9031ce28c32SLv Zheng 						const char *format, ...))
9041ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
90550df4d8bSBob Moore 				void ACPI_INTERNAL_VAR_XFACE
90650df4d8bSBob Moore 				acpi_debug_print_raw(u32 requested_debug_level,
90750df4d8bSBob Moore 						     u32 line_number,
90850df4d8bSBob Moore 						     const char *function_name,
90950df4d8bSBob Moore 						     const char *module_name,
9101ce28c32SLv Zheng 						     u32 component_id,
9111ce28c32SLv Zheng 						     const char *format, ...))
912bab04824SLv Zheng 
913bab04824SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(void
914bab04824SLv Zheng 			       acpi_trace_point(acpi_trace_event_type type,
915bab04824SLv Zheng 						u8 begin,
916bab04824SLv Zheng 						u8 *aml, char *pathname))
9172e70da4cSLv Zheng ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
9182e70da4cSLv Zheng 				void ACPI_INTERNAL_VAR_XFACE
9192e70da4cSLv Zheng 				acpi_log_error(const char *format, ...))
920f8fb4c38SLv Zheng  acpi_status acpi_initialize_debugger(void);
921f8fb4c38SLv Zheng 
922f8fb4c38SLv Zheng void acpi_terminate_debugger(void);
9230dedb3c4SLv Zheng 
9240dedb3c4SLv Zheng /*
9250dedb3c4SLv Zheng  * Divergences
9260dedb3c4SLv Zheng  */
927a8278efdSLv Zheng ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap);
9280dedb3c4SLv Zheng 
929a8278efdSLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
9300dedb3c4SLv Zheng 			    acpi_get_table_with_size(acpi_string signature,
931a8278efdSLv Zheng 						     u32 instance,
932a8278efdSLv Zheng 						     struct acpi_table_header
933a8278efdSLv Zheng 						     **out_table,
934a8278efdSLv Zheng 						     acpi_size *tbl_size))
9350dedb3c4SLv Zheng 
936a8278efdSLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status
937a8278efdSLv Zheng 			    acpi_get_data_full(acpi_handle object,
938a8278efdSLv Zheng 					       acpi_object_handler handler,
939a8278efdSLv Zheng 					       void **data,
940a8278efdSLv Zheng 					       void (*callback)(void *)))
94150df4d8bSBob Moore 
9421da177e4SLinus Torvalds #endif				/* __ACXFACE_H__ */
943