acpixf.h 31 KB

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