blob: f3abeae9d2f87b69650e324cd66a2ea799cc1a93 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Module Name: utglobal - Global variables for the ACPI subsystem
4 *
5 *****************************************************************************/
6
7/*
Bob Moorefbb7a2d2014-02-08 09:42:25 +08008 * Copyright (C) 2000 - 2014, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
Lv Zheng839e9282013-10-29 09:29:51 +080044#define EXPORT_ACPI_INTERFACES
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#define DEFINE_ACPI_GLOBALS
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -050048#include "accommon.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50#define _COMPONENT ACPI_UTILITIES
Bob Mooree97d6bf2008-12-30 09:45:17 +080051ACPI_MODULE_NAME("utglobal")
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Robert Moore44f6c012005-04-18 22:49:35 -040053/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 * Static global variable initialization.
56 *
57 ******************************************************************************/
Lv Zheng3aa0b082014-02-26 10:32:38 +080058/* Debug output control masks */
Len Brown4be44fc2005-08-05 00:44:28 -040059u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Bjorn Helgaase76f4272008-11-13 17:30:13 -060061u32 acpi_dbg_layer = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Lv Zheng3aa0b082014-02-26 10:32:38 +080063/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Lv Zheng3aa0b082014-02-26 10:32:38 +080065struct acpi_table_fadt acpi_gbl_FADT;
66u32 acpi_gbl_trace_flags;
67acpi_name acpi_gbl_trace_method_name;
68u8 acpi_gbl_system_awake_and_running;
69u32 acpi_current_gpe_count;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
Lv Zheng3aa0b082014-02-26 10:32:38 +080071/*
72 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
73 * that the ACPI hardware is no longer required. A flag in the FADT indicates
74 * a reduced HW machine, and that flag is duplicated here for convenience.
75 */
76u8 acpi_gbl_reduced_hardware;
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Lv Zheng3aa0b082014-02-26 10:32:38 +080078/* Various state name strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
Len Brown4be44fc2005-08-05 00:44:28 -040080const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 "\\_S0_",
82 "\\_S1_",
83 "\\_S2_",
84 "\\_S3_",
85 "\\_S4_",
86 "\\_S5_"
87};
88
Bob Moore15b8dd52009-06-29 13:39:29 +080089const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS] = {
90 "_S0W",
91 "_S1W",
92 "_S2W",
93 "_S3W",
94 "_S4W"
95};
96
97const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 "_S1D",
99 "_S2D",
100 "_S3D",
101 "_S4D"
102};
103
Robert Moore44f6c012005-04-18 22:49:35 -0400104/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 *
Bob Moore84fb2c92007-02-02 19:48:19 +0300106 * Namespace globals
107 *
108 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109/*
110 * Predefined ACPI Names (Built-in to the Interpreter)
111 *
112 * NOTES:
113 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
114 * during the initialization sequence.
115 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
Bob Moore81256662010-10-18 08:44:34 +0800116 * perform a Notify() operation on it. 09/2010: Changed to type Device.
117 * This still allows notifies, but does not confuse host code that
118 * searches for valid thermal_zone objects.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 */
Bob Moore08978312005-10-21 00:00:00 -0400120const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
121 {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
122 {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
123 {"_SB_", ACPI_TYPE_DEVICE, NULL},
124 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
Bob Moore81256662010-10-18 08:44:34 +0800125 {"_TZ_", ACPI_TYPE_DEVICE, NULL},
Bob Moore08978312005-10-21 00:00:00 -0400126 {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL},
127 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
128 {"_GL_", ACPI_TYPE_MUTEX, (char *)1},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
130#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
Bob Moore08978312005-10-21 00:00:00 -0400131 {"_OSI", ACPI_TYPE_METHOD, (char *)1},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
Robert Moore44f6c012005-04-18 22:49:35 -0400134 /* Table terminator */
135
Bob Moore08978312005-10-21 00:00:00 -0400136 {NULL, ACPI_TYPE_ANY, NULL}
Robert Moore44f6c012005-04-18 22:49:35 -0400137};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138
Bob Moore33620c52012-02-14 18:14:27 +0800139#if (!ACPI_REDUCED_HARDWARE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140/******************************************************************************
141 *
142 * Event and Hardware globals
143 *
144 ******************************************************************************/
145
Len Brown4be44fc2005-08-05 00:44:28 -0400146struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 /* Name Parent Register Register Bit Position Register Bit Mask */
148
Len Brown4be44fc2005-08-05 00:44:28 -0400149 /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS,
150 ACPI_BITPOSITION_TIMER_STATUS,
151 ACPI_BITMASK_TIMER_STATUS},
152 /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS,
153 ACPI_BITPOSITION_BUS_MASTER_STATUS,
154 ACPI_BITMASK_BUS_MASTER_STATUS},
155 /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS,
156 ACPI_BITPOSITION_GLOBAL_LOCK_STATUS,
157 ACPI_BITMASK_GLOBAL_LOCK_STATUS},
158 /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS,
159 ACPI_BITPOSITION_POWER_BUTTON_STATUS,
160 ACPI_BITMASK_POWER_BUTTON_STATUS},
161 /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS,
162 ACPI_BITPOSITION_SLEEP_BUTTON_STATUS,
163 ACPI_BITMASK_SLEEP_BUTTON_STATUS},
164 /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS,
165 ACPI_BITPOSITION_RT_CLOCK_STATUS,
166 ACPI_BITMASK_RT_CLOCK_STATUS},
167 /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS,
168 ACPI_BITPOSITION_WAKE_STATUS,
169 ACPI_BITMASK_WAKE_STATUS},
170 /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS,
171 ACPI_BITPOSITION_PCIEXP_WAKE_STATUS,
172 ACPI_BITMASK_PCIEXP_WAKE_STATUS},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
Len Brown4be44fc2005-08-05 00:44:28 -0400174 /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
175 ACPI_BITPOSITION_TIMER_ENABLE,
176 ACPI_BITMASK_TIMER_ENABLE},
177 /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
178 ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE,
179 ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
180 /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
181 ACPI_BITPOSITION_POWER_BUTTON_ENABLE,
182 ACPI_BITMASK_POWER_BUTTON_ENABLE},
183 /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
184 ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE,
185 ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
186 /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
187 ACPI_BITPOSITION_RT_CLOCK_ENABLE,
188 ACPI_BITMASK_RT_CLOCK_ENABLE},
Len Brown4be44fc2005-08-05 00:44:28 -0400189 /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE,
190 ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE,
191 ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
Len Brown4be44fc2005-08-05 00:44:28 -0400193 /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL,
194 ACPI_BITPOSITION_SCI_ENABLE,
195 ACPI_BITMASK_SCI_ENABLE},
196 /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL,
197 ACPI_BITPOSITION_BUS_MASTER_RLD,
198 ACPI_BITMASK_BUS_MASTER_RLD},
199 /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL,
200 ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE,
201 ACPI_BITMASK_GLOBAL_LOCK_RELEASE},
Bob Moore82d79b82009-02-18 14:31:05 +0800202 /* ACPI_BITREG_SLEEP_TYPE */ {ACPI_REGISTER_PM1_CONTROL,
203 ACPI_BITPOSITION_SLEEP_TYPE,
204 ACPI_BITMASK_SLEEP_TYPE},
Len Brown4be44fc2005-08-05 00:44:28 -0400205 /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL,
206 ACPI_BITPOSITION_SLEEP_ENABLE,
207 ACPI_BITMASK_SLEEP_ENABLE},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
Len Brown4be44fc2005-08-05 00:44:28 -0400209 /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL,
210 ACPI_BITPOSITION_ARB_DISABLE,
211 ACPI_BITMASK_ARB_DISABLE}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212};
213
Len Brown4be44fc2005-08-05 00:44:28 -0400214struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = {
215 /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS,
216 ACPI_BITREG_TIMER_ENABLE,
217 ACPI_BITMASK_TIMER_STATUS,
218 ACPI_BITMASK_TIMER_ENABLE},
219 /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS,
220 ACPI_BITREG_GLOBAL_LOCK_ENABLE,
221 ACPI_BITMASK_GLOBAL_LOCK_STATUS,
222 ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
223 /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS,
224 ACPI_BITREG_POWER_BUTTON_ENABLE,
225 ACPI_BITMASK_POWER_BUTTON_STATUS,
226 ACPI_BITMASK_POWER_BUTTON_ENABLE},
227 /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS,
228 ACPI_BITREG_SLEEP_BUTTON_ENABLE,
229 ACPI_BITMASK_SLEEP_BUTTON_STATUS,
230 ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
231 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS,
232 ACPI_BITREG_RT_CLOCK_ENABLE,
233 ACPI_BITMASK_RT_CLOCK_STATUS,
234 ACPI_BITMASK_RT_CLOCK_ENABLE},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235};
Bob Moore33620c52012-02-14 18:14:27 +0800236#endif /* !ACPI_REDUCED_HARDWARE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
Robert Moore44f6c012005-04-18 22:49:35 -0400238/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240 * FUNCTION: acpi_ut_init_globals
241 *
Robert Moore44f6c012005-04-18 22:49:35 -0400242 * PARAMETERS: None
243 *
Yi Yangb417d402008-08-04 10:30:09 +0800244 * RETURN: Status
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 *
Bob Moorecf489582012-07-16 09:52:27 +0800246 * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
247 * initialization should be initialized here. This allows for
248 * a warm restart.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249 *
Robert Moore44f6c012005-04-18 22:49:35 -0400250 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
Yi Yangb417d402008-08-04 10:30:09 +0800252acpi_status acpi_ut_init_globals(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253{
Len Brown4be44fc2005-08-05 00:44:28 -0400254 acpi_status status;
255 u32 i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
Bob Mooreb229cf92006-04-21 17:15:00 -0400257 ACPI_FUNCTION_TRACE(ut_init_globals);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258
Robert Moore73459f72005-06-24 00:00:00 -0400259 /* Create all memory caches */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Len Brown4be44fc2005-08-05 00:44:28 -0400261 status = acpi_ut_create_caches();
262 if (ACPI_FAILURE(status)) {
Yi Yangb417d402008-08-04 10:30:09 +0800263 return_ACPI_STATUS(status);
Robert Moore73459f72005-06-24 00:00:00 -0400264 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265
Lin Mingf654c0f2012-01-12 13:10:32 +0800266 /* Address Range lists */
267
268 for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) {
269 acpi_gbl_address_range_list[i] = NULL;
270 }
271
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272 /* Mutex locked flags */
273
Bob Moore4c90ece2006-06-08 16:29:00 -0400274 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400275 acpi_gbl_mutex_info[i].mutex = NULL;
276 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
277 acpi_gbl_mutex_info[i].use_count = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278 }
279
Bob Moore28f55eb2005-12-02 18:27:00 -0500280 for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) {
281 acpi_gbl_owner_id_mask[i] = 0;
282 }
Bob Mooreec41f192009-02-18 15:03:30 +0800283
Bob Mooreba494be2012-07-12 09:40:10 +0800284 /* Last owner_ID is never valid */
Bob Mooreec41f192009-02-18 15:03:30 +0800285
286 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
Bob Moore28f55eb2005-12-02 18:27:00 -0500287
Lv Zheng9187a412013-10-31 09:30:28 +0800288 /* Event counters */
289
290 acpi_method_count = 0;
291 acpi_sci_count = 0;
292 acpi_gpe_count = 0;
293
294 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
295 acpi_fixed_event_count[i] = 0;
296 }
297
Bob Moore33620c52012-02-14 18:14:27 +0800298#if (!ACPI_REDUCED_HARDWARE)
299
Lv Zhenga2fd4b42013-09-23 09:52:05 +0800300 /* GPE/SCI support */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301
Lv Zheng75e44462012-12-19 05:37:41 +0000302 acpi_gbl_all_gpes_initialized = FALSE;
Len Brown4be44fc2005-08-05 00:44:28 -0400303 acpi_gbl_gpe_xrupt_list_head = NULL;
304 acpi_gbl_gpe_fadt_blocks[0] = NULL;
305 acpi_gbl_gpe_fadt_blocks[1] = NULL;
Bob Mooree97d6bf2008-12-30 09:45:17 +0800306 acpi_current_gpe_count = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307
Bob Moore33620c52012-02-14 18:14:27 +0800308 acpi_gbl_global_event_handler = NULL;
Lv Zhenga2fd4b42013-09-23 09:52:05 +0800309 acpi_gbl_sci_handler_list = NULL;
Bob Moore33620c52012-02-14 18:14:27 +0800310
311#endif /* !ACPI_REDUCED_HARDWARE */
312
Lin Ming3e08e2d2008-04-10 19:06:38 +0400313 /* Global handlers */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Bob Moore86ed4bc2012-05-03 11:08:19 +0800315 acpi_gbl_global_notify[0].handler = NULL;
316 acpi_gbl_global_notify[1].handler = NULL;
Len Brown4be44fc2005-08-05 00:44:28 -0400317 acpi_gbl_exception_handler = NULL;
318 acpi_gbl_init_handler = NULL;
Lin Ming3e08e2d2008-04-10 19:06:38 +0400319 acpi_gbl_table_handler = NULL;
Lin Mingb0ed7a92010-08-06 09:35:51 +0800320 acpi_gbl_interface_handler = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322 /* Global Lock support */
323
Bob Moore967440e32006-06-23 17:04:00 -0400324 acpi_gbl_global_lock_semaphore = NULL;
Bob Moorec81da662007-02-02 19:48:18 +0300325 acpi_gbl_global_lock_mutex = NULL;
Len Brown4be44fc2005-08-05 00:44:28 -0400326 acpi_gbl_global_lock_acquired = FALSE;
Len Brown4be44fc2005-08-05 00:44:28 -0400327 acpi_gbl_global_lock_handle = 0;
Bob Moore009c4cbe2008-11-12 15:34:52 +0800328 acpi_gbl_global_lock_present = FALSE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329
330 /* Miscellaneous variables */
331
Bob Moore43323cb2010-04-07 11:05:11 +0800332 acpi_gbl_DSDT = NULL;
Len Brown4be44fc2005-08-05 00:44:28 -0400333 acpi_gbl_cm_single_step = FALSE;
Len Brown4be44fc2005-08-05 00:44:28 -0400334 acpi_gbl_shutdown = FALSE;
335 acpi_gbl_ns_lookup_count = 0;
336 acpi_gbl_ps_find_count = 0;
337 acpi_gbl_acpi_hardware_present = TRUE;
Bob Moore28f55eb2005-12-02 18:27:00 -0500338 acpi_gbl_last_owner_id_index = 0;
339 acpi_gbl_next_owner_id_offset = 0;
Bob Moore50eca3e2005-09-30 19:03:00 -0400340 acpi_gbl_trace_method_name = 0;
341 acpi_gbl_trace_dbg_level = 0;
342 acpi_gbl_trace_dbg_layer = 0;
Len Brown4be44fc2005-08-05 00:44:28 -0400343 acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
344 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
Lin Mingb0ed7a92010-08-06 09:35:51 +0800345 acpi_gbl_osi_mutex = NULL;
Bob Mooreef09c4f2011-02-14 16:13:25 +0800346 acpi_gbl_reg_methods_executed = FALSE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347
348 /* Hardware oriented */
349
Len Brown4be44fc2005-08-05 00:44:28 -0400350 acpi_gbl_events_initialized = FALSE;
351 acpi_gbl_system_awake_and_running = TRUE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352
353 /* Namespace */
354
Lin Ming7f0c8262009-08-13 14:03:15 +0800355 acpi_gbl_module_code_list = NULL;
Len Brown4be44fc2005-08-05 00:44:28 -0400356 acpi_gbl_root_node = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357 acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
Bob Moore616861242006-03-17 16:44:00 -0500358 acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
Len Brown4be44fc2005-08-05 00:44:28 -0400359 acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
Alexey Starikovskiyc45b5c02010-05-26 11:53:07 +0800360 acpi_gbl_root_node_struct.parent = NULL;
Len Brown4be44fc2005-08-05 00:44:28 -0400361 acpi_gbl_root_node_struct.child = NULL;
362 acpi_gbl_root_node_struct.peer = NULL;
363 acpi_gbl_root_node_struct.object = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364
Lv Zheng56324c12012-12-19 05:37:03 +0000365#ifdef ACPI_DISASSEMBLER
366 acpi_gbl_external_list = NULL;
Bob Moore40411252013-03-08 09:23:39 +0000367 acpi_gbl_num_external_methods = 0;
368 acpi_gbl_resolved_external_methods = 0;
Lv Zheng56324c12012-12-19 05:37:03 +0000369#endif
370
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371#ifdef ACPI_DEBUG_OUTPUT
Bob Moore1d18c052008-04-10 19:06:40 +0400372 acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373#endif
374
Bob Moored41eb992007-02-02 19:48:23 +0300375#ifdef ACPI_DBG_TRACK_ALLOCATIONS
376 acpi_gbl_display_final_mem_stats = FALSE;
Lv Zheng75e44462012-12-19 05:37:41 +0000377 acpi_gbl_disable_mem_tracking = FALSE;
Bob Moored41eb992007-02-02 19:48:23 +0300378#endif
379
Lv Zheng3aa0b082014-02-26 10:32:38 +0800380#ifdef ACPI_DEBUGGER
381 acpi_gbl_db_terminate_threads = FALSE;
382#endif
383
Yi Yangb417d402008-08-04 10:30:09 +0800384 return_ACPI_STATUS(AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385}
Bob Moore83135242006-10-03 00:00:00 -0400386
Lv Zheng75c80442012-12-19 05:36:49 +0000387/* Public globals */
Lv Zheng3e8214e2012-12-19 05:37:15 +0000388
Bob Mooree97d6bf2008-12-30 09:45:17 +0800389ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
Bob Moore83135242006-10-03 00:00:00 -0400390ACPI_EXPORT_SYMBOL(acpi_dbg_level)
Bob Moore1044f1f2008-09-27 11:08:41 +0800391ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
Lv Zheng9187a412013-10-31 09:30:28 +0800392ACPI_EXPORT_SYMBOL(acpi_gpe_count)
Bob Mooree97d6bf2008-12-30 09:45:17 +0800393ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)