acpixf.h 31 KB

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