acpixf.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /******************************************************************************
  2. *
  3. * Name: acpixf.h - External interfaces to the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACXFACE_H__
  43. #define __ACXFACE_H__
  44. #include "actypes.h"
  45. #include "actbl.h"
  46. /*
  47. * Global interfaces
  48. */
  49. acpi_status
  50. acpi_initialize_subsystem (
  51. void);
  52. acpi_status
  53. acpi_enable_subsystem (
  54. u32 flags);
  55. acpi_status
  56. acpi_initialize_objects (
  57. u32 flags);
  58. acpi_status
  59. acpi_terminate (
  60. void);
  61. #ifdef ACPI_FUTURE_USAGE
  62. acpi_status
  63. acpi_subsystem_status (
  64. void);
  65. #endif
  66. acpi_status
  67. acpi_enable (
  68. void);
  69. acpi_status
  70. acpi_disable (
  71. void);
  72. #ifdef ACPI_FUTURE_USAGE
  73. acpi_status
  74. acpi_get_system_info (
  75. struct acpi_buffer *ret_buffer);
  76. #endif
  77. const char *
  78. acpi_format_exception (
  79. acpi_status exception);
  80. acpi_status
  81. acpi_purge_cached_objects (
  82. void);
  83. #ifdef ACPI_FUTURE_USAGE
  84. acpi_status
  85. acpi_install_initialization_handler (
  86. acpi_init_handler handler,
  87. u32 function);
  88. #endif
  89. /*
  90. * ACPI Memory manager
  91. */
  92. void *
  93. acpi_allocate (
  94. u32 size);
  95. void *
  96. acpi_callocate (
  97. u32 size);
  98. void
  99. acpi_free (
  100. void *address);
  101. /*
  102. * ACPI table manipulation interfaces
  103. */
  104. acpi_status
  105. acpi_find_root_pointer (
  106. u32 flags,
  107. struct acpi_pointer *rsdp_address);
  108. acpi_status
  109. acpi_load_tables (
  110. void);
  111. #ifdef ACPI_FUTURE_USAGE
  112. acpi_status
  113. acpi_load_table (
  114. struct acpi_table_header *table_ptr);
  115. acpi_status
  116. acpi_unload_table (
  117. acpi_table_type table_type);
  118. acpi_status
  119. acpi_get_table_header (
  120. acpi_table_type table_type,
  121. u32 instance,
  122. struct acpi_table_header *out_table_header);
  123. #endif /* ACPI_FUTURE_USAGE */
  124. acpi_status
  125. acpi_get_table (
  126. acpi_table_type table_type,
  127. u32 instance,
  128. struct acpi_buffer *ret_buffer);
  129. acpi_status
  130. acpi_get_firmware_table (
  131. acpi_string signature,
  132. u32 instance,
  133. u32 flags,
  134. struct acpi_table_header **table_pointer);
  135. /*
  136. * Namespace and name interfaces
  137. */
  138. acpi_status
  139. acpi_walk_namespace (
  140. acpi_object_type type,
  141. acpi_handle start_object,
  142. u32 max_depth,
  143. acpi_walk_callback user_function,
  144. void *context,
  145. void **return_value);
  146. acpi_status
  147. acpi_get_devices (
  148. char *HID,
  149. acpi_walk_callback user_function,
  150. void *context,
  151. void **return_value);
  152. acpi_status
  153. acpi_get_name (
  154. acpi_handle handle,
  155. u32 name_type,
  156. struct acpi_buffer *ret_path_ptr);
  157. acpi_status
  158. acpi_get_handle (
  159. acpi_handle parent,
  160. acpi_string pathname,
  161. acpi_handle *ret_handle);
  162. acpi_status
  163. acpi_attach_data (
  164. acpi_handle obj_handle,
  165. acpi_object_handler handler,
  166. void *data);
  167. acpi_status
  168. acpi_detach_data (
  169. acpi_handle obj_handle,
  170. acpi_object_handler handler);
  171. acpi_status
  172. acpi_get_data (
  173. acpi_handle obj_handle,
  174. acpi_object_handler handler,
  175. void **data);
  176. /*
  177. * Object manipulation and enumeration
  178. */
  179. acpi_status
  180. acpi_evaluate_object (
  181. acpi_handle object,
  182. acpi_string pathname,
  183. struct acpi_object_list *parameter_objects,
  184. struct acpi_buffer *return_object_buffer);
  185. #ifdef ACPI_FUTURE_USAGE
  186. acpi_status
  187. acpi_evaluate_object_typed (
  188. acpi_handle object,
  189. acpi_string pathname,
  190. struct acpi_object_list *external_params,
  191. struct acpi_buffer *return_buffer,
  192. acpi_object_type return_type);
  193. #endif
  194. acpi_status
  195. acpi_get_object_info (
  196. acpi_handle handle,
  197. struct acpi_buffer *return_buffer);
  198. acpi_status
  199. acpi_get_next_object (
  200. acpi_object_type type,
  201. acpi_handle parent,
  202. acpi_handle child,
  203. acpi_handle *out_handle);
  204. acpi_status
  205. acpi_get_type (
  206. acpi_handle object,
  207. acpi_object_type *out_type);
  208. acpi_status
  209. acpi_get_parent (
  210. acpi_handle object,
  211. acpi_handle *out_handle);
  212. /*
  213. * Event handler interfaces
  214. */
  215. acpi_status
  216. acpi_install_fixed_event_handler (
  217. u32 acpi_event,
  218. acpi_event_handler handler,
  219. void *context);
  220. acpi_status
  221. acpi_remove_fixed_event_handler (
  222. u32 acpi_event,
  223. acpi_event_handler handler);
  224. acpi_status
  225. acpi_install_notify_handler (
  226. acpi_handle device,
  227. u32 handler_type,
  228. acpi_notify_handler handler,
  229. void *context);
  230. acpi_status
  231. acpi_remove_notify_handler (
  232. acpi_handle device,
  233. u32 handler_type,
  234. acpi_notify_handler handler);
  235. acpi_status
  236. acpi_install_address_space_handler (
  237. acpi_handle device,
  238. acpi_adr_space_type space_id,
  239. acpi_adr_space_handler handler,
  240. acpi_adr_space_setup setup,
  241. void *context);
  242. acpi_status
  243. acpi_remove_address_space_handler (
  244. acpi_handle device,
  245. acpi_adr_space_type space_id,
  246. acpi_adr_space_handler handler);
  247. acpi_status
  248. acpi_install_gpe_handler (
  249. acpi_handle gpe_device,
  250. u32 gpe_number,
  251. u32 type,
  252. acpi_event_handler address,
  253. void *context);
  254. #ifdef ACPI_FUTURE_USAGE
  255. acpi_status
  256. acpi_install_exception_handler (
  257. acpi_exception_handler handler);
  258. #endif
  259. /*
  260. * Event interfaces
  261. */
  262. acpi_status
  263. acpi_acquire_global_lock (
  264. u16 timeout,
  265. u32 *handle);
  266. acpi_status
  267. acpi_release_global_lock (
  268. u32 handle);
  269. acpi_status
  270. acpi_remove_gpe_handler (
  271. acpi_handle gpe_device,
  272. u32 gpe_number,
  273. acpi_event_handler address);
  274. acpi_status
  275. acpi_enable_event (
  276. u32 event,
  277. u32 flags);
  278. acpi_status
  279. acpi_disable_event (
  280. u32 event,
  281. u32 flags);
  282. acpi_status
  283. acpi_clear_event (
  284. u32 event);
  285. #ifdef ACPI_FUTURE_USAGE
  286. acpi_status
  287. acpi_get_event_status (
  288. u32 event,
  289. acpi_event_status *event_status);
  290. #endif /* ACPI_FUTURE_USAGE */
  291. acpi_status
  292. acpi_set_gpe_type (
  293. acpi_handle gpe_device,
  294. u32 gpe_number,
  295. u8 type);
  296. acpi_status
  297. acpi_enable_gpe (
  298. acpi_handle gpe_device,
  299. u32 gpe_number,
  300. u32 flags);
  301. acpi_status
  302. acpi_disable_gpe (
  303. acpi_handle gpe_device,
  304. u32 gpe_number,
  305. u32 flags);
  306. acpi_status
  307. acpi_clear_gpe (
  308. acpi_handle gpe_device,
  309. u32 gpe_number,
  310. u32 flags);
  311. #ifdef ACPI_FUTURE_USAGE
  312. acpi_status
  313. acpi_get_gpe_status (
  314. acpi_handle gpe_device,
  315. u32 gpe_number,
  316. u32 flags,
  317. acpi_event_status *event_status);
  318. #endif /* ACPI_FUTURE_USAGE */
  319. acpi_status
  320. acpi_install_gpe_block (
  321. acpi_handle gpe_device,
  322. struct acpi_generic_address *gpe_block_address,
  323. u32 register_count,
  324. u32 interrupt_level);
  325. acpi_status
  326. acpi_remove_gpe_block (
  327. acpi_handle gpe_device);
  328. /*
  329. * Resource interfaces
  330. */
  331. typedef
  332. acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
  333. struct acpi_resource *resource,
  334. void *context);
  335. acpi_status
  336. acpi_get_current_resources(
  337. acpi_handle device_handle,
  338. struct acpi_buffer *ret_buffer);
  339. #ifdef ACPI_FUTURE_USAGE
  340. acpi_status
  341. acpi_get_possible_resources(
  342. acpi_handle device_handle,
  343. struct acpi_buffer *ret_buffer);
  344. #endif
  345. acpi_status
  346. acpi_walk_resources (
  347. acpi_handle device_handle,
  348. char *path,
  349. ACPI_WALK_RESOURCE_CALLBACK user_function,
  350. void *context);
  351. acpi_status
  352. acpi_set_current_resources (
  353. acpi_handle device_handle,
  354. struct acpi_buffer *in_buffer);
  355. acpi_status
  356. acpi_get_irq_routing_table (
  357. acpi_handle bus_device_handle,
  358. struct acpi_buffer *ret_buffer);
  359. acpi_status
  360. acpi_resource_to_address64 (
  361. struct acpi_resource *resource,
  362. struct acpi_resource_address64 *out);
  363. /*
  364. * Hardware (ACPI device) interfaces
  365. */
  366. acpi_status
  367. acpi_get_register (
  368. u32 register_id,
  369. u32 *return_value,
  370. u32 flags);
  371. acpi_status
  372. acpi_set_register (
  373. u32 register_id,
  374. u32 value,
  375. u32 flags);
  376. acpi_status
  377. acpi_set_firmware_waking_vector (
  378. acpi_physical_address physical_address);
  379. #ifdef ACPI_FUTURE_USAGE
  380. acpi_status
  381. acpi_get_firmware_waking_vector (
  382. acpi_physical_address *physical_address);
  383. #endif
  384. acpi_status
  385. acpi_get_sleep_type_data (
  386. u8 sleep_state,
  387. u8 *slp_typ_a,
  388. u8 *slp_typ_b);
  389. acpi_status
  390. acpi_enter_sleep_state_prep (
  391. u8 sleep_state);
  392. acpi_status asmlinkage
  393. acpi_enter_sleep_state (
  394. u8 sleep_state);
  395. acpi_status asmlinkage
  396. acpi_enter_sleep_state_s4bios (
  397. void);
  398. acpi_status
  399. acpi_leave_sleep_state (
  400. u8 sleep_state);
  401. #endif /* __ACXFACE_H__ */