acpixf.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  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 - 2022, 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 0x20220331
  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(struct acpi_table_header *table))
  387. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  388. acpi_install_physical_table(acpi_physical_address
  389. address))
  390. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  391. acpi_load_table(struct acpi_table_header *table,
  392. u32 *table_idx))
  393. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  394. acpi_unload_table(u32 table_index))
  395. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  396. acpi_unload_parent_table(acpi_handle object))
  397. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  398. acpi_load_tables(void))
  399. /*
  400. * ACPI table manipulation interfaces
  401. */
  402. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  403. acpi_reallocate_root_table(void))
  404. ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
  405. acpi_find_root_pointer(acpi_physical_address
  406. *rsdp_address))
  407. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  408. acpi_get_table_header(acpi_string signature,
  409. u32 instance,
  410. struct acpi_table_header
  411. *out_table_header))
  412. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  413. acpi_get_table(acpi_string signature, u32 instance,
  414. struct acpi_table_header
  415. **out_table))
  416. ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table))
  417. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  418. acpi_get_table_by_index(u32 table_index,
  419. struct acpi_table_header
  420. **out_table))
  421. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  422. acpi_install_table_handler(acpi_table_handler
  423. handler, void *context))
  424. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  425. acpi_remove_table_handler(acpi_table_handler
  426. handler))
  427. /*
  428. * Namespace and name interfaces
  429. */
  430. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  431. acpi_walk_namespace(acpi_object_type type,
  432. acpi_handle start_object,
  433. u32 max_depth,
  434. acpi_walk_callback
  435. descending_callback,
  436. acpi_walk_callback
  437. ascending_callback,
  438. void *context,
  439. void **return_value))
  440. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  441. acpi_get_devices(const char *HID,
  442. acpi_walk_callback user_function,
  443. void *context,
  444. void **return_value))
  445. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  446. acpi_get_name(acpi_handle object, u32 name_type,
  447. struct acpi_buffer *ret_path_ptr))
  448. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  449. acpi_get_handle(acpi_handle parent,
  450. acpi_string pathname,
  451. acpi_handle *ret_handle))
  452. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  453. acpi_attach_data(acpi_handle object,
  454. acpi_object_handler handler,
  455. void *data))
  456. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  457. acpi_detach_data(acpi_handle object,
  458. acpi_object_handler handler))
  459. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  460. acpi_get_data(acpi_handle object,
  461. acpi_object_handler handler,
  462. void **data))
  463. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  464. acpi_debug_trace(const char *name, u32 debug_level,
  465. u32 debug_layer, u32 flags))
  466. /*
  467. * Object manipulation and enumeration
  468. */
  469. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  470. acpi_evaluate_object(acpi_handle object,
  471. acpi_string pathname,
  472. struct acpi_object_list
  473. *parameter_objects,
  474. struct acpi_buffer
  475. *return_object_buffer))
  476. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  477. acpi_evaluate_object_typed(acpi_handle object,
  478. acpi_string pathname,
  479. struct acpi_object_list
  480. *external_params,
  481. struct acpi_buffer
  482. *return_buffer,
  483. acpi_object_type
  484. return_type))
  485. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  486. acpi_get_object_info(acpi_handle object,
  487. struct acpi_device_info
  488. **return_buffer))
  489. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
  490. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  491. acpi_get_next_object(acpi_object_type type,
  492. acpi_handle parent,
  493. acpi_handle child,
  494. acpi_handle *out_handle))
  495. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  496. acpi_get_type(acpi_handle object,
  497. acpi_object_type *out_type))
  498. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  499. acpi_get_parent(acpi_handle object,
  500. acpi_handle *out_handle))
  501. /*
  502. * Handler interfaces
  503. */
  504. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  505. acpi_install_initialization_handler
  506. (acpi_init_handler handler, u32 function))
  507. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  508. acpi_install_sci_handler(acpi_sci_handler
  509. address,
  510. void *context))
  511. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  512. acpi_remove_sci_handler(acpi_sci_handler
  513. address))
  514. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  515. acpi_install_global_event_handler
  516. (acpi_gbl_event_handler handler,
  517. void *context))
  518. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  519. acpi_install_fixed_event_handler(u32
  520. acpi_event,
  521. acpi_event_handler
  522. handler,
  523. void
  524. *context))
  525. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  526. acpi_remove_fixed_event_handler(u32 acpi_event,
  527. acpi_event_handler
  528. handler))
  529. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  530. acpi_install_gpe_handler(acpi_handle
  531. gpe_device,
  532. u32 gpe_number,
  533. u32 type,
  534. acpi_gpe_handler
  535. address,
  536. void *context))
  537. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  538. acpi_install_gpe_raw_handler(acpi_handle
  539. gpe_device,
  540. u32 gpe_number,
  541. u32 type,
  542. acpi_gpe_handler
  543. address,
  544. void *context))
  545. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  546. acpi_remove_gpe_handler(acpi_handle gpe_device,
  547. u32 gpe_number,
  548. acpi_gpe_handler
  549. address))
  550. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  551. acpi_install_notify_handler(acpi_handle device,
  552. u32 handler_type,
  553. acpi_notify_handler
  554. handler,
  555. void *context))
  556. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  557. acpi_remove_notify_handler(acpi_handle device,
  558. u32 handler_type,
  559. acpi_notify_handler
  560. handler))
  561. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  562. acpi_install_address_space_handler(acpi_handle
  563. device,
  564. acpi_adr_space_type
  565. space_id,
  566. acpi_adr_space_handler
  567. handler,
  568. acpi_adr_space_setup
  569. setup,
  570. void *context))
  571. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  572. acpi_remove_address_space_handler(acpi_handle
  573. device,
  574. acpi_adr_space_type
  575. space_id,
  576. acpi_adr_space_handler
  577. handler))
  578. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  579. acpi_install_exception_handler
  580. (acpi_exception_handler handler))
  581. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  582. acpi_install_interface_handler
  583. (acpi_interface_handler handler))
  584. /*
  585. * Global Lock interfaces
  586. */
  587. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  588. acpi_acquire_global_lock(u16 timeout,
  589. u32 *handle))
  590. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  591. acpi_release_global_lock(u32 handle))
  592. /*
  593. * Interfaces to AML mutex objects
  594. */
  595. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  596. acpi_acquire_mutex(acpi_handle handle,
  597. acpi_string pathname,
  598. u16 timeout))
  599. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  600. acpi_release_mutex(acpi_handle handle,
  601. acpi_string pathname))
  602. /*
  603. * Fixed Event interfaces
  604. */
  605. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  606. acpi_enable_event(u32 event, u32 flags))
  607. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  608. acpi_disable_event(u32 event, u32 flags))
  609. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
  610. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  611. acpi_get_event_status(u32 event,
  612. acpi_event_status
  613. *event_status))
  614. /*
  615. * General Purpose Event (GPE) Interfaces
  616. */
  617. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
  618. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  619. acpi_enable_gpe(acpi_handle gpe_device,
  620. u32 gpe_number))
  621. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  622. acpi_disable_gpe(acpi_handle gpe_device,
  623. u32 gpe_number))
  624. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  625. acpi_clear_gpe(acpi_handle gpe_device,
  626. u32 gpe_number))
  627. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  628. acpi_set_gpe(acpi_handle gpe_device,
  629. u32 gpe_number, u8 action))
  630. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  631. acpi_finish_gpe(acpi_handle gpe_device,
  632. u32 gpe_number))
  633. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  634. acpi_mask_gpe(acpi_handle gpe_device,
  635. u32 gpe_number, u8 is_masked))
  636. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  637. acpi_mark_gpe_for_wake(acpi_handle gpe_device,
  638. u32 gpe_number))
  639. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  640. acpi_setup_gpe_for_wake(acpi_handle
  641. parent_device,
  642. acpi_handle gpe_device,
  643. u32 gpe_number))
  644. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  645. acpi_set_gpe_wake_mask(acpi_handle gpe_device,
  646. u32 gpe_number,
  647. u8 action))
  648. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  649. acpi_get_gpe_status(acpi_handle gpe_device,
  650. u32 gpe_number,
  651. acpi_event_status
  652. *event_status))
  653. ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number))
  654. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_hw_disable_all_gpes(void))
  655. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
  656. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
  657. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
  658. ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_gpe_status_set(u32 gpe_skip_number))
  659. ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_fixed_event_status_set(void))
  660. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  661. acpi_get_gpe_device(u32 gpe_index,
  662. acpi_handle *gpe_device))
  663. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  664. acpi_install_gpe_block(acpi_handle gpe_device,
  665. struct
  666. acpi_generic_address
  667. *gpe_block_address,
  668. u32 register_count,
  669. u32 interrupt_number))
  670. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  671. acpi_remove_gpe_block(acpi_handle gpe_device))
  672. /*
  673. * Resource interfaces
  674. */
  675. typedef
  676. acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource,
  677. void *context);
  678. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  679. acpi_get_vendor_resource(acpi_handle device,
  680. char *name,
  681. struct acpi_vendor_uuid
  682. *uuid,
  683. struct acpi_buffer
  684. *ret_buffer))
  685. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  686. acpi_get_current_resources(acpi_handle device,
  687. struct acpi_buffer
  688. *ret_buffer))
  689. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  690. acpi_get_possible_resources(acpi_handle device,
  691. struct acpi_buffer
  692. *ret_buffer))
  693. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  694. acpi_get_event_resources(acpi_handle device_handle,
  695. struct acpi_buffer
  696. *ret_buffer))
  697. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  698. acpi_walk_resource_buffer(struct acpi_buffer
  699. *buffer,
  700. acpi_walk_resource_callback
  701. user_function,
  702. void *context))
  703. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  704. acpi_walk_resources(acpi_handle device, char *name,
  705. acpi_walk_resource_callback
  706. user_function, void *context))
  707. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  708. acpi_set_current_resources(acpi_handle device,
  709. struct acpi_buffer
  710. *in_buffer))
  711. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  712. acpi_get_irq_routing_table(acpi_handle device,
  713. struct acpi_buffer
  714. *ret_buffer))
  715. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  716. acpi_resource_to_address64(struct acpi_resource
  717. *resource,
  718. struct
  719. acpi_resource_address64
  720. *out))
  721. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  722. acpi_buffer_to_resource(u8 *aml_buffer,
  723. u16 aml_buffer_length,
  724. struct acpi_resource
  725. **resource_ptr))
  726. /*
  727. * Hardware (ACPI device) interfaces
  728. */
  729. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
  730. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  731. acpi_read(u64 *value,
  732. struct acpi_generic_address *reg))
  733. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  734. acpi_write(u64 value,
  735. struct acpi_generic_address *reg))
  736. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  737. acpi_read_bit_register(u32 register_id,
  738. u32 *return_value))
  739. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  740. acpi_write_bit_register(u32 register_id,
  741. u32 value))
  742. /*
  743. * Sleep/Wake interfaces
  744. */
  745. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  746. acpi_get_sleep_type_data(u8 sleep_state,
  747. u8 *slp_typ_a,
  748. u8 *slp_typ_b))
  749. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  750. acpi_enter_sleep_state_prep(u8 sleep_state))
  751. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
  752. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
  753. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  754. acpi_leave_sleep_state_prep(u8 sleep_state))
  755. ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
  756. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  757. acpi_set_firmware_waking_vector
  758. (acpi_physical_address physical_address,
  759. acpi_physical_address physical_address64))
  760. /*
  761. * ACPI Timer interfaces
  762. */
  763. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  764. acpi_get_timer_resolution(u32 *resolution))
  765. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
  766. ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  767. acpi_get_timer_duration(u32 start_ticks,
  768. u32 end_ticks,
  769. u32 *time_elapsed))
  770. /*
  771. * Error/Warning output
  772. */
  773. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  774. void ACPI_INTERNAL_VAR_XFACE
  775. acpi_error(const char *module_name,
  776. u32 line_number,
  777. const char *format, ...))
  778. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
  779. void ACPI_INTERNAL_VAR_XFACE
  780. acpi_exception(const char *module_name,
  781. u32 line_number,
  782. acpi_status status,
  783. const char *format, ...))
  784. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  785. void ACPI_INTERNAL_VAR_XFACE
  786. acpi_warning(const char *module_name,
  787. u32 line_number,
  788. const char *format, ...))
  789. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
  790. void ACPI_INTERNAL_VAR_XFACE
  791. acpi_info(const char *format, ...))
  792. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  793. void ACPI_INTERNAL_VAR_XFACE
  794. acpi_bios_error(const char *module_name,
  795. u32 line_number,
  796. const char *format, ...))
  797. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
  798. void ACPI_INTERNAL_VAR_XFACE
  799. acpi_bios_exception(const char *module_name,
  800. u32 line_number,
  801. acpi_status status,
  802. const char *format, ...))
  803. ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
  804. void ACPI_INTERNAL_VAR_XFACE
  805. acpi_bios_warning(const char *module_name,
  806. u32 line_number,
  807. const char *format, ...))
  808. /*
  809. * Debug output
  810. */
  811. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  812. void ACPI_INTERNAL_VAR_XFACE
  813. acpi_debug_print(u32 requested_debug_level,
  814. u32 line_number,
  815. const char *function_name,
  816. const char *module_name,
  817. u32 component_id,
  818. const char *format, ...))
  819. ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
  820. void ACPI_INTERNAL_VAR_XFACE
  821. acpi_debug_print_raw(u32 requested_debug_level,
  822. u32 line_number,
  823. const char *function_name,
  824. const char *module_name,
  825. u32 component_id,
  826. const char *format, ...))
  827. ACPI_DBG_DEPENDENT_RETURN_VOID(void
  828. acpi_trace_point(acpi_trace_event_type type,
  829. u8 begin,
  830. u8 *aml, char *pathname))
  831. acpi_status acpi_initialize_debugger(void);
  832. void acpi_terminate_debugger(void);
  833. /*
  834. * Divergences
  835. */
  836. ACPI_EXTERNAL_RETURN_STATUS(acpi_status
  837. acpi_get_data_full(acpi_handle object,
  838. acpi_object_handler handler,
  839. void **data,
  840. void (*callback)(void *)))
  841. void acpi_run_debugger(char *batch_buffer);
  842. void acpi_set_debugger_thread_id(acpi_thread_id thread_id);
  843. #endif /* __ACXFACE_H__ */