acpixf.h 29 KB

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