acevents.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /******************************************************************************
  2. *
  3. * Name: acevents.h - Event subcomponent prototypes and defines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2010, 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. acpi_status acpi_ev_install_fadt_gpes(void);
  50. u32 acpi_ev_fixed_event_detect(void);
  51. /*
  52. * evmisc
  53. */
  54. u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node);
  55. acpi_status acpi_ev_acquire_global_lock(u16 timeout);
  56. acpi_status acpi_ev_release_global_lock(void);
  57. acpi_status acpi_ev_init_global_lock_handler(void);
  58. u32 acpi_ev_get_gpe_number_index(u32 gpe_number);
  59. acpi_status
  60. acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
  61. u32 notify_value);
  62. /*
  63. * evgpe - Low-level GPE support
  64. */
  65. u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
  66. acpi_status
  67. acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info);
  68. struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  69. u32 gpe_number);
  70. struct acpi_gpe_event_info *acpi_ev_low_get_gpe_info(u32 gpe_number,
  71. struct acpi_gpe_block_info
  72. *gpe_block);
  73. /*
  74. * evgpeblk - Upper-level GPE block support
  75. */
  76. acpi_status
  77. acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
  78. struct acpi_generic_address *gpe_block_address,
  79. u32 register_count,
  80. u8 gpe_block_base_number,
  81. u32 interrupt_number,
  82. struct acpi_gpe_block_info **return_gpe_block);
  83. acpi_status
  84. acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
  85. struct acpi_gpe_block_info *gpe_block);
  86. acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
  87. u32
  88. acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info,
  89. u32 gpe_number);
  90. /*
  91. * evgpeinit - GPE initialization and update
  92. */
  93. acpi_status acpi_ev_gpe_initialize(void);
  94. void acpi_ev_update_gpes(acpi_owner_id table_owner_id);
  95. acpi_status
  96. acpi_ev_match_gpe_method(acpi_handle obj_handle,
  97. u32 level, void *context, void **return_value);
  98. acpi_status
  99. acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
  100. u32 level, void *context, void **return_value);
  101. /*
  102. * evgpeutil - GPE utilities
  103. */
  104. acpi_status
  105. acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context);
  106. u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
  107. struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number);
  108. acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt);
  109. acpi_status
  110. acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  111. struct acpi_gpe_block_info *gpe_block,
  112. void *context);
  113. /*
  114. * evregion - Address Space handling
  115. */
  116. acpi_status acpi_ev_install_region_handlers(void);
  117. acpi_status acpi_ev_initialize_op_regions(void);
  118. acpi_status
  119. acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
  120. u32 function,
  121. u32 region_offset, u32 bit_width, u64 *value);
  122. acpi_status
  123. acpi_ev_attach_region(union acpi_operand_object *handler_obj,
  124. union acpi_operand_object *region_obj,
  125. u8 acpi_ns_is_locked);
  126. void
  127. acpi_ev_detach_region(union acpi_operand_object *region_obj,
  128. u8 acpi_ns_is_locked);
  129. acpi_status
  130. acpi_ev_install_space_handler(struct acpi_namespace_node *node,
  131. acpi_adr_space_type space_id,
  132. acpi_adr_space_handler handler,
  133. acpi_adr_space_setup setup, void *context);
  134. acpi_status
  135. acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
  136. acpi_adr_space_type space_id);
  137. acpi_status
  138. acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
  139. /*
  140. * evregini - Region initialization and setup
  141. */
  142. acpi_status
  143. acpi_ev_system_memory_region_setup(acpi_handle handle,
  144. u32 function,
  145. void *handler_context,
  146. void **region_context);
  147. acpi_status
  148. acpi_ev_io_space_region_setup(acpi_handle handle,
  149. u32 function,
  150. void *handler_context, void **region_context);
  151. acpi_status
  152. acpi_ev_pci_config_region_setup(acpi_handle handle,
  153. u32 function,
  154. void *handler_context, void **region_context);
  155. acpi_status
  156. acpi_ev_cmos_region_setup(acpi_handle handle,
  157. u32 function,
  158. void *handler_context, void **region_context);
  159. acpi_status
  160. acpi_ev_pci_bar_region_setup(acpi_handle handle,
  161. u32 function,
  162. void *handler_context, void **region_context);
  163. acpi_status
  164. acpi_ev_default_region_setup(acpi_handle handle,
  165. u32 function,
  166. void *handler_context, void **region_context);
  167. acpi_status
  168. acpi_ev_initialize_region(union acpi_operand_object *region_obj,
  169. u8 acpi_ns_locked);
  170. /*
  171. * evsci - SCI (System Control Interrupt) handling/dispatch
  172. */
  173. u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
  174. u32 acpi_ev_install_sci_handler(void);
  175. acpi_status acpi_ev_remove_sci_handler(void);
  176. u32 acpi_ev_initialize_sCI(u32 program_sCI);
  177. void acpi_ev_terminate(void);
  178. #endif /* __ACEVENTS_H__ */