acevents.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /******************************************************************************
  2. *
  3. * Name: acevents.h - Event subcomponent prototypes and defines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2014, Intel Corp.
  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 __ACEVENTS_H__
  43. #define __ACEVENTS_H__
  44. /*
  45. * evevent
  46. */
  47. acpi_status acpi_ev_initialize_events(void);
  48. acpi_status acpi_ev_install_xrupt_handlers(void);
  49. u32 acpi_ev_fixed_event_detect(void);
  50. /*
  51. * evmisc
  52. */
  53. u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node);
  54. u32 acpi_ev_get_gpe_number_index(u32 gpe_number);
  55. acpi_status
  56. acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
  57. u32 notify_value);
  58. /*
  59. * evglock - Global Lock support
  60. */
  61. acpi_status acpi_ev_init_global_lock_handler(void);
  62. ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
  63. acpi_ev_acquire_global_lock(u16 timeout))
  64. ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
  65. acpi_status acpi_ev_remove_global_lock_handler(void);
  66. /*
  67. * evgpe - Low-level GPE support
  68. */
  69. u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
  70. acpi_status
  71. acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info);
  72. acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);
  73. acpi_status
  74. acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
  75. acpi_status
  76. acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
  77. struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  78. u32 gpe_number);
  79. struct acpi_gpe_event_info *acpi_ev_low_get_gpe_info(u32 gpe_number,
  80. struct acpi_gpe_block_info
  81. *gpe_block);
  82. acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info);
  83. /*
  84. * evgpeblk - Upper-level GPE block support
  85. */
  86. acpi_status
  87. acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
  88. u64 address,
  89. u8 space_id,
  90. u32 register_count,
  91. u16 gpe_block_base_number,
  92. u32 interrupt_number,
  93. struct acpi_gpe_block_info **return_gpe_block);
  94. acpi_status
  95. acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  96. struct acpi_gpe_block_info *gpe_block,
  97. void *context);
  98. ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
  99. acpi_ev_delete_gpe_block(struct acpi_gpe_block_info
  100. *gpe_block))
  101. u32
  102. acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
  103. struct acpi_gpe_event_info *gpe_event_info,
  104. u32 gpe_number);
  105. /*
  106. * evgpeinit - GPE initialization and update
  107. */
  108. acpi_status acpi_ev_gpe_initialize(void);
  109. ACPI_HW_DEPENDENT_RETURN_VOID(void
  110. acpi_ev_update_gpes(acpi_owner_id table_owner_id))
  111. acpi_status
  112. acpi_ev_match_gpe_method(acpi_handle obj_handle,
  113. u32 level, void *context, void **return_value);
  114. /*
  115. * evgpeutil - GPE utilities
  116. */
  117. acpi_status
  118. acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context);
  119. u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
  120. acpi_status
  121. acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  122. struct acpi_gpe_block_info *gpe_block, void *context);
  123. acpi_status
  124. acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
  125. struct acpi_gpe_xrupt_info **gpe_xrupt_block);
  126. acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt);
  127. acpi_status
  128. acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  129. struct acpi_gpe_block_info *gpe_block,
  130. void *context);
  131. /*
  132. * evhandler - Address space handling
  133. */
  134. u8
  135. acpi_ev_has_default_handler(struct acpi_namespace_node *node,
  136. acpi_adr_space_type space_id);
  137. acpi_status acpi_ev_install_region_handlers(void);
  138. acpi_status
  139. acpi_ev_install_space_handler(struct acpi_namespace_node *node,
  140. acpi_adr_space_type space_id,
  141. acpi_adr_space_handler handler,
  142. acpi_adr_space_setup setup, void *context);
  143. /*
  144. * evregion - Operation region support
  145. */
  146. acpi_status acpi_ev_initialize_op_regions(void);
  147. acpi_status
  148. acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
  149. union acpi_operand_object *field_obj,
  150. u32 function,
  151. u32 region_offset, u32 bit_width, u64 *value);
  152. acpi_status
  153. acpi_ev_attach_region(union acpi_operand_object *handler_obj,
  154. union acpi_operand_object *region_obj,
  155. u8 acpi_ns_is_locked);
  156. void
  157. acpi_ev_detach_region(union acpi_operand_object *region_obj,
  158. u8 acpi_ns_is_locked);
  159. acpi_status
  160. acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
  161. acpi_adr_space_type space_id);
  162. acpi_status
  163. acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
  164. /*
  165. * evregini - Region initialization and setup
  166. */
  167. acpi_status
  168. acpi_ev_system_memory_region_setup(acpi_handle handle,
  169. u32 function,
  170. void *handler_context,
  171. void **region_context);
  172. acpi_status
  173. acpi_ev_io_space_region_setup(acpi_handle handle,
  174. u32 function,
  175. void *handler_context, void **region_context);
  176. acpi_status
  177. acpi_ev_pci_config_region_setup(acpi_handle handle,
  178. u32 function,
  179. void *handler_context, void **region_context);
  180. acpi_status
  181. acpi_ev_cmos_region_setup(acpi_handle handle,
  182. u32 function,
  183. void *handler_context, void **region_context);
  184. acpi_status
  185. acpi_ev_pci_bar_region_setup(acpi_handle handle,
  186. u32 function,
  187. void *handler_context, void **region_context);
  188. acpi_status
  189. acpi_ev_default_region_setup(acpi_handle handle,
  190. u32 function,
  191. void *handler_context, void **region_context);
  192. acpi_status
  193. acpi_ev_initialize_region(union acpi_operand_object *region_obj,
  194. u8 acpi_ns_locked);
  195. /*
  196. * evsci - SCI (System Control Interrupt) handling/dispatch
  197. */
  198. u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
  199. u32 acpi_ev_sci_dispatch(void);
  200. u32 acpi_ev_install_sci_handler(void);
  201. acpi_status acpi_ev_remove_all_sci_handlers(void);
  202. ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
  203. #endif /* __ACEVENTS_H__ */