acglobal.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. /******************************************************************************
  2. *
  3. * Name: acglobal.h - Declarations for global variables
  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 __ACGLOBAL_H__
  43. #define __ACGLOBAL_H__
  44. /*****************************************************************************
  45. *
  46. * Globals related to the ACPI tables
  47. *
  48. ****************************************************************************/
  49. /* Master list of all ACPI tables that were found in the RSDT/XSDT */
  50. ACPI_GLOBAL(struct acpi_table_list, acpi_gbl_root_table_list);
  51. /* DSDT information. Used to check for DSDT corruption */
  52. ACPI_GLOBAL(struct acpi_table_header *, acpi_gbl_DSDT);
  53. ACPI_GLOBAL(struct acpi_table_header, acpi_gbl_original_dsdt_header);
  54. #if (!ACPI_REDUCED_HARDWARE)
  55. ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
  56. #endif /* !ACPI_REDUCED_HARDWARE */
  57. /* These addresses are calculated from the FADT Event Block addresses */
  58. ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1a_status);
  59. ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1a_enable);
  60. ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_status);
  61. ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_enable);
  62. /*
  63. * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
  64. * determined by the revision of the DSDT: If the DSDT revision is less than
  65. * 2, use only the lower 32 bits of the internal 64-bit Integer.
  66. */
  67. ACPI_GLOBAL(u8, acpi_gbl_integer_bit_width);
  68. ACPI_GLOBAL(u8, acpi_gbl_integer_byte_width);
  69. ACPI_GLOBAL(u8, acpi_gbl_integer_nybble_width);
  70. /*****************************************************************************
  71. *
  72. * Mutual exclusion within ACPICA subsystem
  73. *
  74. ****************************************************************************/
  75. /*
  76. * Predefined mutex objects. This array contains the
  77. * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
  78. * (The table maps local handles to the real OS handles)
  79. */
  80. ACPI_GLOBAL(struct acpi_mutex_info, acpi_gbl_mutex_info[ACPI_NUM_MUTEX]);
  81. /*
  82. * Global lock mutex is an actual AML mutex object
  83. * Global lock semaphore works in conjunction with the actual global lock
  84. * Global lock spinlock is used for "pending" handshake
  85. */
  86. ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_global_lock_mutex);
  87. ACPI_GLOBAL(acpi_semaphore, acpi_gbl_global_lock_semaphore);
  88. ACPI_GLOBAL(acpi_spinlock, acpi_gbl_global_lock_pending_lock);
  89. ACPI_GLOBAL(u16, acpi_gbl_global_lock_handle);
  90. ACPI_GLOBAL(u8, acpi_gbl_global_lock_acquired);
  91. ACPI_GLOBAL(u8, acpi_gbl_global_lock_present);
  92. ACPI_GLOBAL(u8, acpi_gbl_global_lock_pending);
  93. /*
  94. * Spinlocks are used for interfaces that can be possibly called at
  95. * interrupt level
  96. */
  97. ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock); /* For GPE data structs and registers */
  98. ACPI_GLOBAL(acpi_spinlock, acpi_gbl_hardware_lock); /* For ACPI H/W except GPE registers */
  99. ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);
  100. /* Mutex for _OSI support */
  101. ACPI_GLOBAL(acpi_mutex, acpi_gbl_osi_mutex);
  102. /* Reader/Writer lock is used for namespace walk and dynamic table unload */
  103. ACPI_GLOBAL(struct acpi_rw_lock, acpi_gbl_namespace_rw_lock);
  104. /*****************************************************************************
  105. *
  106. * Miscellaneous globals
  107. *
  108. ****************************************************************************/
  109. /* Object caches */
  110. ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_namespace_cache);
  111. ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_state_cache);
  112. ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_ps_node_cache);
  113. ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_ps_node_ext_cache);
  114. ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_operand_cache);
  115. /* System */
  116. ACPI_INIT_GLOBAL(u32, acpi_gbl_startup_flags, 0);
  117. ACPI_INIT_GLOBAL(u8, acpi_gbl_shutdown, TRUE);
  118. /* Global handlers */
  119. ACPI_GLOBAL(struct acpi_global_notify_handler, acpi_gbl_global_notify[2]);
  120. ACPI_GLOBAL(acpi_exception_handler, acpi_gbl_exception_handler);
  121. ACPI_GLOBAL(acpi_init_handler, acpi_gbl_init_handler);
  122. ACPI_GLOBAL(acpi_table_handler, acpi_gbl_table_handler);
  123. ACPI_GLOBAL(void *, acpi_gbl_table_handler_context);
  124. ACPI_GLOBAL(acpi_interface_handler, acpi_gbl_interface_handler);
  125. ACPI_GLOBAL(struct acpi_sci_handler_info *, acpi_gbl_sci_handler_list);
  126. /* Owner ID support */
  127. ACPI_GLOBAL(u32, acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]);
  128. ACPI_GLOBAL(u8, acpi_gbl_last_owner_id_index);
  129. ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);
  130. /* Initialization sequencing */
  131. ACPI_GLOBAL(u8, acpi_gbl_reg_methods_executed);
  132. /* Misc */
  133. ACPI_GLOBAL(u32, acpi_gbl_original_mode);
  134. ACPI_GLOBAL(u32, acpi_gbl_ns_lookup_count);
  135. ACPI_GLOBAL(u32, acpi_gbl_ps_find_count);
  136. ACPI_GLOBAL(u16, acpi_gbl_pm1_enable_register_save);
  137. ACPI_GLOBAL(u8, acpi_gbl_debugger_configuration);
  138. ACPI_GLOBAL(u8, acpi_gbl_step_to_next_call);
  139. ACPI_GLOBAL(u8, acpi_gbl_acpi_hardware_present);
  140. ACPI_GLOBAL(u8, acpi_gbl_events_initialized);
  141. ACPI_GLOBAL(struct acpi_interface_info *, acpi_gbl_supported_interfaces);
  142. ACPI_GLOBAL(struct acpi_address_range *,
  143. acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX]);
  144. /* Other miscellaneous, declared and initialized in utglobal */
  145. extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
  146. extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS];
  147. extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS];
  148. extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
  149. extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
  150. #ifdef ACPI_DBG_TRACK_ALLOCATIONS
  151. /* Lists for tracking memory allocations (debug only) */
  152. ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list);
  153. ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);
  154. ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats);
  155. ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
  156. #endif
  157. /*****************************************************************************
  158. *
  159. * Namespace globals
  160. *
  161. ****************************************************************************/
  162. #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
  163. #define NUM_PREDEFINED_NAMES 10
  164. #else
  165. #define NUM_PREDEFINED_NAMES 9
  166. #endif
  167. ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct);
  168. ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node);
  169. ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_fadt_gpe_device);
  170. ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_module_code_list);
  171. extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
  172. extern const struct acpi_predefined_names
  173. acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
  174. #ifdef ACPI_DEBUG_OUTPUT
  175. ACPI_GLOBAL(u32, acpi_gbl_current_node_count);
  176. ACPI_GLOBAL(u32, acpi_gbl_current_node_size);
  177. ACPI_GLOBAL(u32, acpi_gbl_max_concurrent_node_count);
  178. ACPI_GLOBAL(acpi_size *, acpi_gbl_entry_stack_pointer);
  179. ACPI_GLOBAL(acpi_size *, acpi_gbl_lowest_stack_pointer);
  180. ACPI_GLOBAL(u32, acpi_gbl_deepest_nesting);
  181. ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);
  182. #endif
  183. /*****************************************************************************
  184. *
  185. * Interpreter globals
  186. *
  187. ****************************************************************************/
  188. ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);
  189. /* Control method single step flag */
  190. ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);
  191. /*****************************************************************************
  192. *
  193. * Hardware globals
  194. *
  195. ****************************************************************************/
  196. extern struct acpi_bit_register_info
  197. acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
  198. ACPI_GLOBAL(u8, acpi_gbl_sleep_type_a);
  199. ACPI_GLOBAL(u8, acpi_gbl_sleep_type_b);
  200. /*****************************************************************************
  201. *
  202. * Event and GPE globals
  203. *
  204. ****************************************************************************/
  205. #if (!ACPI_REDUCED_HARDWARE)
  206. ACPI_GLOBAL(u8, acpi_gbl_all_gpes_initialized);
  207. ACPI_GLOBAL(struct acpi_gpe_xrupt_info *, acpi_gbl_gpe_xrupt_list_head);
  208. ACPI_GLOBAL(struct acpi_gpe_block_info *,
  209. acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]);
  210. ACPI_GLOBAL(acpi_gbl_event_handler, acpi_gbl_global_event_handler);
  211. ACPI_GLOBAL(void *, acpi_gbl_global_event_handler_context);
  212. ACPI_GLOBAL(struct acpi_fixed_event_handler,
  213. acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]);
  214. extern struct acpi_fixed_event_info
  215. acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
  216. #endif /* !ACPI_REDUCED_HARDWARE */
  217. /*****************************************************************************
  218. *
  219. * Debug support
  220. *
  221. ****************************************************************************/
  222. /* Event counters */
  223. ACPI_GLOBAL(u32, acpi_method_count);
  224. ACPI_GLOBAL(u32, acpi_gpe_count);
  225. ACPI_GLOBAL(u32, acpi_sci_count);
  226. ACPI_GLOBAL(u32, acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]);
  227. /* Support for dynamic control method tracing mechanism */
  228. ACPI_GLOBAL(u32, acpi_gbl_original_dbg_level);
  229. ACPI_GLOBAL(u32, acpi_gbl_original_dbg_layer);
  230. ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_level);
  231. ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer);
  232. /*****************************************************************************
  233. *
  234. * Debugger and Disassembler globals
  235. *
  236. ****************************************************************************/
  237. ACPI_GLOBAL(u8, acpi_gbl_db_output_flags);
  238. #ifdef ACPI_DISASSEMBLER
  239. /* Do not disassemble buffers to resource descriptors */
  240. ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE);
  241. ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
  242. ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm);
  243. ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose);
  244. ACPI_GLOBAL(u8, acpi_gbl_num_external_methods);
  245. ACPI_GLOBAL(u32, acpi_gbl_resolved_external_methods);
  246. ACPI_GLOBAL(struct acpi_external_list *, acpi_gbl_external_list);
  247. ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);
  248. #endif
  249. #ifdef ACPI_DEBUGGER
  250. ACPI_INIT_GLOBAL(u8, acpi_gbl_db_terminate_threads, FALSE);
  251. ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
  252. ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
  253. ACPI_GLOBAL(u8, acpi_gbl_db_opt_tables);
  254. ACPI_GLOBAL(u8, acpi_gbl_db_opt_stats);
  255. ACPI_GLOBAL(u8, acpi_gbl_db_opt_ini_methods);
  256. ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
  257. ACPI_GLOBAL(u8, acpi_gbl_db_output_to_file);
  258. ACPI_GLOBAL(char *, acpi_gbl_db_buffer);
  259. ACPI_GLOBAL(char *, acpi_gbl_db_filename);
  260. ACPI_GLOBAL(u32, acpi_gbl_db_debug_level);
  261. ACPI_GLOBAL(u32, acpi_gbl_db_console_debug_level);
  262. ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_db_scope_node);
  263. ACPI_GLOBAL(char *, acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]);
  264. ACPI_GLOBAL(acpi_object_type, acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]);
  265. /* These buffers should all be the same size */
  266. ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]);
  267. ACPI_GLOBAL(char, acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]);
  268. ACPI_GLOBAL(char, acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE]);
  269. ACPI_GLOBAL(char, acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE]);
  270. /*
  271. * Statistic globals
  272. */
  273. ACPI_GLOBAL(u16, acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
  274. ACPI_GLOBAL(u16, acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
  275. ACPI_GLOBAL(u16, acpi_gbl_obj_type_count_misc);
  276. ACPI_GLOBAL(u16, acpi_gbl_node_type_count_misc);
  277. ACPI_GLOBAL(u32, acpi_gbl_num_nodes);
  278. ACPI_GLOBAL(u32, acpi_gbl_num_objects);
  279. #endif /* ACPI_DEBUGGER */
  280. /*****************************************************************************
  281. *
  282. * Application globals
  283. *
  284. ****************************************************************************/
  285. #ifdef ACPI_APPLICATION
  286. ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL);
  287. #endif /* ACPI_APPLICATION */
  288. /*****************************************************************************
  289. *
  290. * Info/help support
  291. *
  292. ****************************************************************************/
  293. extern const struct ah_predefined_name asl_predefined_info[];
  294. extern const struct ah_device_id asl_device_ids[];
  295. #endif /* __ACGLOBAL_H__ */