acpixf.h 31 KB

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