1 /******************************************************************************
3 * Name: acglobal.h - Declarations for global variables
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef __ACGLOBAL_H__
27 #define __ACGLOBAL_H__
31 * Ensure that the globals are actually defined only once.
33 * The use of these defines allows a single list of globals (here) in order
34 * to simplify maintenance of the code.
36 #ifdef DEFINE_ACPI_GLOBALS
39 #define ACPI_EXTERN extern
43 extern NATIVE_CHAR *msg_acpi_error_break;
45 /*****************************************************************************
49 ****************************************************************************/
51 /* Runtime configuration of debug print levels */
53 extern u32 acpi_dbg_level;
54 extern u32 acpi_dbg_layer;
57 /* Procedure nesting level for debug output */
59 extern u32 acpi_gbl_nesting_level;
62 /*****************************************************************************
66 ****************************************************************************/
70 * Although these pointers are somewhat redundant with the global Acpi_table,
71 * they are convenient because they are typed pointers.
73 * These tables are single-table only; meaning that there can be at most one
74 * of each in the system. Each global points to the actual table.
77 ACPI_EXTERN RSDP_DESCRIPTOR *acpi_gbl_RSDP;
78 ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT;
79 ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT;
80 ACPI_EXTERN ACPI_TABLE_HEADER *acpi_gbl_DSDT;
81 ACPI_EXTERN ACPI_COMMON_FACS *acpi_gbl_FACS;
84 * Since there may be multiple SSDTs and PSDTS, a single pointer is not
85 * sufficient; Therefore, there isn't one!
90 * ACPI Table info arrays
92 extern ACPI_TABLE_DESC acpi_gbl_acpi_tables[NUM_ACPI_TABLES];
93 extern ACPI_TABLE_SUPPORT acpi_gbl_acpi_table_data[NUM_ACPI_TABLES];
96 * Predefined mutex objects. This array contains the
97 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
98 * (The table maps local handles to the real OS handles)
100 ACPI_EXTERN ACPI_MUTEX_INFO acpi_gbl_acpi_mutex_info [NUM_MTX];
103 /*****************************************************************************
105 * Miscellaneous globals
107 ****************************************************************************/
110 ACPI_EXTERN u8 *acpi_gbl_gpe0enable_register_save;
111 ACPI_EXTERN u8 *acpi_gbl_gpe1_enable_register_save;
112 ACPI_EXTERN ACPI_WALK_STATE *acpi_gbl_breakpoint_walk;
113 ACPI_EXTERN ACPI_GENERIC_STATE *acpi_gbl_generic_state_cache;
114 ACPI_EXTERN ACPI_PARSE_OBJECT *acpi_gbl_parse_cache;
115 ACPI_EXTERN ACPI_PARSE2_OBJECT *acpi_gbl_ext_parse_cache;
116 ACPI_EXTERN ACPI_OPERAND_OBJECT *acpi_gbl_object_cache;
117 ACPI_EXTERN ACPI_WALK_STATE *acpi_gbl_walk_state_cache;
118 ACPI_EXTERN ACPI_HANDLE acpi_gbl_global_lock_semaphore;
121 ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
122 ACPI_EXTERN u32 acpi_gbl_restore_acpi_chipset;
123 ACPI_EXTERN u32 acpi_gbl_original_mode;
124 ACPI_EXTERN u32 acpi_gbl_edge_level_save;
125 ACPI_EXTERN u32 acpi_gbl_irq_enable_save;
126 ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
128 ACPI_EXTERN u32 acpi_gbl_state_cache_requests;
129 ACPI_EXTERN u32 acpi_gbl_state_cache_hits;
130 ACPI_EXTERN u32 acpi_gbl_parse_cache_requests;
131 ACPI_EXTERN u32 acpi_gbl_parse_cache_hits;
132 ACPI_EXTERN u32 acpi_gbl_ext_parse_cache_requests;
133 ACPI_EXTERN u32 acpi_gbl_ext_parse_cache_hits;
134 ACPI_EXTERN u32 acpi_gbl_object_cache_requests;
135 ACPI_EXTERN u32 acpi_gbl_object_cache_hits;
136 ACPI_EXTERN u32 acpi_gbl_walk_state_cache_requests;
137 ACPI_EXTERN u32 acpi_gbl_walk_state_cache_hits;
138 ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
139 ACPI_EXTERN u32 acpi_gbl_ps_find_count;
142 ACPI_EXTERN u16 acpi_gbl_generic_state_cache_depth;
143 ACPI_EXTERN u16 acpi_gbl_parse_cache_depth;
144 ACPI_EXTERN u16 acpi_gbl_ext_parse_cache_depth;
145 ACPI_EXTERN u16 acpi_gbl_object_cache_depth;
146 ACPI_EXTERN u16 acpi_gbl_walk_state_cache_depth;
147 ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
148 ACPI_EXTERN u16 acpi_gbl_next_table_owner_id;
149 ACPI_EXTERN u16 acpi_gbl_next_method_owner_id;
151 ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
152 ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
153 ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
154 ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
155 ACPI_EXTERN u8 acpi_gbl_global_lock_present;
157 ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_drv_notify;
158 ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_sys_notify;
161 extern u8 acpi_gbl_shutdown;
162 extern u32 acpi_gbl_system_flags;
163 extern u32 acpi_gbl_startup_flags;
164 extern u8 acpi_gbl_decode_to8bit[8];
165 extern NATIVE_CHAR acpi_gbl_hex_to_ascii[16];
168 /*****************************************************************************
172 ****************************************************************************/
174 #define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1
175 #define NUM_PREDEFINED_NAMES 9
178 ACPI_EXTERN ACPI_NAMESPACE_NODE acpi_gbl_root_node_struct;
179 ACPI_EXTERN ACPI_NAMESPACE_NODE *acpi_gbl_root_node;
181 extern u8 acpi_gbl_ns_properties[NUM_NS_TYPES];
182 extern PREDEFINED_NAMES acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES];
185 /* Used to detect memory leaks (DEBUG ONLY) */
188 ACPI_EXTERN ALLOCATION_INFO *acpi_gbl_head_alloc_ptr;
189 ACPI_EXTERN ALLOCATION_INFO *acpi_gbl_tail_alloc_ptr;
193 /*****************************************************************************
195 * Interpreter globals
197 ****************************************************************************/
200 ACPI_EXTERN ACPI_WALK_LIST *acpi_gbl_current_walk_list;
203 * Handle to the last method found - used during pass1 of load
205 ACPI_EXTERN ACPI_HANDLE acpi_gbl_last_method;
208 * Table of Address Space handlers
211 ACPI_EXTERN ACPI_ADDRESS_SPACE_INFO acpi_gbl_address_spaces[ACPI_NUM_ADDRESS_SPACES];
214 /* Control method single step flag */
216 ACPI_EXTERN u8 acpi_gbl_cm_single_step;
219 /*****************************************************************************
223 ****************************************************************************/
225 ACPI_EXTERN ACPI_PARSE_OBJECT *acpi_gbl_parsed_namespace_root;
227 /*****************************************************************************
231 ****************************************************************************/
233 extern ACPI_C_STATE_HANDLER acpi_hw_cx_handlers[MAX_CX_STATES];
234 extern u32 acpi_hw_active_cx_state;
237 /*****************************************************************************
241 ****************************************************************************/
243 ACPI_EXTERN ACPI_FIXED_EVENT_INFO acpi_gbl_fixed_event_handlers[NUM_FIXED_EVENTS];
245 ACPI_EXTERN ACPI_HANDLE acpi_gbl_gpe_obj_handle;
246 ACPI_EXTERN u32 acpi_gbl_gpe_register_count;
247 ACPI_EXTERN ACPI_GPE_REGISTERS *acpi_gbl_gpe_registers;
248 ACPI_EXTERN ACPI_GPE_LEVEL_INFO *acpi_gbl_gpe_info;
251 * Gpe validation and translation table
252 * Indexed by the GPE number, returns GPE_INVALID if the GPE is not supported.
253 * Otherwise, returns a valid index into the global GPE table.
255 * This table is needed because the GPE numbers supported by block 1 do not
256 * have to be contiguous with the GPE numbers supported by block 0.
258 ACPI_EXTERN u8 acpi_gbl_gpe_valid [NUM_GPE];
260 /* Acpi_event counter for debug only */
263 ACPI_EXTERN u32 acpi_gbl_event_count[NUM_FIXED_EVENTS];
267 /*****************************************************************************
271 ****************************************************************************/
273 #ifdef ENABLE_DEBUGGER
274 ACPI_EXTERN u8 acpi_gbl_method_executing;
275 ACPI_EXTERN u8 acpi_gbl_db_terminate_threads;
278 /* Memory allocation metrics - Debug Only! */
282 ACPI_EXTERN u32 acpi_gbl_current_alloc_size;
283 ACPI_EXTERN u32 acpi_gbl_current_alloc_count;
284 ACPI_EXTERN u32 acpi_gbl_running_alloc_size;
285 ACPI_EXTERN u32 acpi_gbl_running_alloc_count;
286 ACPI_EXTERN u32 acpi_gbl_max_concurrent_alloc_size;
287 ACPI_EXTERN u32 acpi_gbl_max_concurrent_alloc_count;
288 ACPI_EXTERN u32 acpi_gbl_current_object_count;
289 ACPI_EXTERN u32 acpi_gbl_current_object_size;
290 ACPI_EXTERN u32 acpi_gbl_max_concurrent_object_count;
291 ACPI_EXTERN u32 acpi_gbl_max_concurrent_object_size;
292 ACPI_EXTERN u32 acpi_gbl_running_object_count;
293 ACPI_EXTERN u32 acpi_gbl_running_object_size;
294 ACPI_EXTERN u32 acpi_gbl_current_node_count;
295 ACPI_EXTERN u32 acpi_gbl_current_node_size;
296 ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
301 #endif /* __ACGLOBAL_H__ */