acpixf.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. /******************************************************************************
  2. *
  3. * Name: acpixf.h - External interfaces to the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2014, 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 0x20140424
  46. #include <acpi/acconfig.h>
  47. #include <acpi/actypes.h>
  48. #include <acpi/actbl.h>
  49. #include <acpi/acbuffer.h>
  50. extern u8 acpi_gbl_permanent_mmap;
  51. /*****************************************************************************
  52. *
  53. * Macros used for ACPICA globals and configuration
  54. *
  55. ****************************************************************************/
  56. /*
  57. * Ensure that global variables are defined and initialized only once.
  58. *
  59. * The use of these macros allows for a single list of globals (here)
  60. * in order to simplify maintenance of the code.
  61. */
  62. #ifdef DEFINE_ACPI_GLOBALS
  63. #define ACPI_GLOBAL(type,name) \
  64. extern type name; \
  65. type name
  66. #define ACPI_INIT_GLOBAL(type,name,value) \
  67. type name=value
  68. #else
  69. #ifndef ACPI_GLOBAL
  70. #define ACPI_GLOBAL(type,name) \
  71. extern type name
  72. #endif
  73. #ifndef ACPI_INIT_GLOBAL
  74. #define ACPI_INIT_GLOBAL(type,name,value) \
  75. extern type name
  76. #endif
  77. #endif
  78. /*
  79. * These macros configure the various ACPICA interfaces. They are
  80. * useful for generating stub inline functions for features that are
  81. * configured out of the current kernel or ACPICA application.
  82. */
  83. #ifndef ACPI_EXTERNAL_RETURN_STATUS
  84. #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
  85. prototype;
  86. #endif
  87. #ifndef ACPI_EXTERNAL_RETURN_OK
  88. #define ACPI_EXTERNAL_RETURN_OK(prototype) \
  89. prototype;
  90. #endif
  91. #ifndef ACPI_EXTERNAL_RETURN_VOID
  92. #define ACPI_EXTERNAL_RETURN_VOID(prototype) \
  93. prototype;
  94. #endif
  95. #ifndef ACPI_EXTERNAL_RETURN_UINT32
  96. #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
  97. prototype;
  98. #endif
  99. #ifndef ACPI_EXTERNAL_RETURN_PTR
  100. #define ACPI_EXTERNAL_RETURN_PTR(prototype) \
  101. prototype;
  102. #endif
  103. /*****************************************************************************
  104. *
  105. * Public globals and runtime configuration options
  106. *
  107. ****************************************************************************/
  108. /*
  109. * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
  110. * interpreter strictly follows the ACPI specification. Setting to TRUE
  111. * allows the interpreter to ignore certain errors and/or bad AML constructs.
  112. *
  113. * Currently, these features are enabled by this flag:
  114. *
  115. * 1) Allow "implicit return" of last value in a control method
  116. * 2) Allow access beyond the end of an operation region
  117. * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
  118. * 4) Allow ANY object type to be a source operand for the Store() operator
  119. * 5) Allow unresolved references (invalid target name) in package objects
  120. * 6) Enable warning messages for behavior that is not ACPI spec compliant
  121. */
  122. ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
  123. /*
  124. * Automatically serialize all methods that create named objects? Default
  125. * is TRUE, meaning that all non_serialized methods are scanned once at
  126. * table load time to determine those that create named objects. Methods
  127. * that create named objects are marked Serialized in order to prevent
  128. * possible run-time problems if they are entered by more than one thread.
  129. */
  130. ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
  131. /*
  132. * Create the predefined _OSI method in the namespace? Default is TRUE
  133. * because ACPICA is fully compatible with other ACPI implementations.
  134. * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
  135. */
  136. ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
  137. /*
  138. * Optionally use default values for the ACPI register widths. Set this to
  139. * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
  140. */
  141. ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
  142. /*
  143. * Whether or not to verify the table checksum before installation. Set
  144. * this to TRUE to verify the table checksum before install it to the table
  145. * manager. Note that enabling this option causes errors to happen in some
  146. * OSPMs during early initialization stages. Default behavior is to do such
  147. * verification.
  148. */
  149. ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, 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 use 32-bit FADT addresses if and when there is a conflict
  170. * (address mismatch) between the 32-bit and 64-bit versions of the
  171. * address. Although ACPICA adheres to the ACPI specification which
  172. * requires the use of the corresponding 64-bit address if it is non-zero,
  173. * some machines have been found to have a corrupted non-zero 64-bit
  174. * address. Default is TRUE, favor the 32-bit addresses.
  175. */
  176. ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, TRUE);
  177. /*
  178. * Optionally truncate I/O addresses to 16 bits. Provides compatibility
  179. * with other ACPI implementations. NOTE: During ACPICA initialization,
  180. * this value is set to TRUE if any Windows OSI strings have been
  181. * requested by the BIOS.
  182. */
  183. ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
  184. /*
  185. * Disable runtime checking and repair of values returned by control methods.
  186. * Use only if the repair is causing a problem on a particular machine.
  187. */
  188. ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
  189. /*
  190. * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
  191. * This can be useful for debugging ACPI problems on some machines.
  192. */
  193. ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
  194. /*
  195. * We keep track of the latest version of Windows that has been requested by
  196. * the BIOS. ACPI 5.0.
  197. */
  198. ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
  199. /*
  200. * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
  201. * that the ACPI hardware is no longer required. A flag in the FADT indicates
  202. * a reduced HW machine, and that flag is duplicated here for convenience.
  203. */
  204. ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
  205. /*
  206. * This mechanism is used to trace a specified AML method. The method is
  207. * traced each time it is executed.
  208. */
  209. ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
  210. ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0);
  211. /*
  212. * Runtime configuration of debug output control masks. We want the debug
  213. * switches statically initialized so they are already set when the debugger
  214. * is entered.
  215. */
  216. ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
  217. ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
  218. /*
  219. * Other miscellaneous globals
  220. */
  221. ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
  222. ACPI_GLOBAL(u32, acpi_current_gpe_count);
  223. ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
  224. /*****************************************************************************
  225. *
  226. * ACPICA public interface configuration.
  227. *
  228. * Interfaces that are configured out of the ACPICA build are replaced
  229. * by inlined stubs by default.
  230. *
  231. ****************************************************************************/
  232. /*
  233. * Hardware-reduced prototypes (default: Not hardware reduced).
  234. *
  235. * All ACPICA hardware-related interfaces that use these macros will be
  236. * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
  237. * is set to TRUE.
  238. *
  239. * Note: This static build option for reduced hardware is intended to
  240. * reduce ACPICA code size if desired or necessary. However, even if this
  241. * option is not specified, the runtime behavior of ACPICA is dependent
  242. * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
  243. * the flag will enable similar behavior -- ACPICA will not attempt
  244. * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
  245. */
  246. #if (!ACPI_REDUCED_HARDWARE)
  247. #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
  248. ACPI_EXTERNAL_RETURN_STATUS(prototype)
  249. #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
  250. ACPI_EXTERNAL_RETURN_OK(prototype)
  251. #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
  252. ACPI_EXTERNAL_RETURN_VOID(prototype)
  253. #else
  254. #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
  255. static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
  256. #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
  257. static ACPI_INLINE prototype {return(AE_OK);}
  258. #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
  259. static ACPI_INLINE prototype {return;}
  260. #endif /* !ACPI_REDUCED_HARDWARE */
  261. /*
  262. * Error message prototypes (default: error messages enabled).
  263. *
  264. * All interfaces related to error and warning messages
  265. * will be configured out of the ACPICA build if the
  266. * ACPI_NO_ERROR_MESSAGE flag is defined.
  267. */
  268. #ifndef ACPI_NO_ERROR_MESSAGES
  269. #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
  270. prototype;
  271. #else
  272. #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
  273. static ACPI_INLINE prototype {return;}
  274. #endif /* ACPI_NO_ERROR_MESSAGES */
  275. /*
  276. * Debugging output prototypes (default: no debug output).
  277. *
  278. * All interfaces related to debug output messages
  279. * will be configured out of the ACPICA build unless the
  280. * ACPI_DEBUG_OUTPUT flag is defined.
  281. */
  282. #ifdef ACPI_DEBUG_OUTPUT
  283. #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
  284. prototype;
  285. #else
  286. #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
  287. static ACPI_INLINE prototype {return;}
  288. #endif /* ACPI_DEBUG_OUTPUT */
  289. /*****************************************************************************
  290. *
  291. * ACPICA public interface prototypes
  292. *
  293. ****************************************************************************/
  294. /*
  295. * Initialization
  296. */
  297. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
  298. acpi_initialize_tables(struct acpi_table_desc
  299. *initial_storage,
  300. u32 initial_table_count,
  301. u8 allow_resize))
  302. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void))
  303. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags))
  304. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
  305. acpi_initialize_objects(u32 flags))
  306. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void))
  307. /*
  308. * Miscellaneous global interfaces
  309. */
  310. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
  311. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
  312. #ifdef ACPI_FUTURE_USAGE
  313. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
  314. #endif
  315. #ifdef ACPI_FUTURE_USAGE
  316. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  317. acpi_get_system_info(struct acpi_buffer
  318. *ret_buffer))
  319. #endif
  320. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  321. acpi_get_statistics(struct acpi_statistics *stats))
  322. ACPI_EXTERNAL_RETURN_PTR(const char
  323. *acpi_format_exception(acpi_status exception))
  324. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
  325. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  326. acpi_install_interface(acpi_string interface_name))
  327. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  328. acpi_remove_interface(acpi_string interface_name))
  329. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
  330. ACPI_EXTERNAL_RETURN_UINT32(u32
  331. acpi_check_address_range(acpi_adr_space_type
  332. space_id,
  333. acpi_physical_address
  334. address, acpi_size length,
  335. u8 warn))
  336. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  337. acpi_decode_pld_buffer(u8 *in_buffer,
  338. acpi_size length,
  339. struct acpi_pld_info
  340. **return_buffer))
  341. /*
  342. * ACPI table load/unload interfaces
  343. */
  344. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
  345. acpi_install_table(acpi_physical_address address,
  346. u8 physical))
  347. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  348. acpi_load_table(struct acpi_table_header *table))
  349. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  350. acpi_unload_parent_table(acpi_handle object))
  351. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void))
  352. /*
  353. * ACPI table manipulation interfaces
  354. */
  355. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void))
  356. ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
  357. acpi_find_root_pointer(acpi_size * rsdp_address))
  358. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  359. acpi_get_table_header(acpi_string signature,
  360. u32 instance,
  361. struct acpi_table_header
  362. *out_table_header))
  363. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  364. acpi_get_table(acpi_string signature, u32 instance,
  365. struct acpi_table_header
  366. **out_table))
  367. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  368. acpi_get_table_by_index(u32 table_index,
  369. struct acpi_table_header
  370. **out_table))
  371. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  372. acpi_install_table_handler(acpi_table_handler
  373. handler, void *context))
  374. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  375. acpi_remove_table_handler(acpi_table_handler
  376. handler))
  377. /*
  378. * Namespace and name interfaces
  379. */
  380. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  381. acpi_walk_namespace(acpi_object_type type,
  382. acpi_handle start_object,
  383. u32 max_depth,
  384. acpi_walk_callback
  385. descending_callback,
  386. acpi_walk_callback
  387. ascending_callback,
  388. void *context,
  389. void **return_value))
  390. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  391. acpi_get_devices(const char *HID,
  392. acpi_walk_callback user_function,
  393. void *context,
  394. void **return_value))
  395. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  396. acpi_get_name(acpi_handle object, u32 name_type,
  397. struct acpi_buffer *ret_path_ptr))
  398. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  399. acpi_get_handle(acpi_handle parent,
  400. acpi_string pathname,
  401. acpi_handle * ret_handle))
  402. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  403. acpi_attach_data(acpi_handle object,
  404. acpi_object_handler handler,
  405. void *data))
  406. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  407. acpi_detach_data(acpi_handle object,
  408. acpi_object_handler handler))
  409. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  410. acpi_get_data(acpi_handle object,
  411. acpi_object_handler handler,
  412. void **data))
  413. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  414. acpi_debug_trace(char *name, u32 debug_level,
  415. u32 debug_layer, u32 flags))
  416. /*
  417. * Object manipulation and enumeration
  418. */
  419. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  420. acpi_evaluate_object(acpi_handle object,
  421. acpi_string pathname,
  422. struct acpi_object_list
  423. *parameter_objects,
  424. struct acpi_buffer
  425. *return_object_buffer))
  426. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  427. acpi_evaluate_object_typed(acpi_handle object,
  428. acpi_string pathname,
  429. struct acpi_object_list
  430. *external_params,
  431. struct acpi_buffer
  432. *return_buffer,
  433. acpi_object_type
  434. return_type))
  435. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  436. acpi_get_object_info(acpi_handle object,
  437. struct acpi_device_info
  438. **return_buffer))
  439. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
  440. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  441. acpi_get_next_object(acpi_object_type type,
  442. acpi_handle parent,
  443. acpi_handle child,
  444. acpi_handle * out_handle))
  445. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  446. acpi_get_type(acpi_handle object,
  447. acpi_object_type * out_type))
  448. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  449. acpi_get_parent(acpi_handle object,
  450. acpi_handle * out_handle))
  451. /*
  452. * Handler interfaces
  453. */
  454. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  455. acpi_install_initialization_handler
  456. (acpi_init_handler handler, u32 function))
  457. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  458. acpi_install_sci_handler(acpi_sci_handler
  459. address,
  460. void *context))
  461. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  462. acpi_remove_sci_handler(acpi_sci_handler
  463. address))
  464. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  465. acpi_install_global_event_handler
  466. (acpi_gbl_event_handler handler,
  467. void *context))
  468. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  469. acpi_install_fixed_event_handler(u32
  470. acpi_event,
  471. acpi_event_handler
  472. handler,
  473. void
  474. *context))
  475. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  476. acpi_remove_fixed_event_handler(u32 acpi_event,
  477. acpi_event_handler
  478. handler))
  479. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  480. acpi_install_gpe_handler(acpi_handle
  481. gpe_device,
  482. u32 gpe_number,
  483. u32 type,
  484. acpi_gpe_handler
  485. address,
  486. void *context))
  487. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  488. acpi_remove_gpe_handler(acpi_handle gpe_device,
  489. u32 gpe_number,
  490. acpi_gpe_handler
  491. address))
  492. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  493. acpi_install_notify_handler(acpi_handle device,
  494. u32 handler_type,
  495. acpi_notify_handler
  496. handler,
  497. void *context))
  498. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  499. acpi_remove_notify_handler(acpi_handle device,
  500. u32 handler_type,
  501. acpi_notify_handler
  502. handler))
  503. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  504. acpi_install_address_space_handler(acpi_handle
  505. device,
  506. acpi_adr_space_type
  507. space_id,
  508. acpi_adr_space_handler
  509. handler,
  510. acpi_adr_space_setup
  511. setup,
  512. void *context))
  513. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  514. acpi_remove_address_space_handler(acpi_handle
  515. device,
  516. acpi_adr_space_type
  517. space_id,
  518. acpi_adr_space_handler
  519. handler))
  520. #ifdef ACPI_FUTURE_USAGE
  521. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  522. acpi_install_exception_handler
  523. (acpi_exception_handler handler))
  524. #endif
  525. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  526. acpi_install_interface_handler
  527. (acpi_interface_handler handler))
  528. /*
  529. * Global Lock interfaces
  530. */
  531. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  532. acpi_acquire_global_lock(u16 timeout,
  533. u32 *handle))
  534. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  535. acpi_release_global_lock(u32 handle))
  536. /*
  537. * Interfaces to AML mutex objects
  538. */
  539. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  540. acpi_acquire_mutex(acpi_handle handle,
  541. acpi_string pathname,
  542. u16 timeout))
  543. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  544. acpi_release_mutex(acpi_handle handle,
  545. acpi_string pathname))
  546. /*
  547. * Fixed Event interfaces
  548. */
  549. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  550. acpi_enable_event(u32 event, u32 flags))
  551. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  552. acpi_disable_event(u32 event, u32 flags))
  553. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
  554. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  555. acpi_get_event_status(u32 event,
  556. acpi_event_status
  557. *event_status))
  558. /*
  559. * General Purpose Event (GPE) Interfaces
  560. */
  561. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
  562. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  563. acpi_enable_gpe(acpi_handle gpe_device,
  564. u32 gpe_number))
  565. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  566. acpi_disable_gpe(acpi_handle gpe_device,
  567. u32 gpe_number))
  568. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  569. acpi_clear_gpe(acpi_handle gpe_device,
  570. u32 gpe_number))
  571. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  572. acpi_set_gpe(acpi_handle gpe_device,
  573. u32 gpe_number, u8 action))
  574. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  575. acpi_finish_gpe(acpi_handle gpe_device,
  576. u32 gpe_number))
  577. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  578. acpi_setup_gpe_for_wake(acpi_handle
  579. parent_device,
  580. acpi_handle gpe_device,
  581. u32 gpe_number))
  582. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  583. acpi_set_gpe_wake_mask(acpi_handle gpe_device,
  584. u32 gpe_number,
  585. u8 action))
  586. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  587. acpi_get_gpe_status(acpi_handle gpe_device,
  588. u32 gpe_number,
  589. acpi_event_status
  590. *event_status))
  591. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
  592. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
  593. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  594. acpi_get_gpe_device(u32 gpe_index,
  595. acpi_handle * gpe_device))
  596. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  597. acpi_install_gpe_block(acpi_handle gpe_device,
  598. struct
  599. acpi_generic_address
  600. *gpe_block_address,
  601. u32 register_count,
  602. u32 interrupt_number))
  603. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  604. acpi_remove_gpe_block(acpi_handle gpe_device))
  605. /*
  606. * Resource interfaces
  607. */
  608. typedef
  609. acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
  610. void *context);
  611. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  612. acpi_get_vendor_resource(acpi_handle device,
  613. char *name,
  614. struct acpi_vendor_uuid
  615. *uuid,
  616. struct acpi_buffer
  617. *ret_buffer))
  618. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  619. acpi_get_current_resources(acpi_handle device,
  620. struct acpi_buffer
  621. *ret_buffer))
  622. #ifdef ACPI_FUTURE_USAGE
  623. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  624. acpi_get_possible_resources(acpi_handle device,
  625. struct acpi_buffer
  626. *ret_buffer))
  627. #endif
  628. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  629. acpi_get_event_resources(acpi_handle device_handle,
  630. struct acpi_buffer
  631. *ret_buffer))
  632. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  633. acpi_walk_resource_buffer(struct acpi_buffer
  634. *buffer,
  635. acpi_walk_resource_callback
  636. user_function,
  637. void *context))
  638. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  639. acpi_walk_resources(acpi_handle device, char *name,
  640. acpi_walk_resource_callback
  641. user_function, void *context))
  642. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  643. acpi_set_current_resources(acpi_handle device,
  644. struct acpi_buffer
  645. *in_buffer))
  646. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  647. acpi_get_irq_routing_table(acpi_handle device,
  648. struct acpi_buffer
  649. *ret_buffer))
  650. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  651. acpi_resource_to_address64(struct acpi_resource
  652. *resource,
  653. struct
  654. acpi_resource_address64
  655. *out))
  656. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  657. acpi_buffer_to_resource(u8 *aml_buffer,
  658. u16 aml_buffer_length,
  659. struct acpi_resource
  660. **resource_ptr))
  661. /*
  662. * Hardware (ACPI device) interfaces
  663. */
  664. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
  665. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  666. acpi_read(u64 *value,
  667. struct acpi_generic_address *reg))
  668. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  669. acpi_write(u64 value,
  670. struct acpi_generic_address *reg))
  671. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  672. acpi_read_bit_register(u32 register_id,
  673. u32 *return_value))
  674. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  675. acpi_write_bit_register(u32 register_id,
  676. u32 value))
  677. /*
  678. * Sleep/Wake interfaces
  679. */
  680. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  681. acpi_get_sleep_type_data(u8 sleep_state,
  682. u8 *slp_typ_a,
  683. u8 *slp_typ_b))
  684. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  685. acpi_enter_sleep_state_prep(u8 sleep_state))
  686. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
  687. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
  688. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  689. acpi_leave_sleep_state_prep(u8 sleep_state))
  690. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
  691. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  692. acpi_set_firmware_waking_vector(u32
  693. physical_address))
  694. #if ACPI_MACHINE_WIDTH == 64
  695. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  696. acpi_set_firmware_waking_vector64(u64
  697. physical_address))
  698. #endif
  699. /*
  700. * ACPI Timer interfaces
  701. */
  702. #ifdef ACPI_FUTURE_USAGE
  703. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  704. acpi_get_timer_resolution(u32 *resolution))
  705. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
  706. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  707. acpi_get_timer_duration(u32 start_ticks,
  708. u32 end_ticks,
  709. u32 *time_elapsed))
  710. #endif /* ACPI_FUTURE_USAGE */
  711. /*
  712. * Error/Warning output
  713. */
  714. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  715. void ACPI_INTERNAL_VAR_XFACE
  716. acpi_error(const char *module_name,
  717. u32 line_number,
  718. const char *format, ...))
  719. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
  720. void ACPI_INTERNAL_VAR_XFACE
  721. acpi_exception(const char *module_name,
  722. u32 line_number,
  723. acpi_status status,
  724. const char *format, ...))
  725. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  726. void ACPI_INTERNAL_VAR_XFACE
  727. acpi_warning(const char *module_name,
  728. u32 line_number,
  729. const char *format, ...))
  730. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  731. void ACPI_INTERNAL_VAR_XFACE
  732. acpi_info(const char *module_name,
  733. u32 line_number,
  734. const char *format, ...))
  735. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  736. void ACPI_INTERNAL_VAR_XFACE
  737. acpi_bios_error(const char *module_name,
  738. u32 line_number,
  739. const char *format, ...))
  740. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  741. void ACPI_INTERNAL_VAR_XFACE
  742. acpi_bios_warning(const char *module_name,
  743. u32 line_number,
  744. const char *format, ...))
  745. /*
  746. * Debug output
  747. */
  748. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  749. void ACPI_INTERNAL_VAR_XFACE
  750. acpi_debug_print(u32 requested_debug_level,
  751. u32 line_number,
  752. const char *function_name,
  753. const char *module_name,
  754. u32 component_id,
  755. const char *format, ...))
  756. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  757. void ACPI_INTERNAL_VAR_XFACE
  758. acpi_debug_print_raw(u32 requested_debug_level,
  759. u32 line_number,
  760. const char *function_name,
  761. const char *module_name,
  762. u32 component_id,
  763. const char *format, ...))
  764. /*
  765. * Divergences
  766. */
  767. acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
  768. acpi_status acpi_unload_table_id(acpi_owner_id id);
  769. acpi_status
  770. acpi_get_table_with_size(acpi_string signature,
  771. u32 instance, struct acpi_table_header **out_table,
  772. acpi_size *tbl_size);
  773. acpi_status
  774. acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data,
  775. void (*callback)(void *));
  776. #endif /* __ACXFACE_H__ */