acglobal.h 15 KB

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