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 * 6612c2932SBob Moore * Copyright (C) 2000 - 2023, 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 15f3b091a9SBob Moore #define ACPI_CA_VERSION 0x20230628 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 4575d6e5966SJessica Clarke acpi_install_table(struct acpi_table_header *table)) 458f60d8181SBob Moore 4595d6e5966SJessica Clarke ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 4605d6e5966SJessica Clarke acpi_install_physical_table(acpi_physical_address 4615d6e5966SJessica Clarke address)) 4628b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 4631770093cSNikolaus Voss acpi_load_table(struct acpi_table_header *table, 4641770093cSNikolaus Voss u32 *table_idx)) 465f60d8181SBob Moore 4668b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 46742d939faSBob Moore acpi_unload_table(u32 table_index)) 46842d939faSBob Moore 46942d939faSBob Moore ACPI_EXTERNAL_RETURN_STATUS(acpi_status 4708b9c1152SLv Zheng acpi_unload_parent_table(acpi_handle object)) 4712368b1a1SLv Zheng 4722368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 4732368b1a1SLv Zheng acpi_load_tables(void)) 474f60d8181SBob Moore 475f60d8181SBob Moore /* 4761da177e4SLinus Torvalds * ACPI table manipulation interfaces 4771da177e4SLinus Torvalds */ 4782368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 4792368b1a1SLv Zheng acpi_reallocate_root_table(void)) 480f3d2e786SBob Moore 4812368b1a1SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 482f5c1e1c5SLv Zheng acpi_find_root_pointer(acpi_physical_address 483f5c1e1c5SLv Zheng *rsdp_address)) 4848b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 485f3d2e786SBob Moore acpi_get_table_header(acpi_string signature, 4868b9c1152SLv Zheng u32 instance, 4878b9c1152SLv Zheng struct acpi_table_header 4888b9c1152SLv Zheng *out_table_header)) 4898b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 4908b9c1152SLv Zheng acpi_get_table(acpi_string signature, u32 instance, 4918b9c1152SLv Zheng struct acpi_table_header 4928b9c1152SLv Zheng **out_table)) 493174cc718SLv Zheng ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table)) 494174cc718SLv Zheng 4958b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 4968b9c1152SLv Zheng acpi_get_table_by_index(u32 table_index, 4978b9c1152SLv Zheng struct acpi_table_header 4988b9c1152SLv Zheng **out_table)) 4998b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5008b9c1152SLv Zheng acpi_install_table_handler(acpi_table_handler 5018b9c1152SLv Zheng handler, void *context)) 5028b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5038b9c1152SLv Zheng acpi_remove_table_handler(acpi_table_handler 5048b9c1152SLv Zheng handler)) 5053e08e2d2SLin Ming 5061da177e4SLinus Torvalds /* 5071da177e4SLinus Torvalds * Namespace and name interfaces 5081da177e4SLinus Torvalds */ 5098b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5104be44fcdSLen Brown acpi_walk_namespace(acpi_object_type type, 5111da177e4SLinus Torvalds acpi_handle start_object, 5121da177e4SLinus Torvalds u32 max_depth, 5138b9c1152SLv Zheng acpi_walk_callback 5148b9c1152SLv Zheng descending_callback, 5158b9c1152SLv Zheng acpi_walk_callback 5168b9c1152SLv Zheng ascending_callback, 5178b9c1152SLv Zheng void *context, 5188b9c1152SLv Zheng void **return_value)) 5198b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 52070b30fb1SAl Viro acpi_get_devices(const char *HID, 5211da177e4SLinus Torvalds acpi_walk_callback user_function, 5228b9c1152SLv Zheng void *context, 5238b9c1152SLv Zheng void **return_value)) 5248b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5258b9c1152SLv Zheng acpi_get_name(acpi_handle object, u32 name_type, 5268b9c1152SLv Zheng struct acpi_buffer *ret_path_ptr)) 5278b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5284be44fcdSLen Brown acpi_get_handle(acpi_handle parent, 52991fdb91cSSakari Ailus const char *pathname, 5308b9c1152SLv Zheng acpi_handle *ret_handle)) 5318b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5328b9c1152SLv Zheng acpi_attach_data(acpi_handle object, 5338b9c1152SLv Zheng acpi_object_handler handler, 5348b9c1152SLv Zheng void *data)) 5358b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5368b9c1152SLv Zheng acpi_detach_data(acpi_handle object, 5378b9c1152SLv Zheng acpi_object_handler handler)) 5388b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5398b9c1152SLv Zheng acpi_get_data(acpi_handle object, 5408b9c1152SLv Zheng acpi_object_handler handler, 5418b9c1152SLv Zheng void **data)) 5428b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 543ab6c5733SLv Zheng acpi_debug_trace(const char *name, u32 debug_level, 5448b9c1152SLv Zheng u32 debug_layer, u32 flags)) 54550eca3ebSBob Moore 5461da177e4SLinus Torvalds /* 5471da177e4SLinus Torvalds * Object manipulation and enumeration 5481da177e4SLinus Torvalds */ 5498b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5504be44fcdSLen Brown acpi_evaluate_object(acpi_handle object, 5511da177e4SLinus Torvalds acpi_string pathname, 5528b9c1152SLv Zheng struct acpi_object_list 5538b9c1152SLv Zheng *parameter_objects, 5548b9c1152SLv Zheng struct acpi_buffer 5558b9c1152SLv Zheng *return_object_buffer)) 5568b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5574be44fcdSLen Brown acpi_evaluate_object_typed(acpi_handle object, 5581da177e4SLinus Torvalds acpi_string pathname, 5598b9c1152SLv Zheng struct acpi_object_list 5608b9c1152SLv Zheng *external_params, 5618b9c1152SLv Zheng struct acpi_buffer 5628b9c1152SLv Zheng *return_buffer, 5638b9c1152SLv Zheng acpi_object_type 5648b9c1152SLv Zheng return_type)) 5658b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 566b47cf58eSBob Moore acpi_get_object_info(acpi_handle object, 5678b9c1152SLv Zheng struct acpi_device_info 5688b9c1152SLv Zheng **return_buffer)) 5698b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer)) 5701da177e4SLinus Torvalds 5718b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5724be44fcdSLen Brown acpi_get_next_object(acpi_object_type type, 5731da177e4SLinus Torvalds acpi_handle parent, 5748b9c1152SLv Zheng acpi_handle child, 5758b9c1152SLv Zheng acpi_handle *out_handle)) 5761da177e4SLinus Torvalds 5778b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5788b9c1152SLv Zheng acpi_get_type(acpi_handle object, 5798b9c1152SLv Zheng acpi_object_type *out_type)) 5801da177e4SLinus Torvalds 5818b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5828b9c1152SLv Zheng acpi_get_parent(acpi_handle object, 5838b9c1152SLv Zheng acpi_handle *out_handle)) 5841da177e4SLinus Torvalds 5851da177e4SLinus Torvalds /* 586ecfbbc7bSBob Moore * Handler interfaces 5871da177e4SLinus Torvalds */ 5888b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 5898b9c1152SLv Zheng acpi_install_initialization_handler 5908b9c1152SLv Zheng (acpi_init_handler handler, u32 function)) 59133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 592a2fd4b4bSLv Zheng acpi_install_sci_handler(acpi_sci_handler 593a2fd4b4bSLv Zheng address, 594a2fd4b4bSLv Zheng void *context)) 595a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 596a2fd4b4bSLv Zheng acpi_remove_sci_handler(acpi_sci_handler 597a2fd4b4bSLv Zheng address)) 598a2fd4b4bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 59933620c54SBob Moore acpi_install_global_event_handler 600a2fd4b4bSLv Zheng (acpi_gbl_event_handler handler, 601a2fd4b4bSLv Zheng void *context)) 60233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 60333620c54SBob Moore acpi_install_fixed_event_handler(u32 60433620c54SBob Moore acpi_event, 60533620c54SBob Moore acpi_event_handler 60633620c54SBob Moore handler, 60733620c54SBob Moore void 60833620c54SBob Moore *context)) 60933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 61033620c54SBob Moore acpi_remove_fixed_event_handler(u32 acpi_event, 61133620c54SBob Moore acpi_event_handler 61233620c54SBob Moore handler)) 61333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 61433620c54SBob Moore acpi_install_gpe_handler(acpi_handle 61533620c54SBob Moore gpe_device, 61633620c54SBob Moore u32 gpe_number, 61733620c54SBob Moore u32 type, 61833620c54SBob Moore acpi_gpe_handler 61933620c54SBob Moore address, 62033620c54SBob Moore void *context)) 62133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 6220d0988afSLv Zheng acpi_install_gpe_raw_handler(acpi_handle 6230d0988afSLv Zheng gpe_device, 6240d0988afSLv Zheng u32 gpe_number, 6250d0988afSLv Zheng u32 type, 6260d0988afSLv Zheng acpi_gpe_handler 6270d0988afSLv Zheng address, 6280d0988afSLv Zheng void *context)) 6290d0988afSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 63033620c54SBob Moore acpi_remove_gpe_handler(acpi_handle gpe_device, 63133620c54SBob Moore u32 gpe_number, 63233620c54SBob Moore acpi_gpe_handler 63333620c54SBob Moore address)) 6348b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6358b9c1152SLv Zheng acpi_install_notify_handler(acpi_handle device, 6368b9c1152SLv Zheng u32 handler_type, 6378b9c1152SLv Zheng acpi_notify_handler 6388b9c1152SLv Zheng handler, 6398b9c1152SLv Zheng void *context)) 6408b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6414be44fcdSLen Brown acpi_remove_notify_handler(acpi_handle device, 6428b9c1152SLv Zheng u32 handler_type, 6438b9c1152SLv Zheng acpi_notify_handler 6448b9c1152SLv Zheng handler)) 6458b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6468b9c1152SLv Zheng acpi_install_address_space_handler(acpi_handle 6478b9c1152SLv Zheng device, 6488b9c1152SLv Zheng acpi_adr_space_type 6498b9c1152SLv Zheng space_id, 6508b9c1152SLv Zheng acpi_adr_space_handler 6518b9c1152SLv Zheng handler, 6528b9c1152SLv Zheng acpi_adr_space_setup 6538b9c1152SLv Zheng setup, 6548b9c1152SLv Zheng void *context)) 6558b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 65654c516aeSHans de Goede acpi_install_address_space_handler_no_reg 65754c516aeSHans de Goede (acpi_handle device, acpi_adr_space_type space_id, 65854c516aeSHans de Goede acpi_adr_space_handler handler, 65954c516aeSHans de Goede acpi_adr_space_setup setup, 66054c516aeSHans de Goede void *context)) 66154c516aeSHans de Goede ACPI_EXTERNAL_RETURN_STATUS(acpi_status 66254c516aeSHans de Goede acpi_execute_reg_methods(acpi_handle device, 66354c516aeSHans de Goede acpi_adr_space_type 66454c516aeSHans de Goede space_id)) 66554c516aeSHans de Goede ACPI_EXTERNAL_RETURN_STATUS(acpi_status 666*17095b1dSRafael J. Wysocki acpi_execute_orphan_reg_method(acpi_handle device, 667*17095b1dSRafael J. Wysocki acpi_adr_space_type 668*17095b1dSRafael J. Wysocki space_id)) 669*17095b1dSRafael J. Wysocki ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6708b9c1152SLv Zheng acpi_remove_address_space_handler(acpi_handle 6718b9c1152SLv Zheng device, 6728b9c1152SLv Zheng acpi_adr_space_type 6738b9c1152SLv Zheng space_id, 6748b9c1152SLv Zheng acpi_adr_space_handler 6758b9c1152SLv Zheng handler)) 6768b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6778b9c1152SLv Zheng acpi_install_exception_handler 6788b9c1152SLv Zheng (acpi_exception_handler handler)) 6798b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6808b9c1152SLv Zheng acpi_install_interface_handler 6818b9c1152SLv Zheng (acpi_interface_handler handler)) 682b0ed7a91SLin Ming 6831da177e4SLinus Torvalds /* 684ffef6827SLin Ming * Global Lock interfaces 6851da177e4SLinus Torvalds */ 68633620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 68733620c54SBob Moore acpi_acquire_global_lock(u16 timeout, 68833620c54SBob Moore u32 *handle)) 689cd27d79fSLv Zheng 69033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 69133620c54SBob Moore acpi_release_global_lock(u32 handle)) 6921da177e4SLinus Torvalds 693ffef6827SLin Ming /* 694ffef6827SLin Ming * Interfaces to AML mutex objects 695ffef6827SLin Ming */ 6968b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 6978b9c1152SLv Zheng acpi_acquire_mutex(acpi_handle handle, 6988b9c1152SLv Zheng acpi_string pathname, 6998b9c1152SLv Zheng u16 timeout)) 700ffef6827SLin Ming 7018b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 7028b9c1152SLv Zheng acpi_release_mutex(acpi_handle handle, 7038b9c1152SLv Zheng acpi_string pathname)) 704ffef6827SLin Ming 705ffef6827SLin Ming /* 706ffef6827SLin Ming * Fixed Event interfaces 707ffef6827SLin Ming */ 70833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 70933620c54SBob Moore acpi_enable_event(u32 event, u32 flags)) 7101da177e4SLinus Torvalds 71133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 71233620c54SBob Moore acpi_disable_event(u32 event, u32 flags)) 71333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) 7141da177e4SLinus Torvalds 71533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 71633620c54SBob Moore acpi_get_event_status(u32 event, 71733620c54SBob Moore acpi_event_status 71833620c54SBob Moore *event_status)) 719cd27d79fSLv Zheng 72008ac07b8SBob Moore /* 721ffef6827SLin Ming * General Purpose Event (GPE) Interfaces 72208ac07b8SBob Moore */ 72333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) 7244be44fcdSLen Brown 72533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 72633620c54SBob Moore acpi_enable_gpe(acpi_handle gpe_device, 72733620c54SBob Moore u32 gpe_number)) 7284be44fcdSLen Brown 72933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 73033620c54SBob Moore acpi_disable_gpe(acpi_handle gpe_device, 73133620c54SBob Moore u32 gpe_number)) 7321da177e4SLinus Torvalds 73333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 73433620c54SBob Moore acpi_clear_gpe(acpi_handle gpe_device, 73533620c54SBob Moore u32 gpe_number)) 736bba63a29SLin Ming 73733620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 73833620c54SBob Moore acpi_set_gpe(acpi_handle gpe_device, 73933620c54SBob Moore u32 gpe_number, u8 action)) 740e8b6f970SRafael J. Wysocki 74133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 74233620c54SBob Moore acpi_finish_gpe(acpi_handle gpe_device, 74333620c54SBob Moore u32 gpe_number)) 74433620c54SBob Moore 74533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 7462af52c2bSLv Zheng acpi_mask_gpe(acpi_handle gpe_device, 7472af52c2bSLv Zheng u32 gpe_number, u8 is_masked)) 7482af52c2bSLv Zheng 7492af52c2bSLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 750c12f07d1SRafael J. Wysocki acpi_mark_gpe_for_wake(acpi_handle gpe_device, 751c12f07d1SRafael J. Wysocki u32 gpe_number)) 752c12f07d1SRafael J. Wysocki 753c12f07d1SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 75433620c54SBob Moore acpi_setup_gpe_for_wake(acpi_handle 75533620c54SBob Moore parent_device, 75633620c54SBob Moore acpi_handle gpe_device, 75733620c54SBob Moore u32 gpe_number)) 75833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 75933620c54SBob Moore acpi_set_gpe_wake_mask(acpi_handle gpe_device, 76033620c54SBob Moore u32 gpe_number, 76133620c54SBob Moore u8 action)) 76233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 7634be44fcdSLen Brown acpi_get_gpe_status(acpi_handle gpe_device, 76433620c54SBob Moore u32 gpe_number, 76533620c54SBob Moore acpi_event_status 76633620c54SBob Moore *event_status)) 7676921de89SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number)) 76822db0633SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_hw_disable_all_gpes(void)) 76933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) 77033620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) 771e0fa975dSRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void)) 7720ce792d6SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_gpe_status_set(u32 gpe_skip_number)) 77363fb9623SRafael J. Wysocki ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_fixed_event_status_set(void)) 77408ac07b8SBob Moore 77533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 77633620c54SBob Moore acpi_get_gpe_device(u32 gpe_index, 77733620c54SBob Moore acpi_handle *gpe_device)) 778e97d6bf1SBob Moore 77933620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 7804be44fcdSLen Brown acpi_install_gpe_block(acpi_handle gpe_device, 78133620c54SBob Moore struct 78233620c54SBob Moore acpi_generic_address 78333620c54SBob Moore *gpe_block_address, 78433620c54SBob Moore u32 register_count, 78533620c54SBob Moore u32 interrupt_number)) 78633620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 78733620c54SBob Moore acpi_remove_gpe_block(acpi_handle gpe_device)) 788a2100801SRafael J. Wysocki 7891da177e4SLinus Torvalds /* 7901da177e4SLinus Torvalds * Resource interfaces 7911da177e4SLinus Torvalds */ 7921da177e4SLinus Torvalds typedef 79361686124SBob Moore acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource, 7941da177e4SLinus Torvalds void *context); 7951da177e4SLinus Torvalds 7968b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 797b47cf58eSBob Moore acpi_get_vendor_resource(acpi_handle device, 798c51a4de8SBob Moore char *name, 7998b9c1152SLv Zheng struct acpi_vendor_uuid 8008b9c1152SLv Zheng *uuid, 8018b9c1152SLv Zheng struct acpi_buffer 8028b9c1152SLv Zheng *ret_buffer)) 8038b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8048b9c1152SLv Zheng acpi_get_current_resources(acpi_handle device, 8058b9c1152SLv Zheng struct acpi_buffer 8068b9c1152SLv Zheng *ret_buffer)) 8078b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8088b9c1152SLv Zheng acpi_get_possible_resources(acpi_handle device, 8098b9c1152SLv Zheng struct acpi_buffer 8108b9c1152SLv Zheng *ret_buffer)) 8118b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 812a91cdde2SBob Moore acpi_get_event_resources(acpi_handle device_handle, 8138b9c1152SLv Zheng struct acpi_buffer 8148b9c1152SLv Zheng *ret_buffer)) 8158b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8168b9c1152SLv Zheng acpi_walk_resource_buffer(struct acpi_buffer 8178b9c1152SLv Zheng *buffer, 8188b9c1152SLv Zheng acpi_walk_resource_callback 8198b9c1152SLv Zheng user_function, 8208b9c1152SLv Zheng void *context)) 8218b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8228b9c1152SLv Zheng acpi_walk_resources(acpi_handle device, char *name, 8238b9c1152SLv Zheng acpi_walk_resource_callback 8248b9c1152SLv Zheng user_function, void *context)) 8258b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8268b9c1152SLv Zheng acpi_set_current_resources(acpi_handle device, 8278b9c1152SLv Zheng struct acpi_buffer 8288b9c1152SLv Zheng *in_buffer)) 8298b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8308b9c1152SLv Zheng acpi_get_irq_routing_table(acpi_handle device, 8318b9c1152SLv Zheng struct acpi_buffer 8328b9c1152SLv Zheng *ret_buffer)) 8338b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8348b9c1152SLv Zheng acpi_resource_to_address64(struct acpi_resource 8358b9c1152SLv Zheng *resource, 8368b9c1152SLv Zheng struct 8378b9c1152SLv Zheng acpi_resource_address64 8388b9c1152SLv Zheng *out)) 8398b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8400e243178SBob Moore acpi_buffer_to_resource(u8 *aml_buffer, 8410e243178SBob Moore u16 aml_buffer_length, 8428b9c1152SLv Zheng struct acpi_resource 8438b9c1152SLv Zheng **resource_ptr)) 8440e243178SBob Moore 8451da177e4SLinus Torvalds /* 8461da177e4SLinus Torvalds * Hardware (ACPI device) interfaces 8471da177e4SLinus Torvalds */ 8488b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void)) 849d3fd902dSBob Moore 8508b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8518b9c1152SLv Zheng acpi_read(u64 *value, 8528b9c1152SLv Zheng struct acpi_generic_address *reg)) 853739dcbb9SLv Zheng 8548b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8558b9c1152SLv Zheng acpi_write(u64 value, 8568b9c1152SLv Zheng struct acpi_generic_address *reg)) 857739dcbb9SLv Zheng 85833620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 85933620c54SBob Moore acpi_read_bit_register(u32 register_id, 86033620c54SBob Moore u32 *return_value)) 8614be44fcdSLen Brown 86233620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 86333620c54SBob Moore acpi_write_bit_register(u32 register_id, 86433620c54SBob Moore u32 value)) 8651da177e4SLinus Torvalds 86633620c54SBob Moore /* 86733620c54SBob Moore * Sleep/Wake interfaces 86833620c54SBob Moore */ 8698b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8708b9c1152SLv Zheng acpi_get_sleep_type_data(u8 sleep_state, 8718b9c1152SLv Zheng u8 *slp_typ_a, 8728b9c1152SLv Zheng u8 *slp_typ_b)) 8731da177e4SLinus Torvalds 8748b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8758b9c1152SLv Zheng acpi_enter_sleep_state_prep(u8 sleep_state)) 8768b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state)) 8771da177e4SLinus Torvalds 87840bce100SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void)) 8791da177e4SLinus Torvalds 8808b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 8818b9c1152SLv Zheng acpi_leave_sleep_state_prep(u8 sleep_state)) 8828b9c1152SLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) 8831da177e4SLinus Torvalds 884739dcbb9SLv Zheng ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 885e3e9b577SRafael J. Wysocki acpi_set_firmware_waking_vector 886aca2a5d3SLv Zheng (acpi_physical_address physical_address, 887aca2a5d3SLv Zheng acpi_physical_address physical_address64)) 88850df4d8bSBob Moore /* 889d08310feSBob Moore * ACPI Timer interfaces 890d08310feSBob Moore */ 89133620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 89233620c54SBob Moore acpi_get_timer_resolution(u32 *resolution)) 89333620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) 894d08310feSBob Moore 89533620c54SBob Moore ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 89633620c54SBob Moore acpi_get_timer_duration(u32 start_ticks, 89733620c54SBob Moore u32 end_ticks, 89833620c54SBob Moore u32 *time_elapsed)) 899d08310feSBob Moore 900d08310feSBob Moore /* 901b74be611SBob Moore * Error/Warning output 90250df4d8bSBob Moore */ 903407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 90450df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 905407e22afSLv Zheng acpi_error(const char *module_name, 906407e22afSLv Zheng u32 line_number, 907407e22afSLv Zheng const char *format, ...)) 908407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4) 90950df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 91050df4d8bSBob Moore acpi_exception(const char *module_name, 911407e22afSLv Zheng u32 line_number, 912407e22afSLv Zheng acpi_status status, 913407e22afSLv Zheng const char *format, ...)) 914407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 91550df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 916407e22afSLv Zheng acpi_warning(const char *module_name, 917407e22afSLv Zheng u32 line_number, 918407e22afSLv Zheng const char *format, ...)) 91905fb04b5SBob Moore ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) 92050df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 92105fb04b5SBob Moore acpi_info(const char *format, ...)) 922407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 92362cdd141SBob Moore void ACPI_INTERNAL_VAR_XFACE 92462cdd141SBob Moore acpi_bios_error(const char *module_name, 925407e22afSLv Zheng u32 line_number, 926407e22afSLv Zheng const char *format, ...)) 927f13c274dSBob Moore ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4) 928f13c274dSBob Moore void ACPI_INTERNAL_VAR_XFACE 929f13c274dSBob Moore acpi_bios_exception(const char *module_name, 930f13c274dSBob Moore u32 line_number, 931f13c274dSBob Moore acpi_status status, 932f13c274dSBob Moore const char *format, ...)) 933407e22afSLv Zheng ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 93462cdd141SBob Moore void ACPI_INTERNAL_VAR_XFACE 93562cdd141SBob Moore acpi_bios_warning(const char *module_name, 936407e22afSLv Zheng u32 line_number, 937407e22afSLv Zheng const char *format, ...)) 93862cdd141SBob Moore 939b74be611SBob Moore /* 940b74be611SBob Moore * Debug output 941b74be611SBob Moore */ 9421ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) 94350df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 94450df4d8bSBob Moore acpi_debug_print(u32 requested_debug_level, 94550df4d8bSBob Moore u32 line_number, 94650df4d8bSBob Moore const char *function_name, 94750df4d8bSBob Moore const char *module_name, 9481ce28c32SLv Zheng u32 component_id, 9491ce28c32SLv Zheng const char *format, ...)) 9501ce28c32SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) 95150df4d8bSBob Moore void ACPI_INTERNAL_VAR_XFACE 95250df4d8bSBob Moore acpi_debug_print_raw(u32 requested_debug_level, 95350df4d8bSBob Moore u32 line_number, 95450df4d8bSBob Moore const char *function_name, 95550df4d8bSBob Moore const char *module_name, 9561ce28c32SLv Zheng u32 component_id, 9571ce28c32SLv Zheng const char *format, ...)) 958bab04824SLv Zheng 959bab04824SLv Zheng ACPI_DBG_DEPENDENT_RETURN_VOID(void 960bab04824SLv Zheng acpi_trace_point(acpi_trace_event_type type, 961bab04824SLv Zheng u8 begin, 962bab04824SLv Zheng u8 *aml, char *pathname)) 963f5c1e1c5SLv Zheng 964f8fb4c38SLv Zheng acpi_status acpi_initialize_debugger(void); 965f8fb4c38SLv Zheng 966f8fb4c38SLv Zheng void acpi_terminate_debugger(void); 9670dedb3c4SLv Zheng 9680dedb3c4SLv Zheng /* 9690dedb3c4SLv Zheng * Divergences 9700dedb3c4SLv Zheng */ 971a8278efdSLv Zheng ACPI_EXTERNAL_RETURN_STATUS(acpi_status 972a8278efdSLv Zheng acpi_get_data_full(acpi_handle object, 973a8278efdSLv Zheng acpi_object_handler handler, 974a8278efdSLv Zheng void **data, 975a8278efdSLv Zheng void (*callback)(void *))) 97650df4d8bSBob Moore 977f988f24eSLv Zheng void acpi_set_debugger_thread_id(acpi_thread_id thread_id); 978f988f24eSLv Zheng 9791da177e4SLinus Torvalds #endif /* __ACXFACE_H__ */ 980