Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Name: acpixf.h - External interfaces to the ACPI subsystem |
| 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
Bob Moore | fbb7a2d | 2014-02-08 09:42:25 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2014, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #ifndef __ACXFACE_H__ |
| 45 | #define __ACXFACE_H__ |
| 46 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
| 48 | |
Bob Moore | bc381ee | 2014-04-30 10:06:30 +0800 | [diff] [blame] | 49 | #define ACPI_CA_VERSION 0x20140424 |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 50 | |
David Howells | a1ce392 | 2012-10-02 18:01:25 +0100 | [diff] [blame] | 51 | #include <acpi/acconfig.h> |
| 52 | #include <acpi/actypes.h> |
| 53 | #include <acpi/actbl.h> |
Linus Torvalds | d8dc91b | 2012-10-08 07:14:06 +0900 | [diff] [blame] | 54 | #include <acpi/acbuffer.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Lin Ming | 889c78b | 2008-12-31 09:23:57 +0800 | [diff] [blame] | 56 | extern u8 acpi_gbl_permanent_mmap; |
| 57 | |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 58 | /***************************************************************************** |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 59 | * |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 60 | * Macros used for ACPICA globals and configuration |
| 61 | * |
| 62 | ****************************************************************************/ |
| 63 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 64 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 65 | * Ensure that global variables are defined and initialized only once. |
| 66 | * |
| 67 | * The use of these macros allows for a single list of globals (here) |
| 68 | * in order to simplify maintenance of the code. |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 69 | */ |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 70 | #ifdef DEFINE_ACPI_GLOBALS |
| 71 | #define ACPI_GLOBAL(type,name) \ |
| 72 | extern type name; \ |
| 73 | type name |
Lv Zheng | 3e8214e | 2012-12-19 05:37:15 +0000 | [diff] [blame] | 74 | |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 75 | #define ACPI_INIT_GLOBAL(type,name,value) \ |
| 76 | type name=value |
Lv Zheng | 3e8214e | 2012-12-19 05:37:15 +0000 | [diff] [blame] | 77 | |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 78 | #else |
| 79 | #ifndef ACPI_GLOBAL |
| 80 | #define ACPI_GLOBAL(type,name) \ |
| 81 | extern type name |
| 82 | #endif |
Lv Zheng | 3e8214e | 2012-12-19 05:37:15 +0000 | [diff] [blame] | 83 | |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 84 | #ifndef ACPI_INIT_GLOBAL |
| 85 | #define ACPI_INIT_GLOBAL(type,name,value) \ |
| 86 | extern type name |
| 87 | #endif |
| 88 | #endif |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 89 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 90 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 91 | * These macros configure the various ACPICA interfaces. They are |
| 92 | * useful for generating stub inline functions for features that are |
| 93 | * configured out of the current kernel or ACPICA application. |
| 94 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 95 | #ifndef ACPI_EXTERNAL_RETURN_STATUS |
| 96 | #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \ |
| 97 | prototype; |
| 98 | #endif |
| 99 | |
| 100 | #ifndef ACPI_EXTERNAL_RETURN_OK |
| 101 | #define ACPI_EXTERNAL_RETURN_OK(prototype) \ |
| 102 | prototype; |
| 103 | #endif |
| 104 | |
| 105 | #ifndef ACPI_EXTERNAL_RETURN_VOID |
| 106 | #define ACPI_EXTERNAL_RETURN_VOID(prototype) \ |
| 107 | prototype; |
| 108 | #endif |
| 109 | |
| 110 | #ifndef ACPI_EXTERNAL_RETURN_UINT32 |
| 111 | #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \ |
| 112 | prototype; |
| 113 | #endif |
| 114 | |
| 115 | #ifndef ACPI_EXTERNAL_RETURN_PTR |
| 116 | #define ACPI_EXTERNAL_RETURN_PTR(prototype) \ |
| 117 | prototype; |
| 118 | #endif |
| 119 | |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 120 | /***************************************************************************** |
| 121 | * |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 122 | * Public globals and runtime configuration options |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 123 | * |
| 124 | ****************************************************************************/ |
| 125 | |
| 126 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 127 | * Enable "slack mode" of the AML interpreter? Default is FALSE, and the |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 128 | * interpreter strictly follows the ACPI specification. Setting to TRUE |
| 129 | * allows the interpreter to ignore certain errors and/or bad AML constructs. |
| 130 | * |
| 131 | * Currently, these features are enabled by this flag: |
| 132 | * |
| 133 | * 1) Allow "implicit return" of last value in a control method |
| 134 | * 2) Allow access beyond the end of an operation region |
| 135 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) |
| 136 | * 4) Allow ANY object type to be a source operand for the Store() operator |
| 137 | * 5) Allow unresolved references (invalid target name) in package objects |
| 138 | * 6) Enable warning messages for behavior that is not ACPI spec compliant |
| 139 | */ |
| 140 | ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE); |
| 141 | |
| 142 | /* |
| 143 | * Automatically serialize all methods that create named objects? Default |
| 144 | * is TRUE, meaning that all non_serialized methods are scanned once at |
| 145 | * table load time to determine those that create named objects. Methods |
| 146 | * that create named objects are marked Serialized in order to prevent |
| 147 | * possible run-time problems if they are entered by more than one thread. |
| 148 | */ |
| 149 | ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE); |
| 150 | |
| 151 | /* |
| 152 | * Create the predefined _OSI method in the namespace? Default is TRUE |
| 153 | * because ACPICA is fully compatible with other ACPI implementations. |
| 154 | * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. |
| 155 | */ |
| 156 | ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE); |
| 157 | |
| 158 | /* |
| 159 | * Optionally use default values for the ACPI register widths. Set this to |
| 160 | * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. |
| 161 | */ |
| 162 | ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE); |
| 163 | |
| 164 | /* |
Lv Zheng | 47d68c7 | 2014-05-31 08:14:44 +0800 | [diff] [blame] | 165 | * Whether or not to verify the table checksum before installation. Set |
| 166 | * this to TRUE to verify the table checksum before install it to the table |
| 167 | * manager. Note that enabling this option causes errors to happen in some |
| 168 | * OSPMs during early initialization stages. Default behavior is to do such |
| 169 | * verification. |
| 170 | */ |
| 171 | ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, TRUE); |
| 172 | |
| 173 | /* |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 174 | * Optionally enable output from the AML Debug Object. |
| 175 | */ |
| 176 | ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE); |
| 177 | |
| 178 | /* |
| 179 | * Optionally copy the entire DSDT to local memory (instead of simply |
| 180 | * mapping it.) There are some BIOSs that corrupt or replace the original |
| 181 | * DSDT, creating the need for this option. Default is FALSE, do not copy |
| 182 | * the DSDT. |
| 183 | */ |
| 184 | ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE); |
| 185 | |
| 186 | /* |
| 187 | * Optionally ignore an XSDT if present and use the RSDT instead. |
| 188 | * Although the ACPI specification requires that an XSDT be used instead |
| 189 | * of the RSDT, the XSDT has been found to be corrupt or ill-formed on |
| 190 | * some machines. Default behavior is to use the XSDT if present. |
| 191 | */ |
| 192 | ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); |
| 193 | |
| 194 | /* |
| 195 | * Optionally use 32-bit FADT addresses if and when there is a conflict |
| 196 | * (address mismatch) between the 32-bit and 64-bit versions of the |
| 197 | * address. Although ACPICA adheres to the ACPI specification which |
| 198 | * requires the use of the corresponding 64-bit address if it is non-zero, |
| 199 | * some machines have been found to have a corrupted non-zero 64-bit |
Rafael J. Wysocki | c9b77a4 | 2014-05-27 18:11:38 +0200 | [diff] [blame] | 200 | * address. Default is TRUE, favor the 32-bit addresses. |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 201 | */ |
Rafael J. Wysocki | c9b77a4 | 2014-05-27 18:11:38 +0200 | [diff] [blame] | 202 | ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, TRUE); |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 203 | |
| 204 | /* |
| 205 | * Optionally truncate I/O addresses to 16 bits. Provides compatibility |
| 206 | * with other ACPI implementations. NOTE: During ACPICA initialization, |
| 207 | * this value is set to TRUE if any Windows OSI strings have been |
| 208 | * requested by the BIOS. |
| 209 | */ |
| 210 | ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE); |
| 211 | |
| 212 | /* |
| 213 | * Disable runtime checking and repair of values returned by control methods. |
| 214 | * Use only if the repair is causing a problem on a particular machine. |
| 215 | */ |
| 216 | ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE); |
| 217 | |
| 218 | /* |
| 219 | * Optionally do not install any SSDTs from the RSDT/XSDT during initialization. |
| 220 | * This can be useful for debugging ACPI problems on some machines. |
| 221 | */ |
| 222 | ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE); |
| 223 | |
| 224 | /* |
| 225 | * We keep track of the latest version of Windows that has been requested by |
Bob Moore | fea79bc | 2014-04-30 10:05:34 +0800 | [diff] [blame] | 226 | * the BIOS. ACPI 5.0. |
Lv Zheng | 3035ff7 | 2014-04-30 10:03:52 +0800 | [diff] [blame] | 227 | */ |
| 228 | ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0); |
| 229 | |
| 230 | /* |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 231 | * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning |
| 232 | * that the ACPI hardware is no longer required. A flag in the FADT indicates |
| 233 | * a reduced HW machine, and that flag is duplicated here for convenience. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | */ |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 235 | ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 236 | |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 237 | /* |
| 238 | * This mechanism is used to trace a specified AML method. The method is |
| 239 | * traced each time it is executed. |
| 240 | */ |
| 241 | ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0); |
| 242 | ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 243 | |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 244 | /* |
| 245 | * Runtime configuration of debug output control masks. We want the debug |
| 246 | * switches statically initialized so they are already set when the debugger |
| 247 | * is entered. |
| 248 | */ |
| 249 | ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT); |
| 250 | ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 251 | |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 252 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 253 | * Other miscellaneous globals |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 254 | */ |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 255 | ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT); |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 256 | ACPI_GLOBAL(u32, acpi_current_gpe_count); |
Lv Zheng | 3a2f3a3 | 2014-04-30 10:04:35 +0800 | [diff] [blame] | 257 | ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 258 | |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 259 | /***************************************************************************** |
| 260 | * |
| 261 | * ACPICA public interface configuration. |
| 262 | * |
| 263 | * Interfaces that are configured out of the ACPICA build are replaced |
| 264 | * by inlined stubs by default. |
| 265 | * |
| 266 | ****************************************************************************/ |
| 267 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 268 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 269 | * Hardware-reduced prototypes (default: Not hardware reduced). |
| 270 | * |
| 271 | * All ACPICA hardware-related interfaces that use these macros will be |
| 272 | * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 273 | * is set to TRUE. |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 274 | * |
| 275 | * Note: This static build option for reduced hardware is intended to |
| 276 | * reduce ACPICA code size if desired or necessary. However, even if this |
| 277 | * option is not specified, the runtime behavior of ACPICA is dependent |
| 278 | * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set, |
| 279 | * the flag will enable similar behavior -- ACPICA will not attempt |
| 280 | * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 281 | */ |
| 282 | #if (!ACPI_REDUCED_HARDWARE) |
| 283 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 284 | ACPI_EXTERNAL_RETURN_STATUS(prototype) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 285 | |
| 286 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 287 | ACPI_EXTERNAL_RETURN_OK(prototype) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 288 | |
| 289 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 290 | ACPI_EXTERNAL_RETURN_VOID(prototype) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 291 | |
| 292 | #else |
| 293 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ |
| 294 | static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} |
| 295 | |
| 296 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ |
| 297 | static ACPI_INLINE prototype {return(AE_OK);} |
| 298 | |
| 299 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ |
Bob Moore | c26f3c9 | 2013-10-29 09:29:16 +0800 | [diff] [blame] | 300 | static ACPI_INLINE prototype {return;} |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 301 | |
| 302 | #endif /* !ACPI_REDUCED_HARDWARE */ |
| 303 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 304 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 305 | * Error message prototypes (default: error messages enabled). |
| 306 | * |
| 307 | * All interfaces related to error and warning messages |
| 308 | * will be configured out of the ACPICA build if the |
| 309 | * ACPI_NO_ERROR_MESSAGE flag is defined. |
Lv Zheng | 407e22a | 2014-04-30 10:04:48 +0800 | [diff] [blame] | 310 | */ |
| 311 | #ifndef ACPI_NO_ERROR_MESSAGES |
| 312 | #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ |
| 313 | prototype; |
| 314 | |
| 315 | #else |
| 316 | #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ |
| 317 | static ACPI_INLINE prototype {return;} |
| 318 | |
| 319 | #endif /* ACPI_NO_ERROR_MESSAGES */ |
| 320 | |
| 321 | /* |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 322 | * Debugging output prototypes (default: no debug output). |
| 323 | * |
| 324 | * All interfaces related to debug output messages |
| 325 | * will be configured out of the ACPICA build unless the |
| 326 | * ACPI_DEBUG_OUTPUT flag is defined. |
Lv Zheng | 1ce28c3 | 2014-04-30 10:04:55 +0800 | [diff] [blame] | 327 | */ |
| 328 | #ifdef ACPI_DEBUG_OUTPUT |
| 329 | #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ |
| 330 | prototype; |
| 331 | |
| 332 | #else |
| 333 | #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ |
| 334 | static ACPI_INLINE prototype {return;} |
| 335 | |
| 336 | #endif /* ACPI_DEBUG_OUTPUT */ |
| 337 | |
Bob Moore | 1011080 | 2014-04-30 10:06:22 +0800 | [diff] [blame] | 338 | /***************************************************************************** |
| 339 | * |
| 340 | * ACPICA public interface prototypes |
| 341 | * |
| 342 | ****************************************************************************/ |
| 343 | |
Lv Zheng | 1ce28c3 | 2014-04-30 10:04:55 +0800 | [diff] [blame] | 344 | /* |
Lv Zheng | 75c8044 | 2012-12-19 05:36:49 +0000 | [diff] [blame] | 345 | * Initialization |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 347 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init |
| 348 | acpi_initialize_tables(struct acpi_table_desc |
| 349 | *initial_storage, |
| 350 | u32 initial_table_count, |
| 351 | u8 allow_resize)) |
| 352 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void)) |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 353 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 354 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 356 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init |
| 357 | acpi_initialize_objects(u32 flags)) |
| 358 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | |
Lv Zheng | 75c8044 | 2012-12-19 05:36:49 +0000 | [diff] [blame] | 360 | /* |
| 361 | * Miscellaneous global interfaces |
| 362 | */ |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 363 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) |
| 364 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 365 | #ifdef ACPI_FUTURE_USAGE |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 366 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void)) |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 367 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | |
| 369 | #ifdef ACPI_FUTURE_USAGE |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 370 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 371 | acpi_get_system_info(struct acpi_buffer |
| 372 | *ret_buffer)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | #endif |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 374 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 375 | acpi_get_statistics(struct acpi_statistics *stats)) |
| 376 | ACPI_EXTERNAL_RETURN_PTR(const char |
| 377 | *acpi_format_exception(acpi_status exception)) |
| 378 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 379 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 380 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 381 | acpi_install_interface(acpi_string interface_name)) |
Lv Zheng | 9187a41 | 2013-10-31 09:30:28 +0800 | [diff] [blame] | 382 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 383 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 384 | acpi_remove_interface(acpi_string interface_name)) |
| 385 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 387 | ACPI_EXTERNAL_RETURN_UINT32(u32 |
| 388 | acpi_check_address_range(acpi_adr_space_type |
| 389 | space_id, |
| 390 | acpi_physical_address |
| 391 | address, acpi_size length, |
| 392 | u8 warn)) |
| 393 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 394 | acpi_decode_pld_buffer(u8 *in_buffer, |
| 395 | acpi_size length, |
| 396 | struct acpi_pld_info |
| 397 | **return_buffer)) |
Bob Moore | be030a5 | 2012-08-17 13:07:54 +0800 | [diff] [blame] | 398 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | /* |
Bob Moore | f60d818 | 2012-07-16 10:21:34 +0800 | [diff] [blame] | 400 | * ACPI table load/unload interfaces |
| 401 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 402 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init |
| 403 | acpi_install_table(acpi_physical_address address, |
| 404 | u8 physical)) |
Bob Moore | f60d818 | 2012-07-16 10:21:34 +0800 | [diff] [blame] | 405 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 406 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 407 | acpi_load_table(struct acpi_table_header *table)) |
Bob Moore | f60d818 | 2012-07-16 10:21:34 +0800 | [diff] [blame] | 408 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 409 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 410 | acpi_unload_parent_table(acpi_handle object)) |
| 411 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void)) |
Bob Moore | f60d818 | 2012-07-16 10:21:34 +0800 | [diff] [blame] | 412 | |
| 413 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | * ACPI table manipulation interfaces |
| 415 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 416 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 417 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 418 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init |
| 419 | acpi_find_root_pointer(acpi_size * rsdp_address)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 420 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 421 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 422 | acpi_get_table_header(acpi_string signature, |
| 423 | u32 instance, |
| 424 | struct acpi_table_header |
| 425 | *out_table_header)) |
| 426 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 427 | acpi_get_table(acpi_string signature, u32 instance, |
| 428 | struct acpi_table_header |
| 429 | **out_table)) |
| 430 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 431 | acpi_get_table_by_index(u32 table_index, |
| 432 | struct acpi_table_header |
| 433 | **out_table)) |
| 434 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 435 | acpi_install_table_handler(acpi_table_handler |
| 436 | handler, void *context)) |
| 437 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 438 | acpi_remove_table_handler(acpi_table_handler |
| 439 | handler)) |
Lin Ming | 3e08e2d | 2008-04-10 19:06:38 +0400 | [diff] [blame] | 440 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | /* |
| 442 | * Namespace and name interfaces |
| 443 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 444 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 445 | acpi_walk_namespace(acpi_object_type type, |
| 446 | acpi_handle start_object, |
| 447 | u32 max_depth, |
| 448 | acpi_walk_callback |
| 449 | descending_callback, |
| 450 | acpi_walk_callback |
| 451 | ascending_callback, |
| 452 | void *context, |
| 453 | void **return_value)) |
| 454 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 455 | acpi_get_devices(const char *HID, |
| 456 | acpi_walk_callback user_function, |
| 457 | void *context, |
| 458 | void **return_value)) |
| 459 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 460 | acpi_get_name(acpi_handle object, u32 name_type, |
| 461 | struct acpi_buffer *ret_path_ptr)) |
| 462 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 463 | acpi_get_handle(acpi_handle parent, |
| 464 | acpi_string pathname, |
| 465 | acpi_handle * ret_handle)) |
| 466 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 467 | acpi_attach_data(acpi_handle object, |
| 468 | acpi_object_handler handler, |
| 469 | void *data)) |
| 470 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 471 | acpi_detach_data(acpi_handle object, |
| 472 | acpi_object_handler handler)) |
| 473 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 474 | acpi_get_data(acpi_handle object, |
| 475 | acpi_object_handler handler, |
| 476 | void **data)) |
| 477 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 478 | acpi_debug_trace(char *name, u32 debug_level, |
| 479 | u32 debug_layer, u32 flags)) |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 480 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | /* |
| 482 | * Object manipulation and enumeration |
| 483 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 484 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 485 | acpi_evaluate_object(acpi_handle object, |
| 486 | acpi_string pathname, |
| 487 | struct acpi_object_list |
| 488 | *parameter_objects, |
| 489 | struct acpi_buffer |
| 490 | *return_object_buffer)) |
| 491 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 492 | acpi_evaluate_object_typed(acpi_handle object, |
| 493 | acpi_string pathname, |
| 494 | struct acpi_object_list |
| 495 | *external_params, |
| 496 | struct acpi_buffer |
| 497 | *return_buffer, |
| 498 | acpi_object_type |
| 499 | return_type)) |
| 500 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 501 | acpi_get_object_info(acpi_handle object, |
| 502 | struct acpi_device_info |
| 503 | **return_buffer)) |
| 504 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 505 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 506 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 507 | acpi_get_next_object(acpi_object_type type, |
| 508 | acpi_handle parent, |
| 509 | acpi_handle child, |
| 510 | acpi_handle * out_handle)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 511 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 512 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 513 | acpi_get_type(acpi_handle object, |
| 514 | acpi_object_type * out_type)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 515 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 516 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 517 | acpi_get_parent(acpi_handle object, |
| 518 | acpi_handle * out_handle)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | |
| 520 | /* |
Bob Moore | ecfbbc7 | 2008-12-31 02:55:32 +0800 | [diff] [blame] | 521 | * Handler interfaces |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 523 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 524 | acpi_install_initialization_handler |
| 525 | (acpi_init_handler handler, u32 function)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 526 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 527 | acpi_install_sci_handler(acpi_sci_handler |
| 528 | address, |
| 529 | void *context)) |
Lv Zheng | a2fd4b4 | 2013-09-23 09:52:05 +0800 | [diff] [blame] | 530 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 531 | acpi_remove_sci_handler(acpi_sci_handler |
| 532 | address)) |
| 533 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 534 | acpi_install_global_event_handler |
| 535 | (acpi_gbl_event_handler handler, |
| 536 | void *context)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 537 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 538 | acpi_install_fixed_event_handler(u32 |
| 539 | acpi_event, |
| 540 | acpi_event_handler |
| 541 | handler, |
| 542 | void |
| 543 | *context)) |
| 544 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 545 | acpi_remove_fixed_event_handler(u32 acpi_event, |
| 546 | acpi_event_handler |
| 547 | handler)) |
| 548 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 549 | acpi_install_gpe_handler(acpi_handle |
| 550 | gpe_device, |
| 551 | u32 gpe_number, |
| 552 | u32 type, |
| 553 | acpi_gpe_handler |
| 554 | address, |
| 555 | void *context)) |
| 556 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 557 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
| 558 | u32 gpe_number, |
| 559 | acpi_gpe_handler |
| 560 | address)) |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 561 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 562 | acpi_install_notify_handler(acpi_handle device, |
| 563 | u32 handler_type, |
| 564 | acpi_notify_handler |
| 565 | handler, |
| 566 | void *context)) |
| 567 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 568 | acpi_remove_notify_handler(acpi_handle device, |
| 569 | u32 handler_type, |
| 570 | acpi_notify_handler |
| 571 | handler)) |
| 572 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 573 | acpi_install_address_space_handler(acpi_handle |
| 574 | device, |
| 575 | acpi_adr_space_type |
| 576 | space_id, |
| 577 | acpi_adr_space_handler |
| 578 | handler, |
| 579 | acpi_adr_space_setup |
| 580 | setup, |
| 581 | void *context)) |
| 582 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 583 | acpi_remove_address_space_handler(acpi_handle |
| 584 | device, |
| 585 | acpi_adr_space_type |
| 586 | space_id, |
| 587 | acpi_adr_space_handler |
| 588 | handler)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 589 | #ifdef ACPI_FUTURE_USAGE |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 590 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 591 | acpi_install_exception_handler |
| 592 | (acpi_exception_handler handler)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | #endif |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 594 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 595 | acpi_install_interface_handler |
| 596 | (acpi_interface_handler handler)) |
Lin Ming | b0ed7a9 | 2010-08-06 09:35:51 +0800 | [diff] [blame] | 597 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 598 | /* |
Lin Ming | ffef682 | 2011-11-16 11:08:30 +0800 | [diff] [blame] | 599 | * Global Lock interfaces |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 600 | */ |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 601 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 602 | acpi_acquire_global_lock(u16 timeout, |
| 603 | u32 *handle)) |
Lv Zheng | cd27d79 | 2013-10-29 09:30:22 +0800 | [diff] [blame] | 604 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 605 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 606 | acpi_release_global_lock(u32 handle)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 607 | |
Lin Ming | ffef682 | 2011-11-16 11:08:30 +0800 | [diff] [blame] | 608 | /* |
| 609 | * Interfaces to AML mutex objects |
| 610 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 611 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 612 | acpi_acquire_mutex(acpi_handle handle, |
| 613 | acpi_string pathname, |
| 614 | u16 timeout)) |
Lin Ming | ffef682 | 2011-11-16 11:08:30 +0800 | [diff] [blame] | 615 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 616 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 617 | acpi_release_mutex(acpi_handle handle, |
| 618 | acpi_string pathname)) |
Lin Ming | ffef682 | 2011-11-16 11:08:30 +0800 | [diff] [blame] | 619 | |
| 620 | /* |
| 621 | * Fixed Event interfaces |
| 622 | */ |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 623 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 624 | acpi_enable_event(u32 event, u32 flags)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 625 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 626 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 627 | acpi_disable_event(u32 event, u32 flags)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 628 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 629 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 630 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 631 | acpi_get_event_status(u32 event, |
| 632 | acpi_event_status |
| 633 | *event_status)) |
Lv Zheng | cd27d79 | 2013-10-29 09:30:22 +0800 | [diff] [blame] | 634 | |
Bob Moore | 08ac07b | 2008-12-30 09:55:48 +0800 | [diff] [blame] | 635 | /* |
Lin Ming | ffef682 | 2011-11-16 11:08:30 +0800 | [diff] [blame] | 636 | * General Purpose Event (GPE) Interfaces |
Bob Moore | 08ac07b | 2008-12-30 09:55:48 +0800 | [diff] [blame] | 637 | */ |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 638 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 639 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 640 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 641 | acpi_enable_gpe(acpi_handle gpe_device, |
| 642 | u32 gpe_number)) |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 643 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 644 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 645 | acpi_disable_gpe(acpi_handle gpe_device, |
| 646 | u32 gpe_number)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 647 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 648 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 649 | acpi_clear_gpe(acpi_handle gpe_device, |
| 650 | u32 gpe_number)) |
Lin Ming | bba63a2 | 2010-12-13 13:39:17 +0800 | [diff] [blame] | 651 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 652 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 653 | acpi_set_gpe(acpi_handle gpe_device, |
| 654 | u32 gpe_number, u8 action)) |
Rafael J. Wysocki | e8b6f97 | 2010-06-25 01:18:39 +0200 | [diff] [blame] | 655 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 656 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 657 | acpi_finish_gpe(acpi_handle gpe_device, |
| 658 | u32 gpe_number)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 659 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 660 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 661 | acpi_setup_gpe_for_wake(acpi_handle |
| 662 | parent_device, |
| 663 | acpi_handle gpe_device, |
| 664 | u32 gpe_number)) |
| 665 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 666 | acpi_set_gpe_wake_mask(acpi_handle gpe_device, |
| 667 | u32 gpe_number, |
| 668 | u8 action)) |
| 669 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 670 | acpi_get_gpe_status(acpi_handle gpe_device, |
| 671 | u32 gpe_number, |
| 672 | acpi_event_status |
| 673 | *event_status)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 674 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 675 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) |
Bob Moore | e97d6bf | 2008-12-30 09:45:17 +0800 | [diff] [blame] | 676 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 677 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 678 | acpi_get_gpe_device(u32 gpe_index, |
| 679 | acpi_handle * gpe_device)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 681 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 682 | acpi_install_gpe_block(acpi_handle gpe_device, |
| 683 | struct |
| 684 | acpi_generic_address |
| 685 | *gpe_block_address, |
| 686 | u32 register_count, |
| 687 | u32 interrupt_number)) |
| 688 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 689 | acpi_remove_gpe_block(acpi_handle gpe_device)) |
Rafael J. Wysocki | a210080 | 2010-09-16 00:30:43 +0200 | [diff] [blame] | 690 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 691 | /* |
| 692 | * Resource interfaces |
| 693 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 694 | typedef |
Bob Moore | 61686124 | 2006-03-17 16:44:00 -0500 | [diff] [blame] | 695 | acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 696 | void *context); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 697 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 698 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 699 | acpi_get_vendor_resource(acpi_handle device, |
| 700 | char *name, |
| 701 | struct acpi_vendor_uuid |
| 702 | *uuid, |
| 703 | struct acpi_buffer |
| 704 | *ret_buffer)) |
| 705 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 706 | acpi_get_current_resources(acpi_handle device, |
| 707 | struct acpi_buffer |
| 708 | *ret_buffer)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | #ifdef ACPI_FUTURE_USAGE |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 710 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 711 | acpi_get_possible_resources(acpi_handle device, |
| 712 | struct acpi_buffer |
| 713 | *ret_buffer)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 714 | #endif |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 715 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 716 | acpi_get_event_resources(acpi_handle device_handle, |
| 717 | struct acpi_buffer |
| 718 | *ret_buffer)) |
| 719 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 720 | acpi_walk_resource_buffer(struct acpi_buffer |
| 721 | *buffer, |
| 722 | acpi_walk_resource_callback |
| 723 | user_function, |
| 724 | void *context)) |
| 725 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 726 | acpi_walk_resources(acpi_handle device, char *name, |
| 727 | acpi_walk_resource_callback |
| 728 | user_function, void *context)) |
| 729 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 730 | acpi_set_current_resources(acpi_handle device, |
| 731 | struct acpi_buffer |
| 732 | *in_buffer)) |
| 733 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 734 | acpi_get_irq_routing_table(acpi_handle device, |
| 735 | struct acpi_buffer |
| 736 | *ret_buffer)) |
| 737 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 738 | acpi_resource_to_address64(struct acpi_resource |
| 739 | *resource, |
| 740 | struct |
| 741 | acpi_resource_address64 |
| 742 | *out)) |
| 743 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 744 | acpi_buffer_to_resource(u8 *aml_buffer, |
| 745 | u16 aml_buffer_length, |
| 746 | struct acpi_resource |
| 747 | **resource_ptr)) |
Bob Moore | 0e24317 | 2011-11-16 14:51:01 +0800 | [diff] [blame] | 748 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 749 | /* |
| 750 | * Hardware (ACPI device) interfaces |
| 751 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 752 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void)) |
Bob Moore | d3fd902 | 2008-12-30 11:11:57 +0800 | [diff] [blame] | 753 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 754 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 755 | acpi_read(u64 *value, |
| 756 | struct acpi_generic_address *reg)) |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 757 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 758 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 759 | acpi_write(u64 value, |
| 760 | struct acpi_generic_address *reg)) |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 761 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 762 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 763 | acpi_read_bit_register(u32 register_id, |
| 764 | u32 *return_value)) |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 765 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 766 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 767 | acpi_write_bit_register(u32 register_id, |
| 768 | u32 value)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 769 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 770 | /* |
| 771 | * Sleep/Wake interfaces |
| 772 | */ |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 773 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 774 | acpi_get_sleep_type_data(u8 sleep_state, |
| 775 | u8 *slp_typ_a, |
| 776 | u8 *slp_typ_b)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 777 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 778 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 779 | acpi_enter_sleep_state_prep(u8 sleep_state)) |
| 780 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 781 | |
Lv Zheng | 40bce10 | 2013-10-31 09:31:18 +0800 | [diff] [blame] | 782 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 783 | |
Lv Zheng | 8b9c115 | 2014-04-30 10:05:08 +0800 | [diff] [blame] | 784 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 785 | acpi_leave_sleep_state_prep(u8 sleep_state)) |
| 786 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 787 | |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 788 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 789 | acpi_set_firmware_waking_vector(u32 |
| 790 | physical_address)) |
Lv Zheng | 739dcbb | 2012-12-20 01:07:26 +0000 | [diff] [blame] | 791 | #if ACPI_MACHINE_WIDTH == 64 |
| 792 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 793 | acpi_set_firmware_waking_vector64(u64 |
| 794 | physical_address)) |
| 795 | #endif |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 796 | /* |
Bob Moore | d08310f | 2012-02-14 15:22:51 +0800 | [diff] [blame] | 797 | * ACPI Timer interfaces |
| 798 | */ |
| 799 | #ifdef ACPI_FUTURE_USAGE |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 800 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 801 | acpi_get_timer_resolution(u32 *resolution)) |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 802 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) |
Bob Moore | d08310f | 2012-02-14 15:22:51 +0800 | [diff] [blame] | 803 | |
Bob Moore | 33620c5 | 2012-02-14 18:14:27 +0800 | [diff] [blame] | 804 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 805 | acpi_get_timer_duration(u32 start_ticks, |
| 806 | u32 end_ticks, |
| 807 | u32 *time_elapsed)) |
Bob Moore | d08310f | 2012-02-14 15:22:51 +0800 | [diff] [blame] | 808 | #endif /* ACPI_FUTURE_USAGE */ |
| 809 | |
| 810 | /* |
Bob Moore | b74be61 | 2009-04-22 10:20:23 +0800 | [diff] [blame] | 811 | * Error/Warning output |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 812 | */ |
Lv Zheng | 407e22a | 2014-04-30 10:04:48 +0800 | [diff] [blame] | 813 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
| 814 | void ACPI_INTERNAL_VAR_XFACE |
| 815 | acpi_error(const char *module_name, |
| 816 | u32 line_number, |
| 817 | const char *format, ...)) |
| 818 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4) |
| 819 | void ACPI_INTERNAL_VAR_XFACE |
| 820 | acpi_exception(const char *module_name, |
| 821 | u32 line_number, |
| 822 | acpi_status status, |
| 823 | const char *format, ...)) |
| 824 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
| 825 | void ACPI_INTERNAL_VAR_XFACE |
| 826 | acpi_warning(const char *module_name, |
| 827 | u32 line_number, |
| 828 | const char *format, ...)) |
| 829 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
| 830 | void ACPI_INTERNAL_VAR_XFACE |
| 831 | acpi_info(const char *module_name, |
| 832 | u32 line_number, |
| 833 | const char *format, ...)) |
| 834 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
| 835 | void ACPI_INTERNAL_VAR_XFACE |
| 836 | acpi_bios_error(const char *module_name, |
| 837 | u32 line_number, |
| 838 | const char *format, ...)) |
| 839 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
| 840 | void ACPI_INTERNAL_VAR_XFACE |
| 841 | acpi_bios_warning(const char *module_name, |
| 842 | u32 line_number, |
| 843 | const char *format, ...)) |
Bob Moore | 62cdd14 | 2012-07-16 09:25:27 +0800 | [diff] [blame] | 844 | |
Bob Moore | b74be61 | 2009-04-22 10:20:23 +0800 | [diff] [blame] | 845 | /* |
| 846 | * Debug output |
| 847 | */ |
Lv Zheng | 1ce28c3 | 2014-04-30 10:04:55 +0800 | [diff] [blame] | 848 | ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) |
| 849 | void ACPI_INTERNAL_VAR_XFACE |
| 850 | acpi_debug_print(u32 requested_debug_level, |
| 851 | u32 line_number, |
| 852 | const char *function_name, |
| 853 | const char *module_name, |
| 854 | u32 component_id, |
| 855 | const char *format, ...)) |
| 856 | ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) |
| 857 | void ACPI_INTERNAL_VAR_XFACE |
| 858 | acpi_debug_print_raw(u32 requested_debug_level, |
| 859 | u32 line_number, |
| 860 | const char *function_name, |
| 861 | const char *module_name, |
| 862 | u32 component_id, |
| 863 | const char *format, ...)) |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 864 | |
Lv Zheng | 0dedb3c | 2014-04-30 10:05:02 +0800 | [diff] [blame] | 865 | /* |
| 866 | * Divergences |
| 867 | */ |
| 868 | acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 869 | |
Lv Zheng | 0dedb3c | 2014-04-30 10:05:02 +0800 | [diff] [blame] | 870 | acpi_status acpi_unload_table_id(acpi_owner_id id); |
| 871 | |
| 872 | acpi_status |
| 873 | acpi_get_table_with_size(acpi_string signature, |
| 874 | u32 instance, struct acpi_table_header **out_table, |
| 875 | acpi_size *tbl_size); |
| 876 | |
| 877 | acpi_status |
| 878 | acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, |
| 879 | void (*callback)(void *)); |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 880 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 881 | #endif /* __ACXFACE_H__ */ |