acpixf.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  1. /******************************************************************************
  2. *
  3. * Name: acpixf.h - External interfaces to the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2017, 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 0x20170728
  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 validate (map) an entire table to verify
  143. * checksum/duplication in early stage before install. Set this to TRUE to
  144. * allow early table validation before install it to the table manager.
  145. * Note that enabling this option causes errors to happen in some OSPMs
  146. * during early initialization stages. Default behavior is to allow such
  147. * validation.
  148. */
  149. ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_table_validation, TRUE);
  150. /*
  151. * Optionally enable output from the AML Debug Object.
  152. */
  153. ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
  154. /*
  155. * Optionally copy the entire DSDT to local memory (instead of simply
  156. * mapping it.) There are some BIOSs that corrupt or replace the original
  157. * DSDT, creating the need for this option. Default is FALSE, do not copy
  158. * the DSDT.
  159. */
  160. ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
  161. /*
  162. * Optionally ignore an XSDT if present and use the RSDT instead.
  163. * Although the ACPI specification requires that an XSDT be used instead
  164. * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
  165. * some machines. Default behavior is to use the XSDT if present.
  166. */
  167. ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
  168. /*
  169. * Optionally support group module level code.
  170. */
  171. ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
  172. /*
  173. * Optionally support module level code by parsing the entire table as
  174. * a term_list. Default is FALSE, do not execute entire table until some
  175. * lock order issues are fixed.
  176. */
  177. ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, FALSE);
  178. /*
  179. * Optionally use 32-bit FADT addresses if and when there is a conflict
  180. * (address mismatch) between the 32-bit and 64-bit versions of the
  181. * address. Although ACPICA adheres to the ACPI specification which
  182. * requires the use of the corresponding 64-bit address if it is non-zero,
  183. * some machines have been found to have a corrupted non-zero 64-bit
  184. * address. Default is FALSE, do not favor the 32-bit addresses.
  185. */
  186. ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
  187. /*
  188. * Optionally use 32-bit FACS table addresses.
  189. * It is reported that some platforms fail to resume from system suspending
  190. * if 64-bit FACS table address is selected:
  191. * https://bugzilla.kernel.org/show_bug.cgi?id=74021
  192. * Default is TRUE, favor the 32-bit addresses.
  193. */
  194. ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_facs_addresses, TRUE);
  195. /*
  196. * Optionally truncate I/O addresses to 16 bits. Provides compatibility
  197. * with other ACPI implementations. NOTE: During ACPICA initialization,
  198. * this value is set to TRUE if any Windows OSI strings have been
  199. * requested by the BIOS.
  200. */
  201. ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
  202. /*
  203. * Disable runtime checking and repair of values returned by control methods.
  204. * Use only if the repair is causing a problem on a particular machine.
  205. */
  206. ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
  207. /*
  208. * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
  209. * This can be useful for debugging ACPI problems on some machines.
  210. */
  211. ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
  212. /*
  213. * Optionally enable runtime namespace override.
  214. */
  215. ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE);
  216. /*
  217. * We keep track of the latest version of Windows that has been requested by
  218. * the BIOS. ACPI 5.0.
  219. */
  220. ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
  221. /*
  222. * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
  223. * that the ACPI hardware is no longer required. A flag in the FADT indicates
  224. * a reduced HW machine, and that flag is duplicated here for convenience.
  225. */
  226. ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
  227. /*
  228. * Maximum number of While() loop iterations before forced method abort.
  229. * This mechanism is intended to prevent infinite loops during interpreter
  230. * execution within a host kernel.
  231. */
  232. ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_COUNT);
  233. /*
  234. * This mechanism is used to trace a specified AML method. The method is
  235. * traced each time it is executed.
  236. */
  237. ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
  238. ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL);
  239. ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT);
  240. ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
  241. /*
  242. * Runtime configuration of debug output control masks. We want the debug
  243. * switches statically initialized so they are already set when the debugger
  244. * is entered.
  245. */
  246. ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
  247. ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
  248. /* Optionally enable timer output with Debug Object output */
  249. ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE);
  250. /*
  251. * Debugger command handshake globals. Host OSes need to access these
  252. * variables to implement their own command handshake mechanism.
  253. */
  254. #ifdef ACPI_DEBUGGER
  255. ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
  256. ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]);
  257. #endif
  258. /*
  259. * Other miscellaneous globals
  260. */
  261. ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
  262. ACPI_GLOBAL(u32, acpi_current_gpe_count);
  263. ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
  264. /*****************************************************************************
  265. *
  266. * ACPICA public interface configuration.
  267. *
  268. * Interfaces that are configured out of the ACPICA build are replaced
  269. * by inlined stubs by default.
  270. *
  271. ****************************************************************************/
  272. /*
  273. * Hardware-reduced prototypes (default: Not hardware reduced).
  274. *
  275. * All ACPICA hardware-related interfaces that use these macros will be
  276. * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
  277. * is set to TRUE.
  278. *
  279. * Note: This static build option for reduced hardware is intended to
  280. * reduce ACPICA code size if desired or necessary. However, even if this
  281. * option is not specified, the runtime behavior of ACPICA is dependent
  282. * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
  283. * the flag will enable similar behavior -- ACPICA will not attempt
  284. * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
  285. */
  286. #if (!ACPI_REDUCED_HARDWARE)
  287. #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
  288. ACPI_EXTERNAL_RETURN_STATUS(prototype)
  289. #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
  290. ACPI_EXTERNAL_RETURN_OK(prototype)
  291. #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
  292. ACPI_EXTERNAL_RETURN_VOID(prototype)
  293. #else
  294. #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
  295. static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
  296. #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
  297. static ACPI_INLINE prototype {return(AE_OK);}
  298. #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
  299. static ACPI_INLINE prototype {return;}
  300. #endif /* !ACPI_REDUCED_HARDWARE */
  301. /*
  302. * Error message prototypes (default: error messages enabled).
  303. *
  304. * All interfaces related to error and warning messages
  305. * will be configured out of the ACPICA build if the
  306. * ACPI_NO_ERROR_MESSAGE flag is defined.
  307. */
  308. #ifndef ACPI_NO_ERROR_MESSAGES
  309. #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
  310. prototype;
  311. #else
  312. #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
  313. static ACPI_INLINE prototype {return;}
  314. #endif /* ACPI_NO_ERROR_MESSAGES */
  315. /*
  316. * Debugging output prototypes (default: no debug output).
  317. *
  318. * All interfaces related to debug output messages
  319. * will be configured out of the ACPICA build unless the
  320. * ACPI_DEBUG_OUTPUT flag is defined.
  321. */
  322. #ifdef ACPI_DEBUG_OUTPUT
  323. #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
  324. prototype;
  325. #else
  326. #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
  327. static ACPI_INLINE prototype {return;}
  328. #endif /* ACPI_DEBUG_OUTPUT */
  329. /*
  330. * Application prototypes
  331. *
  332. * All interfaces used by application will be configured
  333. * out of the ACPICA build unless the ACPI_APPLICATION
  334. * flag is defined.
  335. */
  336. #ifdef ACPI_APPLICATION
  337. #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
  338. prototype;
  339. #else
  340. #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
  341. static ACPI_INLINE prototype {return;}
  342. #endif /* ACPI_APPLICATION */
  343. /*
  344. * Debugger prototypes
  345. *
  346. * All interfaces used by debugger will be configured
  347. * out of the ACPICA build unless the ACPI_DEBUGGER
  348. * flag is defined.
  349. */
  350. #ifdef ACPI_DEBUGGER
  351. #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
  352. ACPI_EXTERNAL_RETURN_OK(prototype)
  353. #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
  354. ACPI_EXTERNAL_RETURN_VOID(prototype)
  355. #else
  356. #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
  357. static ACPI_INLINE prototype {return(AE_OK);}
  358. #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
  359. static ACPI_INLINE prototype {return;}
  360. #endif /* ACPI_DEBUGGER */
  361. /*****************************************************************************
  362. *
  363. * ACPICA public interface prototypes
  364. *
  365. ****************************************************************************/
  366. /*
  367. * Initialization
  368. */
  369. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  370. acpi_initialize_tables(struct acpi_table_desc
  371. *initial_storage,
  372. u32 initial_table_count,
  373. u8 allow_resize))
  374. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  375. acpi_initialize_subsystem(void))
  376. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  377. acpi_enable_subsystem(u32 flags))
  378. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  379. acpi_initialize_objects(u32 flags))
  380. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  381. acpi_terminate(void))
  382. /*
  383. * Miscellaneous global interfaces
  384. */
  385. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
  386. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
  387. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
  388. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  389. acpi_get_system_info(struct acpi_buffer
  390. *ret_buffer))
  391. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  392. acpi_get_statistics(struct acpi_statistics *stats))
  393. ACPI_EXTERNAL_RETURN_PTR(const char
  394. *acpi_format_exception(acpi_status exception))
  395. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
  396. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  397. acpi_install_interface(acpi_string interface_name))
  398. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  399. acpi_remove_interface(acpi_string interface_name))
  400. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
  401. ACPI_EXTERNAL_RETURN_UINT32(u32
  402. acpi_check_address_range(acpi_adr_space_type
  403. space_id,
  404. acpi_physical_address
  405. address, acpi_size length,
  406. u8 warn))
  407. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  408. acpi_decode_pld_buffer(u8 *in_buffer,
  409. acpi_size length,
  410. struct acpi_pld_info
  411. **return_buffer))
  412. /*
  413. * ACPI table load/unload interfaces
  414. */
  415. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  416. acpi_install_table(acpi_physical_address address,
  417. u8 physical))
  418. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  419. acpi_load_table(struct acpi_table_header *table))
  420. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  421. acpi_unload_parent_table(acpi_handle object))
  422. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  423. acpi_load_tables(void))
  424. /*
  425. * ACPI table manipulation interfaces
  426. */
  427. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  428. acpi_reallocate_root_table(void))
  429. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  430. acpi_find_root_pointer(acpi_physical_address
  431. *rsdp_address))
  432. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  433. acpi_get_table_header(acpi_string signature,
  434. u32 instance,
  435. struct acpi_table_header
  436. *out_table_header))
  437. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  438. acpi_get_table(acpi_string signature, u32 instance,
  439. struct acpi_table_header
  440. **out_table))
  441. ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table))
  442. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  443. acpi_get_table_by_index(u32 table_index,
  444. struct acpi_table_header
  445. **out_table))
  446. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  447. acpi_install_table_handler(acpi_table_handler
  448. handler, void *context))
  449. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  450. acpi_remove_table_handler(acpi_table_handler
  451. handler))
  452. /*
  453. * Namespace and name interfaces
  454. */
  455. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  456. acpi_walk_namespace(acpi_object_type type,
  457. acpi_handle start_object,
  458. u32 max_depth,
  459. acpi_walk_callback
  460. descending_callback,
  461. acpi_walk_callback
  462. ascending_callback,
  463. void *context,
  464. void **return_value))
  465. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  466. acpi_get_devices(const char *HID,
  467. acpi_walk_callback user_function,
  468. void *context,
  469. void **return_value))
  470. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  471. acpi_get_name(acpi_handle object, u32 name_type,
  472. struct acpi_buffer *ret_path_ptr))
  473. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  474. acpi_get_handle(acpi_handle parent,
  475. acpi_string pathname,
  476. acpi_handle *ret_handle))
  477. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  478. acpi_attach_data(acpi_handle object,
  479. acpi_object_handler handler,
  480. void *data))
  481. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  482. acpi_detach_data(acpi_handle object,
  483. acpi_object_handler handler))
  484. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  485. acpi_get_data(acpi_handle object,
  486. acpi_object_handler handler,
  487. void **data))
  488. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  489. acpi_debug_trace(const char *name, u32 debug_level,
  490. u32 debug_layer, u32 flags))
  491. /*
  492. * Object manipulation and enumeration
  493. */
  494. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  495. acpi_evaluate_object(acpi_handle object,
  496. acpi_string pathname,
  497. struct acpi_object_list
  498. *parameter_objects,
  499. struct acpi_buffer
  500. *return_object_buffer))
  501. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  502. acpi_evaluate_object_typed(acpi_handle object,
  503. acpi_string pathname,
  504. struct acpi_object_list
  505. *external_params,
  506. struct acpi_buffer
  507. *return_buffer,
  508. acpi_object_type
  509. return_type))
  510. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  511. acpi_get_object_info(acpi_handle object,
  512. struct acpi_device_info
  513. **return_buffer))
  514. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
  515. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  516. acpi_get_next_object(acpi_object_type type,
  517. acpi_handle parent,
  518. acpi_handle child,
  519. acpi_handle *out_handle))
  520. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  521. acpi_get_type(acpi_handle object,
  522. acpi_object_type *out_type))
  523. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  524. acpi_get_parent(acpi_handle object,
  525. acpi_handle *out_handle))
  526. /*
  527. * Handler interfaces
  528. */
  529. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  530. acpi_install_initialization_handler
  531. (acpi_init_handler handler, u32 function))
  532. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  533. acpi_install_sci_handler(acpi_sci_handler
  534. address,
  535. void *context))
  536. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  537. acpi_remove_sci_handler(acpi_sci_handler
  538. address))
  539. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  540. acpi_install_global_event_handler
  541. (acpi_gbl_event_handler handler,
  542. void *context))
  543. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  544. acpi_install_fixed_event_handler(u32
  545. acpi_event,
  546. acpi_event_handler
  547. handler,
  548. void
  549. *context))
  550. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  551. acpi_remove_fixed_event_handler(u32 acpi_event,
  552. acpi_event_handler
  553. handler))
  554. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  555. acpi_install_gpe_handler(acpi_handle
  556. gpe_device,
  557. u32 gpe_number,
  558. u32 type,
  559. acpi_gpe_handler
  560. address,
  561. void *context))
  562. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  563. acpi_install_gpe_raw_handler(acpi_handle
  564. gpe_device,
  565. u32 gpe_number,
  566. u32 type,
  567. acpi_gpe_handler
  568. address,
  569. void *context))
  570. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  571. acpi_remove_gpe_handler(acpi_handle gpe_device,
  572. u32 gpe_number,
  573. acpi_gpe_handler
  574. address))
  575. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  576. acpi_install_notify_handler(acpi_handle device,
  577. u32 handler_type,
  578. acpi_notify_handler
  579. handler,
  580. void *context))
  581. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  582. acpi_remove_notify_handler(acpi_handle device,
  583. u32 handler_type,
  584. acpi_notify_handler
  585. handler))
  586. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  587. acpi_install_address_space_handler(acpi_handle
  588. device,
  589. acpi_adr_space_type
  590. space_id,
  591. acpi_adr_space_handler
  592. handler,
  593. acpi_adr_space_setup
  594. setup,
  595. void *context))
  596. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  597. acpi_remove_address_space_handler(acpi_handle
  598. device,
  599. acpi_adr_space_type
  600. space_id,
  601. acpi_adr_space_handler
  602. handler))
  603. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  604. acpi_install_exception_handler
  605. (acpi_exception_handler handler))
  606. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  607. acpi_install_interface_handler
  608. (acpi_interface_handler handler))
  609. /*
  610. * Global Lock interfaces
  611. */
  612. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  613. acpi_acquire_global_lock(u16 timeout,
  614. u32 *handle))
  615. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  616. acpi_release_global_lock(u32 handle))
  617. /*
  618. * Interfaces to AML mutex objects
  619. */
  620. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  621. acpi_acquire_mutex(acpi_handle handle,
  622. acpi_string pathname,
  623. u16 timeout))
  624. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  625. acpi_release_mutex(acpi_handle handle,
  626. acpi_string pathname))
  627. /*
  628. * Fixed Event interfaces
  629. */
  630. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  631. acpi_enable_event(u32 event, u32 flags))
  632. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  633. acpi_disable_event(u32 event, u32 flags))
  634. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
  635. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  636. acpi_get_event_status(u32 event,
  637. acpi_event_status
  638. *event_status))
  639. /*
  640. * General Purpose Event (GPE) Interfaces
  641. */
  642. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
  643. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  644. acpi_enable_gpe(acpi_handle gpe_device,
  645. u32 gpe_number))
  646. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  647. acpi_disable_gpe(acpi_handle gpe_device,
  648. u32 gpe_number))
  649. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  650. acpi_clear_gpe(acpi_handle gpe_device,
  651. u32 gpe_number))
  652. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  653. acpi_set_gpe(acpi_handle gpe_device,
  654. u32 gpe_number, u8 action))
  655. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  656. acpi_finish_gpe(acpi_handle gpe_device,
  657. u32 gpe_number))
  658. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  659. acpi_mask_gpe(acpi_handle gpe_device,
  660. u32 gpe_number, u8 is_masked))
  661. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  662. acpi_mark_gpe_for_wake(acpi_handle gpe_device,
  663. u32 gpe_number))
  664. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  665. acpi_setup_gpe_for_wake(acpi_handle
  666. parent_device,
  667. acpi_handle gpe_device,
  668. u32 gpe_number))
  669. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  670. acpi_set_gpe_wake_mask(acpi_handle gpe_device,
  671. u32 gpe_number,
  672. u8 action))
  673. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  674. acpi_get_gpe_status(acpi_handle gpe_device,
  675. u32 gpe_number,
  676. acpi_event_status
  677. *event_status))
  678. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
  679. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
  680. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
  681. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  682. acpi_get_gpe_device(u32 gpe_index,
  683. acpi_handle *gpe_device))
  684. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  685. acpi_install_gpe_block(acpi_handle gpe_device,
  686. struct
  687. acpi_generic_address
  688. *gpe_block_address,
  689. u32 register_count,
  690. u32 interrupt_number))
  691. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  692. acpi_remove_gpe_block(acpi_handle gpe_device))
  693. /*
  694. * Resource interfaces
  695. */
  696. typedef
  697. acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource,
  698. void *context);
  699. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  700. acpi_get_vendor_resource(acpi_handle device,
  701. char *name,
  702. struct acpi_vendor_uuid
  703. *uuid,
  704. struct acpi_buffer
  705. *ret_buffer))
  706. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  707. acpi_get_current_resources(acpi_handle device,
  708. struct acpi_buffer
  709. *ret_buffer))
  710. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  711. acpi_get_possible_resources(acpi_handle device,
  712. struct acpi_buffer
  713. *ret_buffer))
  714. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  715. acpi_get_event_resources(acpi_handle device_handle,
  716. struct acpi_buffer
  717. *ret_buffer))
  718. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  719. acpi_walk_resource_buffer(struct acpi_buffer
  720. *buffer,
  721. acpi_walk_resource_callback
  722. user_function,
  723. void *context))
  724. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  725. acpi_walk_resources(acpi_handle device, char *name,
  726. acpi_walk_resource_callback
  727. user_function, void *context))
  728. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  729. acpi_set_current_resources(acpi_handle device,
  730. struct acpi_buffer
  731. *in_buffer))
  732. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  733. acpi_get_irq_routing_table(acpi_handle device,
  734. struct acpi_buffer
  735. *ret_buffer))
  736. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  737. acpi_resource_to_address64(struct acpi_resource
  738. *resource,
  739. struct
  740. acpi_resource_address64
  741. *out))
  742. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  743. acpi_buffer_to_resource(u8 *aml_buffer,
  744. u16 aml_buffer_length,
  745. struct acpi_resource
  746. **resource_ptr))
  747. /*
  748. * Hardware (ACPI device) interfaces
  749. */
  750. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
  751. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  752. acpi_read(u64 *value,
  753. struct acpi_generic_address *reg))
  754. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  755. acpi_write(u64 value,
  756. struct acpi_generic_address *reg))
  757. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  758. acpi_read_bit_register(u32 register_id,
  759. u32 *return_value))
  760. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  761. acpi_write_bit_register(u32 register_id,
  762. u32 value))
  763. /*
  764. * Sleep/Wake interfaces
  765. */
  766. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  767. acpi_get_sleep_type_data(u8 sleep_state,
  768. u8 *slp_typ_a,
  769. u8 *slp_typ_b))
  770. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  771. acpi_enter_sleep_state_prep(u8 sleep_state))
  772. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
  773. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
  774. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  775. acpi_leave_sleep_state_prep(u8 sleep_state))
  776. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
  777. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  778. acpi_set_firmware_waking_vector
  779. (acpi_physical_address physical_address,
  780. acpi_physical_address physical_address64))
  781. /*
  782. * ACPI Timer interfaces
  783. */
  784. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  785. acpi_get_timer_resolution(u32 *resolution))
  786. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
  787. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  788. acpi_get_timer_duration(u32 start_ticks,
  789. u32 end_ticks,
  790. u32 *time_elapsed))
  791. /*
  792. * Error/Warning output
  793. */
  794. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  795. void ACPI_INTERNAL_VAR_XFACE
  796. acpi_error(const char *module_name,
  797. u32 line_number,
  798. const char *format, ...))
  799. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
  800. void ACPI_INTERNAL_VAR_XFACE
  801. acpi_exception(const char *module_name,
  802. u32 line_number,
  803. acpi_status status,
  804. const char *format, ...))
  805. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  806. void ACPI_INTERNAL_VAR_XFACE
  807. acpi_warning(const char *module_name,
  808. u32 line_number,
  809. const char *format, ...))
  810. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
  811. void ACPI_INTERNAL_VAR_XFACE
  812. acpi_info(const char *format, ...))
  813. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  814. void ACPI_INTERNAL_VAR_XFACE
  815. acpi_bios_error(const char *module_name,
  816. u32 line_number,
  817. const char *format, ...))
  818. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  819. void ACPI_INTERNAL_VAR_XFACE
  820. acpi_bios_warning(const char *module_name,
  821. u32 line_number,
  822. const char *format, ...))
  823. /*
  824. * Debug output
  825. */
  826. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  827. void ACPI_INTERNAL_VAR_XFACE
  828. acpi_debug_print(u32 requested_debug_level,
  829. u32 line_number,
  830. const char *function_name,
  831. const char *module_name,
  832. u32 component_id,
  833. const char *format, ...))
  834. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  835. void ACPI_INTERNAL_VAR_XFACE
  836. acpi_debug_print_raw(u32 requested_debug_level,
  837. u32 line_number,
  838. const char *function_name,
  839. const char *module_name,
  840. u32 component_id,
  841. const char *format, ...))
  842. ACPI_DBG_DEPENDENT_RETURN_VOID(void
  843. acpi_trace_point(acpi_trace_event_type type,
  844. u8 begin,
  845. u8 *aml, char *pathname))
  846. acpi_status acpi_initialize_debugger(void);
  847. void acpi_terminate_debugger(void);
  848. /*
  849. * Divergences
  850. */
  851. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  852. acpi_get_data_full(acpi_handle object,
  853. acpi_object_handler handler,
  854. void **data,
  855. void (*callback)(void *)))
  856. void acpi_run_debugger(char *batch_buffer);
  857. void acpi_set_debugger_thread_id(acpi_thread_id thread_id);
  858. #endif /* __ACXFACE_H__ */