aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-02-25 21:32:38 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-17 20:50:57 -0400
commit3aa0b085f62f771072dca7ad7f5554a11a83cf7e (patch)
treeb4c1bfa996fbf962cad8be31abc1fa81eb9bd9b0
parent0a16d12a8e8df523022b458dae33dc4288d18dd1 (diff)
ACPICA: Cleanup/improve global variable declarations.
This change cleans up the entire global variable mechaninism including the related macros. Also reduces warnings from the "sparse" utility in the Linux environment. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/acglobal.h353
-rw-r--r--drivers/acpi/acpica/utglobal.c37
2 files changed, 189 insertions, 201 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 203b2dc5ea28..7cc7ffef04d2 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -53,11 +53,19 @@
53 * to simplify maintenance of the code. 53 * to simplify maintenance of the code.
54 */ 54 */
55#ifdef DEFINE_ACPI_GLOBALS 55#ifdef DEFINE_ACPI_GLOBALS
56#define ACPI_EXTERN 56#define ACPI_GLOBAL(type,name) \
57#define ACPI_INIT_GLOBAL(a,b) a=b 57 extern type name; \
58 type name
59
60#define ACPI_INIT_GLOBAL(type,name,value) \
61 type name=value
62
58#else 63#else
59#define ACPI_EXTERN extern 64#define ACPI_GLOBAL(type,name) \
60#define ACPI_INIT_GLOBAL(a,b) a 65 extern type name
66
67#define ACPI_INIT_GLOBAL(type,name,value) \
68 extern type name
61#endif 69#endif
62 70
63#ifdef DEFINE_ACPI_GLOBALS 71#ifdef DEFINE_ACPI_GLOBALS
@@ -84,7 +92,7 @@
84 * 5) Allow unresolved references (invalid target name) in package objects 92 * 5) Allow unresolved references (invalid target name) in package objects
85 * 6) Enable warning messages for behavior that is not ACPI spec compliant 93 * 6) Enable warning messages for behavior that is not ACPI spec compliant
86 */ 94 */
87u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 95ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
88 96
89/* 97/*
90 * Automatically serialize ALL control methods? Default is FALSE, meaning 98 * Automatically serialize ALL control methods? Default is FALSE, meaning
@@ -92,25 +100,25 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
92 * Only change this if the ASL code is poorly written and cannot handle 100 * Only change this if the ASL code is poorly written and cannot handle
93 * reentrancy even though methods are marked "NotSerialized". 101 * reentrancy even though methods are marked "NotSerialized".
94 */ 102 */
95u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); 103ACPI_INIT_GLOBAL(u8, acpi_gbl_all_methods_serialized, FALSE);
96 104
97/* 105/*
98 * Create the predefined _OSI method in the namespace? Default is TRUE 106 * Create the predefined _OSI method in the namespace? Default is TRUE
99 * because ACPI CA is fully compatible with other ACPI implementations. 107 * because ACPI CA is fully compatible with other ACPI implementations.
100 * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. 108 * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
101 */ 109 */
102u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE); 110ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
103 111
104/* 112/*
105 * Optionally use default values for the ACPI register widths. Set this to 113 * Optionally use default values for the ACPI register widths. Set this to
106 * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. 114 * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
107 */ 115 */
108u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE); 116ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
109 117
110/* 118/*
111 * Optionally enable output from the AML Debug Object. 119 * Optionally enable output from the AML Debug Object.
112 */ 120 */
113u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); 121ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
114 122
115/* 123/*
116 * Optionally copy the entire DSDT to local memory (instead of simply 124 * Optionally copy the entire DSDT to local memory (instead of simply
@@ -118,7 +126,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
118 * DSDT, creating the need for this option. Default is FALSE, do not copy 126 * DSDT, creating the need for this option. Default is FALSE, do not copy
119 * the DSDT. 127 * the DSDT.
120 */ 128 */
121u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE); 129ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
122 130
123/* 131/*
124 * Optionally ignore an XSDT if present and use the RSDT instead. 132 * Optionally ignore an XSDT if present and use the RSDT instead.
@@ -126,7 +134,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);
126 * of the RSDT, the XSDT has been found to be corrupt or ill-formed on 134 * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
127 * some machines. Default behavior is to use the XSDT if present. 135 * some machines. Default behavior is to use the XSDT if present.
128 */ 136 */
129u8 ACPI_INIT_GLOBAL(acpi_gbl_do_not_use_xsdt, FALSE); 137ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
130 138
131/* 139/*
132 * Optionally use 32-bit FADT addresses if and when there is a conflict 140 * Optionally use 32-bit FADT addresses if and when there is a conflict
@@ -136,7 +144,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_do_not_use_xsdt, FALSE);
136 * some machines have been found to have a corrupted non-zero 64-bit 144 * some machines have been found to have a corrupted non-zero 64-bit
137 * address. Default is FALSE, do not favor the 32-bit addresses. 145 * address. Default is FALSE, do not favor the 32-bit addresses.
138 */ 146 */
139u8 ACPI_INIT_GLOBAL(acpi_gbl_use32_bit_fadt_addresses, FALSE); 147ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
140 148
141/* 149/*
142 * Optionally truncate I/O addresses to 16 bits. Provides compatibility 150 * Optionally truncate I/O addresses to 16 bits. Provides compatibility
@@ -144,47 +152,28 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use32_bit_fadt_addresses, FALSE);
144 * this value is set to TRUE if any Windows OSI strings have been 152 * this value is set to TRUE if any Windows OSI strings have been
145 * requested by the BIOS. 153 * requested by the BIOS.
146 */ 154 */
147u8 ACPI_INIT_GLOBAL(acpi_gbl_truncate_io_addresses, FALSE); 155ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
148 156
149/* 157/*
150 * Disable runtime checking and repair of values returned by control methods. 158 * Disable runtime checking and repair of values returned by control methods.
151 * Use only if the repair is causing a problem on a particular machine. 159 * Use only if the repair is causing a problem on a particular machine.
152 */ 160 */
153u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_auto_repair, FALSE); 161ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
154 162
155/* 163/*
156 * Optionally do not load any SSDTs from the RSDT/XSDT during initialization. 164 * Optionally do not load any SSDTs from the RSDT/XSDT during initialization.
157 * This can be useful for debugging ACPI problems on some machines. 165 * This can be useful for debugging ACPI problems on some machines.
158 */ 166 */
159u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_ssdt_table_load, FALSE); 167ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_load, FALSE);
160 168
161/* 169/*
162 * We keep track of the latest version of Windows that has been requested by 170 * We keep track of the latest version of Windows that has been requested by
163 * the BIOS. 171 * the BIOS.
164 */ 172 */
165u8 ACPI_INIT_GLOBAL(acpi_gbl_osi_data, 0); 173ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
166
167/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
168
169struct acpi_table_fadt acpi_gbl_FADT;
170u32 acpi_current_gpe_count;
171u32 acpi_gbl_trace_flags;
172acpi_name acpi_gbl_trace_method_name;
173u8 acpi_gbl_system_awake_and_running;
174
175/*
176 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
177 * that the ACPI hardware is no longer required. A flag in the FADT indicates
178 * a reduced HW machine, and that flag is duplicated here for convenience.
179 */
180u8 acpi_gbl_reduced_hardware;
181 174
182#endif /* DEFINE_ACPI_GLOBALS */ 175#endif /* DEFINE_ACPI_GLOBALS */
183 176
184/* Do not disassemble buffers to resource descriptors */
185
186ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE);
187
188/***************************************************************************** 177/*****************************************************************************
189 * 178 *
190 * ACPI Table globals 179 * ACPI Table globals
@@ -192,37 +181,36 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE);
192 ****************************************************************************/ 181 ****************************************************************************/
193 182
194/* 183/*
195 * acpi_gbl_root_table_list is the master list of ACPI tables that were 184 * Master list of all ACPI tables that were found in the RSDT/XSDT.
196 * found in the RSDT/XSDT.
197 */ 185 */
198ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list; 186ACPI_GLOBAL(struct acpi_table_list, acpi_gbl_root_table_list);
187
188/* DSDT information. Used to check for DSDT corruption */
189
190ACPI_GLOBAL(struct acpi_table_header *, acpi_gbl_DSDT);
191ACPI_GLOBAL(struct acpi_table_header, acpi_gbl_original_dsdt_header);
199 192
200#if (!ACPI_REDUCED_HARDWARE) 193#if (!ACPI_REDUCED_HARDWARE)
201ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; 194ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
202 195
203#endif /* !ACPI_REDUCED_HARDWARE */ 196#endif /* !ACPI_REDUCED_HARDWARE */
204 197
205/* These addresses are calculated from the FADT Event Block addresses */ 198/* These addresses are calculated from the FADT Event Block addresses */
206 199
207ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_status; 200ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1a_status);
208ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; 201ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1a_enable);
209
210ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_status;
211ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
212 202
213/* DSDT information. Used to check for DSDT corruption */ 203ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_status);
214 204ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_enable);
215ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
216ACPI_EXTERN struct acpi_table_header acpi_gbl_original_dsdt_header;
217 205
218/* 206/*
219 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is 207 * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
220 * determined by the revision of the DSDT: If the DSDT revision is less than 208 * determined by the revision of the DSDT: If the DSDT revision is less than
221 * 2, use only the lower 32 bits of the internal 64-bit Integer. 209 * 2, use only the lower 32 bits of the internal 64-bit Integer.
222 */ 210 */
223ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 211ACPI_GLOBAL(u8, acpi_gbl_integer_bit_width);
224ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 212ACPI_GLOBAL(u8, acpi_gbl_integer_byte_width);
225ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; 213ACPI_GLOBAL(u8, acpi_gbl_integer_nybble_width);
226 214
227/***************************************************************************** 215/*****************************************************************************
228 * 216 *
@@ -235,36 +223,36 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
235 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 223 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
236 * (The table maps local handles to the real OS handles) 224 * (The table maps local handles to the real OS handles)
237 */ 225 */
238ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; 226ACPI_GLOBAL(struct acpi_mutex_info, acpi_gbl_mutex_info[ACPI_NUM_MUTEX]);
239 227
240/* 228/*
241 * Global lock mutex is an actual AML mutex object 229 * Global lock mutex is an actual AML mutex object
242 * Global lock semaphore works in conjunction with the actual global lock 230 * Global lock semaphore works in conjunction with the actual global lock
243 * Global lock spinlock is used for "pending" handshake 231 * Global lock spinlock is used for "pending" handshake
244 */ 232 */
245ACPI_EXTERN union acpi_operand_object *acpi_gbl_global_lock_mutex; 233ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_global_lock_mutex);
246ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; 234ACPI_GLOBAL(acpi_semaphore, acpi_gbl_global_lock_semaphore);
247ACPI_EXTERN acpi_spinlock acpi_gbl_global_lock_pending_lock; 235ACPI_GLOBAL(acpi_spinlock, acpi_gbl_global_lock_pending_lock);
248ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 236ACPI_GLOBAL(u16, acpi_gbl_global_lock_handle);
249ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; 237ACPI_GLOBAL(u8, acpi_gbl_global_lock_acquired);
250ACPI_EXTERN u8 acpi_gbl_global_lock_present; 238ACPI_GLOBAL(u8, acpi_gbl_global_lock_present);
251ACPI_EXTERN u8 acpi_gbl_global_lock_pending; 239ACPI_GLOBAL(u8, acpi_gbl_global_lock_pending);
252 240
253/* 241/*
254 * Spinlocks are used for interfaces that can be possibly called at 242 * Spinlocks are used for interfaces that can be possibly called at
255 * interrupt level 243 * interrupt level
256 */ 244 */
257ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock; /* For GPE data structs and registers */ 245ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock); /* For GPE data structs and registers */
258ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ 246ACPI_GLOBAL(acpi_spinlock, acpi_gbl_hardware_lock); /* For ACPI H/W except GPE registers */
259ACPI_EXTERN acpi_spinlock acpi_gbl_reference_count_lock; 247ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);
260 248
261/* Mutex for _OSI support */ 249/* Mutex for _OSI support */
262 250
263ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex; 251ACPI_GLOBAL(acpi_mutex, acpi_gbl_osi_mutex);
264 252
265/* Reader/Writer lock is used for namespace walk and dynamic table unload */ 253/* Reader/Writer lock is used for namespace walk and dynamic table unload */
266 254
267ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock; 255ACPI_GLOBAL(struct acpi_rw_lock, acpi_gbl_namespace_rw_lock);
268 256
269/***************************************************************************** 257/*****************************************************************************
270 * 258 *
@@ -274,70 +262,69 @@ ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
274 262
275/* Object caches */ 263/* Object caches */
276 264
277ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; 265ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_namespace_cache);
278ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; 266ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_state_cache);
279ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; 267ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_ps_node_cache);
280ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; 268ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_ps_node_ext_cache);
281ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; 269ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_operand_cache);
270
271/* System */
272
273ACPI_INIT_GLOBAL(u32, acpi_gbl_startup_flags, 0);
274ACPI_INIT_GLOBAL(u8, acpi_gbl_shutdown, TRUE);
282 275
283/* Global handlers */ 276/* Global handlers */
284 277
285ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2]; 278ACPI_GLOBAL(struct acpi_global_notify_handler, acpi_gbl_global_notify[2]);
286ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; 279ACPI_GLOBAL(acpi_exception_handler, acpi_gbl_exception_handler);
287ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; 280ACPI_GLOBAL(acpi_init_handler, acpi_gbl_init_handler);
288ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler; 281ACPI_GLOBAL(acpi_table_handler, acpi_gbl_table_handler);
289ACPI_EXTERN void *acpi_gbl_table_handler_context; 282ACPI_GLOBAL(void *, acpi_gbl_table_handler_context);
290ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; 283ACPI_GLOBAL(struct acpi_walk_state *, acpi_gbl_breakpoint_walk);
291ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler; 284ACPI_GLOBAL(acpi_interface_handler, acpi_gbl_interface_handler);
292ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list; 285ACPI_GLOBAL(struct acpi_sci_handler_info *, acpi_gbl_sci_handler_list);
293 286
294/* Owner ID support */ 287/* Owner ID support */
295 288
296ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]; 289ACPI_GLOBAL(u32, acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]);
297ACPI_EXTERN u8 acpi_gbl_last_owner_id_index; 290ACPI_GLOBAL(u8, acpi_gbl_last_owner_id_index);
298ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset; 291ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);
299 292
300/* Initialization sequencing */ 293/* Initialization sequencing */
301 294
302ACPI_EXTERN u8 acpi_gbl_reg_methods_executed; 295ACPI_GLOBAL(u8, acpi_gbl_reg_methods_executed);
303 296
304/* Misc */ 297/* Misc */
305 298
306ACPI_EXTERN u32 acpi_gbl_original_mode; 299ACPI_GLOBAL(u32, acpi_gbl_original_mode);
307ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 300ACPI_GLOBAL(u32, acpi_gbl_rsdp_original_location);
308ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 301ACPI_GLOBAL(u32, acpi_gbl_ns_lookup_count);
309ACPI_EXTERN u32 acpi_gbl_ps_find_count; 302ACPI_GLOBAL(u32, acpi_gbl_ps_find_count);
310ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 303ACPI_GLOBAL(u16, acpi_gbl_pm1_enable_register_save);
311ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 304ACPI_GLOBAL(u8, acpi_gbl_debugger_configuration);
312ACPI_EXTERN u8 acpi_gbl_step_to_next_call; 305ACPI_GLOBAL(u8, acpi_gbl_step_to_next_call);
313ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; 306ACPI_GLOBAL(u8, acpi_gbl_acpi_hardware_present);
314ACPI_EXTERN u8 acpi_gbl_events_initialized; 307ACPI_GLOBAL(u8, acpi_gbl_events_initialized);
315ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces; 308ACPI_GLOBAL(struct acpi_interface_info *, acpi_gbl_supported_interfaces);
316ACPI_EXTERN struct acpi_address_range 309ACPI_GLOBAL(struct acpi_address_range *,
317 *acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX]; 310 acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX]);
318 311
319#ifndef DEFINE_ACPI_GLOBALS 312/* Other miscellaneous, declared and initialized in utglobal */
320 313
321/* Other miscellaneous */
322
323extern u8 acpi_gbl_shutdown;
324extern u32 acpi_gbl_startup_flags;
325extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; 314extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
326extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS]; 315extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS];
327extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS]; 316extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS];
328extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
329extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 317extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
330 318extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
331#endif
332 319
333#ifdef ACPI_DBG_TRACK_ALLOCATIONS 320#ifdef ACPI_DBG_TRACK_ALLOCATIONS
334 321
335/* Lists for tracking memory allocations */ 322/* Lists for tracking memory allocations (debug only) */
336 323
337ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; 324ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list);
338ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; 325ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);
339ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats; 326ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats);
340ACPI_EXTERN u8 acpi_gbl_disable_mem_tracking; 327ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
341#endif 328#endif
342 329
343/***************************************************************************** 330/*****************************************************************************
@@ -352,22 +339,23 @@ ACPI_EXTERN u8 acpi_gbl_disable_mem_tracking;
352#define NUM_PREDEFINED_NAMES 9 339#define NUM_PREDEFINED_NAMES 9
353#endif 340#endif
354 341
355ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; 342ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct);
356ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; 343ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node);
357ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; 344ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_fadt_gpe_device);
358ACPI_EXTERN union acpi_operand_object *acpi_gbl_module_code_list; 345ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_module_code_list);
359 346
360extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES]; 347extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
361extern const struct acpi_predefined_names 348extern const struct acpi_predefined_names
362 acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; 349 acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
363 350
364#ifdef ACPI_DEBUG_OUTPUT 351#ifdef ACPI_DEBUG_OUTPUT
365ACPI_EXTERN u32 acpi_gbl_current_node_count; 352ACPI_GLOBAL(u32, acpi_gbl_current_node_count);
366ACPI_EXTERN u32 acpi_gbl_current_node_size; 353ACPI_GLOBAL(u32, acpi_gbl_current_node_size);
367ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; 354ACPI_GLOBAL(u32, acpi_gbl_max_concurrent_node_count);
368ACPI_EXTERN acpi_size *acpi_gbl_entry_stack_pointer; 355ACPI_GLOBAL(acpi_size *, acpi_gbl_entry_stack_pointer);
369ACPI_EXTERN acpi_size *acpi_gbl_lowest_stack_pointer; 356ACPI_GLOBAL(acpi_size *, acpi_gbl_lowest_stack_pointer);
370ACPI_EXTERN u32 acpi_gbl_deepest_nesting; 357ACPI_GLOBAL(u32, acpi_gbl_deepest_nesting);
358ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);
371#endif 359#endif
372 360
373/***************************************************************************** 361/*****************************************************************************
@@ -376,11 +364,11 @@ ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
376 * 364 *
377 ****************************************************************************/ 365 ****************************************************************************/
378 366
379ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; 367ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);
380 368
381/* Control method single step flag */ 369/* Control method single step flag */
382 370
383ACPI_EXTERN u8 acpi_gbl_cm_single_step; 371ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);
384 372
385/***************************************************************************** 373/*****************************************************************************
386 * 374 *
@@ -390,8 +378,9 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step;
390 378
391extern struct acpi_bit_register_info 379extern struct acpi_bit_register_info
392 acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; 380 acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
393ACPI_EXTERN u8 acpi_gbl_sleep_type_a; 381
394ACPI_EXTERN u8 acpi_gbl_sleep_type_b; 382ACPI_GLOBAL(u8, acpi_gbl_sleep_type_a);
383ACPI_GLOBAL(u8, acpi_gbl_sleep_type_b);
395 384
396/***************************************************************************** 385/*****************************************************************************
397 * 386 *
@@ -401,14 +390,15 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
401 390
402#if (!ACPI_REDUCED_HARDWARE) 391#if (!ACPI_REDUCED_HARDWARE)
403 392
404ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized; 393ACPI_GLOBAL(u8, acpi_gbl_all_gpes_initialized);
405ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 394ACPI_GLOBAL(struct acpi_gpe_xrupt_info *, acpi_gbl_gpe_xrupt_list_head);
406ACPI_EXTERN struct acpi_gpe_block_info 395ACPI_GLOBAL(struct acpi_gpe_block_info *,
407 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 396 acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]);
408ACPI_EXTERN acpi_gbl_event_handler acpi_gbl_global_event_handler; 397ACPI_GLOBAL(acpi_gbl_event_handler, acpi_gbl_global_event_handler);
409ACPI_EXTERN void *acpi_gbl_global_event_handler_context; 398ACPI_GLOBAL(void *, acpi_gbl_global_event_handler_context);
410ACPI_EXTERN struct acpi_fixed_event_handler 399ACPI_GLOBAL(struct acpi_fixed_event_handler,
411 acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; 400 acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]);
401
412extern struct acpi_fixed_event_info 402extern struct acpi_fixed_event_info
413 acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; 403 acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
414 404
@@ -420,23 +410,19 @@ extern struct acpi_fixed_event_info
420 * 410 *
421 ****************************************************************************/ 411 ****************************************************************************/
422 412
423/* Procedure nesting level for debug output */
424
425extern u32 acpi_gbl_nesting_level;
426
427/* Event counters */ 413/* Event counters */
428 414
429ACPI_EXTERN u32 acpi_method_count; 415ACPI_GLOBAL(u32, acpi_method_count);
430ACPI_EXTERN u32 acpi_gpe_count; 416ACPI_GLOBAL(u32, acpi_gpe_count);
431ACPI_EXTERN u32 acpi_sci_count; 417ACPI_GLOBAL(u32, acpi_sci_count);
432ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]; 418ACPI_GLOBAL(u32, acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]);
433 419
434/* Support for dynamic control method tracing mechanism */ 420/* Support for dynamic control method tracing mechanism */
435 421
436ACPI_EXTERN u32 acpi_gbl_original_dbg_level; 422ACPI_GLOBAL(u32, acpi_gbl_original_dbg_level);
437ACPI_EXTERN u32 acpi_gbl_original_dbg_layer; 423ACPI_GLOBAL(u32, acpi_gbl_original_dbg_layer);
438ACPI_EXTERN u32 acpi_gbl_trace_dbg_level; 424ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_level);
439ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; 425ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer);
440 426
441/***************************************************************************** 427/*****************************************************************************
442 * 428 *
@@ -444,61 +430,64 @@ ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
444 * 430 *
445 ****************************************************************************/ 431 ****************************************************************************/
446 432
447ACPI_EXTERN u8 acpi_gbl_db_output_flags; 433ACPI_GLOBAL(u8, acpi_gbl_db_output_flags);
448 434
449#ifdef ACPI_DISASSEMBLER 435#ifdef ACPI_DISASSEMBLER
450 436
451ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_ignore_noop_operator, FALSE); 437/* Do not disassemble buffers to resource descriptors */
438
439ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE);
440ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
452 441
453ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; 442ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm);
454ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; 443ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose);
455ACPI_EXTERN u8 acpi_gbl_num_external_methods; 444ACPI_GLOBAL(u8, acpi_gbl_num_external_methods);
456ACPI_EXTERN u32 acpi_gbl_resolved_external_methods; 445ACPI_GLOBAL(u32, acpi_gbl_resolved_external_methods);
457ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list; 446ACPI_GLOBAL(struct acpi_external_list *, acpi_gbl_external_list);
458ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list; 447ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);
459#endif 448#endif
460 449
461#ifdef ACPI_DEBUGGER 450#ifdef ACPI_DEBUGGER
462 451
463extern u8 acpi_gbl_method_executing; 452ACPI_INIT_GLOBAL(u8, acpi_gbl_db_terminate_threads, FALSE);
464extern u8 acpi_gbl_abort_method; 453ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
465extern u8 acpi_gbl_db_terminate_threads; 454ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
466 455
467ACPI_EXTERN u8 acpi_gbl_db_opt_tables; 456ACPI_GLOBAL(u8, acpi_gbl_db_opt_tables);
468ACPI_EXTERN u8 acpi_gbl_db_opt_stats; 457ACPI_GLOBAL(u8, acpi_gbl_db_opt_stats);
469ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; 458ACPI_GLOBAL(u8, acpi_gbl_db_opt_ini_methods);
470ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support; 459ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
471ACPI_EXTERN u8 acpi_gbl_db_output_to_file; 460ACPI_GLOBAL(u8, acpi_gbl_db_output_to_file);
472ACPI_EXTERN char *acpi_gbl_db_buffer; 461ACPI_GLOBAL(char *, acpi_gbl_db_buffer);
473ACPI_EXTERN char *acpi_gbl_db_filename; 462ACPI_GLOBAL(char *, acpi_gbl_db_filename);
474ACPI_EXTERN u32 acpi_gbl_db_debug_level; 463ACPI_GLOBAL(u32, acpi_gbl_db_debug_level);
475ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; 464ACPI_GLOBAL(u32, acpi_gbl_db_console_debug_level);
476ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; 465ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_db_scope_node);
477 466
478ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; 467ACPI_GLOBAL(char *, acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]);
479ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]; 468ACPI_GLOBAL(acpi_object_type, acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]);
480 469
481/* These buffers should all be the same size */ 470/* These buffers should all be the same size */
482 471
483ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]; 472ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]);
484ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]; 473ACPI_GLOBAL(char, acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]);
485ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE]; 474ACPI_GLOBAL(char, acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE]);
486ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE]; 475ACPI_GLOBAL(char, acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE]);
487 476
488/* 477/*
489 * Statistic globals 478 * Statistic globals
490 */ 479 */
491ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; 480ACPI_GLOBAL(u16, acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
492ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; 481ACPI_GLOBAL(u16, acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
493ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; 482ACPI_GLOBAL(u16, acpi_gbl_obj_type_count_misc);
494ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; 483ACPI_GLOBAL(u16, acpi_gbl_node_type_count_misc);
495ACPI_EXTERN u32 acpi_gbl_num_nodes; 484ACPI_GLOBAL(u32, acpi_gbl_num_nodes);
496ACPI_EXTERN u32 acpi_gbl_num_objects; 485ACPI_GLOBAL(u32, acpi_gbl_num_objects);
497 486
498ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; 487ACPI_GLOBAL(u32, acpi_gbl_size_of_parse_tree);
499ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; 488ACPI_GLOBAL(u32, acpi_gbl_size_of_method_trees);
500ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; 489ACPI_GLOBAL(u32, acpi_gbl_size_of_node_entries);
501ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; 490ACPI_GLOBAL(u32, acpi_gbl_size_of_acpi_objects);
502 491
503#endif /* ACPI_DEBUGGER */ 492#endif /* ACPI_DEBUGGER */
504 493
@@ -510,7 +499,7 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
510 499
511#ifdef ACPI_APPLICATION 500#ifdef ACPI_APPLICATION
512 501
513ACPI_FILE ACPI_INIT_GLOBAL(acpi_gbl_debug_file, NULL); 502ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL);
514 503
515#endif /* ACPI_APPLICATION */ 504#endif /* ACPI_APPLICATION */
516 505
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 21785da2318e..f3abeae9d2f8 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -55,31 +55,27 @@ ACPI_MODULE_NAME("utglobal")
55 * Static global variable initialization. 55 * Static global variable initialization.
56 * 56 *
57 ******************************************************************************/ 57 ******************************************************************************/
58/* 58/* Debug output control masks */
59 * We want the debug switches statically initialized so they
60 * are already set when the debugger is entered.
61 */
62/* Debug switch - level and trace mask */
63u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; 59u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
64 60
65/* Debug switch - layer (component) mask */
66
67u32 acpi_dbg_layer = 0; 61u32 acpi_dbg_layer = 0;
68u32 acpi_gbl_nesting_level = 0;
69 62
70/* Debugger globals */ 63/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
71 64
72u8 acpi_gbl_db_terminate_threads = FALSE; 65struct acpi_table_fadt acpi_gbl_FADT;
73u8 acpi_gbl_abort_method = FALSE; 66u32 acpi_gbl_trace_flags;
74u8 acpi_gbl_method_executing = FALSE; 67acpi_name acpi_gbl_trace_method_name;
68u8 acpi_gbl_system_awake_and_running;
69u32 acpi_current_gpe_count;
75 70
76/* System flags */ 71/*
77 72 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
78u32 acpi_gbl_startup_flags = 0; 73 * that the ACPI hardware is no longer required. A flag in the FADT indicates
79 74 * a reduced HW machine, and that flag is duplicated here for convenience.
80/* System starts uninitialized */ 75 */
76u8 acpi_gbl_reduced_hardware;
81 77
82u8 acpi_gbl_shutdown = TRUE; 78/* Various state name strings */
83 79
84const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = { 80const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = {
85 "\\_S0_", 81 "\\_S0_",
@@ -335,7 +331,6 @@ acpi_status acpi_ut_init_globals(void)
335 331
336 acpi_gbl_DSDT = NULL; 332 acpi_gbl_DSDT = NULL;
337 acpi_gbl_cm_single_step = FALSE; 333 acpi_gbl_cm_single_step = FALSE;
338 acpi_gbl_db_terminate_threads = FALSE;
339 acpi_gbl_shutdown = FALSE; 334 acpi_gbl_shutdown = FALSE;
340 acpi_gbl_ns_lookup_count = 0; 335 acpi_gbl_ns_lookup_count = 0;
341 acpi_gbl_ps_find_count = 0; 336 acpi_gbl_ps_find_count = 0;
@@ -382,6 +377,10 @@ acpi_status acpi_ut_init_globals(void)
382 acpi_gbl_disable_mem_tracking = FALSE; 377 acpi_gbl_disable_mem_tracking = FALSE;
383#endif 378#endif
384 379
380#ifdef ACPI_DEBUGGER
381 acpi_gbl_db_terminate_threads = FALSE;
382#endif
383
385 return_ACPI_STATUS(AE_OK); 384 return_ACPI_STATUS(AE_OK);
386} 385}
387 386