acpixf.h 30 KB

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