acevents.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /******************************************************************************
  2. *
  3. * Name: acevents.h - Event subcomponent prototypes and defines
  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 __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. acpi_status acpi_ev_acquire_global_lock(u16 timeout);
  55. acpi_status acpi_ev_release_global_lock(void);
  56. acpi_status acpi_ev_init_global_lock_handler(void);
  57. u32 acpi_ev_get_gpe_number_index(u32 gpe_number);
  58. acpi_status
  59. acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
  60. u32 notify_value);
  61. /*
  62. * evgpe - GPE handling and dispatch
  63. */
  64. acpi_status
  65. acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
  66. u8 type);
  67. acpi_status
  68. acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info,
  69. u8 write_to_hardware);
  70. acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
  71. struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  72. u32 gpe_number);
  73. /*
  74. * evgpeblk
  75. */
  76. u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
  77. acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback);
  78. acpi_status
  79. acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  80. struct acpi_gpe_block_info *gpe_block);
  81. acpi_status
  82. acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
  83. struct acpi_generic_address *gpe_block_address,
  84. u32 register_count,
  85. u8 gpe_block_base_number,
  86. u32 interrupt_number,
  87. struct acpi_gpe_block_info **return_gpe_block);
  88. acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
  89. u32
  90. acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info,
  91. u32 gpe_number);
  92. u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
  93. acpi_status
  94. acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type);
  95. acpi_status
  96. acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info);
  97. acpi_status acpi_ev_gpe_initialize(void);
  98. /*
  99. * evregion - Address Space handling
  100. */
  101. acpi_status acpi_ev_install_region_handlers(void);
  102. acpi_status acpi_ev_initialize_op_regions(void);
  103. acpi_status
  104. acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
  105. u32 function,
  106. acpi_physical_address address,
  107. u32 bit_width, void *value);
  108. acpi_status
  109. acpi_ev_attach_region(union acpi_operand_object *handler_obj,
  110. union acpi_operand_object *region_obj,
  111. u8 acpi_ns_is_locked);
  112. void
  113. acpi_ev_detach_region(union acpi_operand_object *region_obj,
  114. u8 acpi_ns_is_locked);
  115. acpi_status
  116. acpi_ev_install_space_handler(struct acpi_namespace_node *node,
  117. acpi_adr_space_type space_id,
  118. acpi_adr_space_handler handler,
  119. acpi_adr_space_setup setup, void *context);
  120. acpi_status
  121. acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
  122. acpi_adr_space_type space_id);
  123. acpi_status
  124. acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
  125. /*
  126. * evregini - Region initialization and setup
  127. */
  128. acpi_status
  129. acpi_ev_system_memory_region_setup(acpi_handle handle,
  130. u32 function,
  131. void *handler_context,
  132. void **region_context);
  133. acpi_status
  134. acpi_ev_io_space_region_setup(acpi_handle handle,
  135. u32 function,
  136. void *handler_context, void **region_context);
  137. acpi_status
  138. acpi_ev_pci_config_region_setup(acpi_handle handle,
  139. u32 function,
  140. void *handler_context, void **region_context);
  141. acpi_status
  142. acpi_ev_cmos_region_setup(acpi_handle handle,
  143. u32 function,
  144. void *handler_context, void **region_context);
  145. acpi_status
  146. acpi_ev_pci_bar_region_setup(acpi_handle handle,
  147. u32 function,
  148. void *handler_context, void **region_context);
  149. acpi_status
  150. acpi_ev_default_region_setup(acpi_handle handle,
  151. u32 function,
  152. void *handler_context, void **region_context);
  153. acpi_status
  154. acpi_ev_initialize_region(union acpi_operand_object *region_obj,
  155. u8 acpi_ns_locked);
  156. /*
  157. * evsci - SCI (System Control Interrupt) handling/dispatch
  158. */
  159. u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
  160. u32 acpi_ev_install_sci_handler(void);
  161. acpi_status acpi_ev_remove_sci_handler(void);
  162. u32 acpi_ev_initialize_sCI(u32 program_sCI);
  163. void acpi_ev_terminate(void);
  164. #endif /* __ACEVENTS_H__ */