acpixf.h 31 KB

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