acpixf.h 30 KB

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