Blame view

drivers/acpi/acpica/utglobal.c 23.8 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
  /******************************************************************************
   *
   * Module Name: utglobal - Global variables for the ACPI subsystem
   *
   *****************************************************************************/
  
  /*
75a44ce00   Len Brown   ACPICA: update In...
8
   * Copyright (C) 2000 - 2008, Intel Corp.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions, and the following disclaimer,
   *    without modification.
   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
   *    substantially similar to the "NO WARRANTY" disclaimer below
   *    ("Disclaimer") and any redistribution must be conditioned upon
   *    including a substantially similar Disclaimer requirement for further
   *    binary redistribution.
   * 3. Neither the names of the above-listed copyright holders nor the names
   *    of any contributors may be used to endorse or promote products derived
   *    from this software without specific prior written permission.
   *
   * Alternatively, this software may be distributed under the terms of the
   * GNU General Public License ("GPL") version 2 as published by the Free
   * Software Foundation.
   *
   * NO WARRANTY
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
   * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGES.
   */
  
  #define DEFINE_ACPI_GLOBALS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
  #include <acpi/acpi.h>
e2f7a7772   Len Brown   ACPICA: hide priv...
46
47
  #include "accommon.h"
  #include "acnamesp.h"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
48
49
  
  #define _COMPONENT          ACPI_UTILITIES
e97d6bf1a   Bob Moore   ACPICA: New: acpi...
50
  ACPI_MODULE_NAME("utglobal")
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
51

44f6c0124   Robert Moore   ACPICA 20050408 f...
52
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
53
   *
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
54
55
56
   * Static global variable initialization.
   *
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
57
58
59
60
  /*
   * We want the debug switches statically initialized so they
   * are already set when the debugger is entered.
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
61
  /* Debug switch - level and trace mask */
4be44fcd3   Len Brown   [ACPI] Lindent al...
62
  u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
63
64
  
  /* Debug switch - layer (component) mask */
e76f42761   Bjorn Helgaas   ACPI: fix 2.6.28 ...
65
  u32 acpi_dbg_layer = 0;
4be44fcd3   Len Brown   [ACPI] Lindent al...
66
  u32 acpi_gbl_nesting_level = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
67
68
  
  /* Debugger globals */
4be44fcd3   Len Brown   [ACPI] Lindent al...
69
70
71
  u8 acpi_gbl_db_terminate_threads = FALSE;
  u8 acpi_gbl_abort_method = FALSE;
  u8 acpi_gbl_method_executing = FALSE;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
72
73
  
  /* System flags */
4be44fcd3   Len Brown   [ACPI] Lindent al...
74
  u32 acpi_gbl_startup_flags = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
75
76
  
  /* System starts uninitialized */
4be44fcd3   Len Brown   [ACPI] Lindent al...
77
  u8 acpi_gbl_shutdown = TRUE;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
78

4be44fcd3   Len Brown   [ACPI] Lindent al...
79
  const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
80
81
82
83
84
85
86
  	"\\_S0_",
  	"\\_S1_",
  	"\\_S2_",
  	"\\_S3_",
  	"\\_S4_",
  	"\\_S5_"
  };
15b8dd53f   Bob Moore   ACPICA: Major upd...
87
88
89
90
91
92
93
94
95
  const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS] = {
  	"_S0W",
  	"_S1W",
  	"_S2W",
  	"_S3W",
  	"_S4W"
  };
  
  const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
96
97
98
99
100
  	"_S1D",
  	"_S2D",
  	"_S3D",
  	"_S4D"
  };
44f6c0124   Robert Moore   ACPICA 20050408 f...
101
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102
   *
84fb2c977   Bob Moore   ACPICA: Split acp...
103
104
105
106
107
108
109
110
111
   * FUNCTION:    acpi_format_exception
   *
   * PARAMETERS:  Status       - The acpi_status code to be formatted
   *
   * RETURN:      A string containing the exception text. A valid pointer is
   *              always returned.
   *
   * DESCRIPTION: This function translates an ACPI exception into an ASCII string
   *              It is here instead of utxface.c so it is always present.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
112
113
   *
   ******************************************************************************/
84fb2c977   Bob Moore   ACPICA: Split acp...
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
  const char *acpi_format_exception(acpi_status status)
  {
  	const char *exception = NULL;
  
  	ACPI_FUNCTION_ENTRY();
  
  	exception = acpi_ut_validate_exception(status);
  	if (!exception) {
  
  		/* Exception code was not recognized */
  
  		ACPI_ERROR((AE_INFO,
  			    "Unknown exception code: 0x%8.8X", status));
  
  		exception = "UNKNOWN_STATUS_CODE";
3e0d69ecf   Andrew Morton   ACPI: add dump_st...
129
  		dump_stack();
84fb2c977   Bob Moore   ACPICA: Split acp...
130
131
132
133
134
135
136
137
138
139
140
141
  	}
  
  	return (ACPI_CAST_PTR(const char, exception));
  }
  
  ACPI_EXPORT_SYMBOL(acpi_format_exception)
  
  /*******************************************************************************
   *
   * Namespace globals
   *
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
142
143
144
145
146
147
148
149
150
  /*
   * Predefined ACPI Names (Built-in to the Interpreter)
   *
   * NOTES:
   * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
   *    during the initialization sequence.
   * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
   *    perform a Notify() operation on it.
   */
0897831bb   Bob Moore   [ACPI] ACPICA 200...
151
152
153
154
155
156
157
158
159
  const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
  	{"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
  	{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
  	{"_SB_", ACPI_TYPE_DEVICE, NULL},
  	{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
  	{"_TZ_", ACPI_TYPE_THERMAL, NULL},
  	{"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL},
  	{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
  	{"_GL_", ACPI_TYPE_MUTEX, (char *)1},
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
160
161
  
  #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
0897831bb   Bob Moore   [ACPI] ACPICA 200...
162
  	{"_OSI", ACPI_TYPE_METHOD, (char *)1},
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
163
  #endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
164

44f6c0124   Robert Moore   ACPICA 20050408 f...
165
  	/* Table terminator */
0897831bb   Bob Moore   [ACPI] ACPICA 200...
166
  	{NULL, ACPI_TYPE_ANY, NULL}
44f6c0124   Robert Moore   ACPICA 20050408 f...
167
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
168
169
170
171
172
  
  /*
   * Properties of the ACPI Object Types, both internal and external.
   * The table is indexed by values of acpi_object_type
   */
4be44fcd3   Len Brown   [ACPI] Lindent al...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
  const u8 acpi_gbl_ns_properties[] = {
  	ACPI_NS_NORMAL,		/* 00 Any              */
  	ACPI_NS_NORMAL,		/* 01 Number           */
  	ACPI_NS_NORMAL,		/* 02 String           */
  	ACPI_NS_NORMAL,		/* 03 Buffer           */
  	ACPI_NS_NORMAL,		/* 04 Package          */
  	ACPI_NS_NORMAL,		/* 05 field_unit       */
  	ACPI_NS_NEWSCOPE,	/* 06 Device           */
  	ACPI_NS_NORMAL,		/* 07 Event            */
  	ACPI_NS_NEWSCOPE,	/* 08 Method           */
  	ACPI_NS_NORMAL,		/* 09 Mutex            */
  	ACPI_NS_NORMAL,		/* 10 Region           */
  	ACPI_NS_NEWSCOPE,	/* 11 Power            */
  	ACPI_NS_NEWSCOPE,	/* 12 Processor        */
  	ACPI_NS_NEWSCOPE,	/* 13 Thermal          */
  	ACPI_NS_NORMAL,		/* 14 buffer_field     */
  	ACPI_NS_NORMAL,		/* 15 ddb_handle       */
  	ACPI_NS_NORMAL,		/* 16 Debug Object     */
  	ACPI_NS_NORMAL,		/* 17 def_field        */
  	ACPI_NS_NORMAL,		/* 18 bank_field       */
  	ACPI_NS_NORMAL,		/* 19 index_field      */
  	ACPI_NS_NORMAL,		/* 20 Reference        */
  	ACPI_NS_NORMAL,		/* 21 Alias            */
  	ACPI_NS_NORMAL,		/* 22 method_alias     */
  	ACPI_NS_NORMAL,		/* 23 Notify           */
  	ACPI_NS_NORMAL,		/* 24 Address Handler  */
  	ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,	/* 25 Resource Desc    */
  	ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,	/* 26 Resource Field   */
  	ACPI_NS_NEWSCOPE,	/* 27 Scope            */
  	ACPI_NS_NORMAL,		/* 28 Extra            */
  	ACPI_NS_NORMAL,		/* 29 Data             */
  	ACPI_NS_NORMAL		/* 30 Invalid          */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
205
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
206
  /* Hex to ASCII conversion table */
4be44fcd3   Len Brown   [ACPI] Lindent al...
207
208
209
  static const char acpi_gbl_hex_to_ascii[] = {
  	'0', '1', '2', '3', '4', '5', '6', '7',
  	'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
44f6c0124   Robert Moore   ACPICA 20050408 f...
210
  };
44f6c0124   Robert Moore   ACPICA 20050408 f...
211
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
212
213
214
215
216
   *
   * FUNCTION:    acpi_ut_hex_to_ascii_char
   *
   * PARAMETERS:  Integer             - Contains the hex digit
   *              Position            - bit position of the digit within the
44f6c0124   Robert Moore   ACPICA 20050408 f...
217
   *                                    integer (multiple of 4)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
218
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
219
   * RETURN:      The converted Ascii character
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
220
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
221
   * DESCRIPTION: Convert a hex digit to an Ascii character
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
222
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
223
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
224

4be44fcd3   Len Brown   [ACPI] Lindent al...
225
  char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
226
227
228
229
  {
  
  	return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]);
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
230
231
232
233
234
  /******************************************************************************
   *
   * Event and Hardware globals
   *
   ******************************************************************************/
4be44fcd3   Len Brown   [ACPI] Lindent al...
235
  struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
236
  	/* Name                                     Parent Register             Register Bit Position                   Register Bit Mask       */
4be44fcd3   Len Brown   [ACPI] Lindent al...
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
  	/* ACPI_BITREG_TIMER_STATUS         */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_TIMER_STATUS,
  						ACPI_BITMASK_TIMER_STATUS},
  	/* ACPI_BITREG_BUS_MASTER_STATUS    */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_BUS_MASTER_STATUS,
  						ACPI_BITMASK_BUS_MASTER_STATUS},
  	/* ACPI_BITREG_GLOBAL_LOCK_STATUS   */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_GLOBAL_LOCK_STATUS,
  						ACPI_BITMASK_GLOBAL_LOCK_STATUS},
  	/* ACPI_BITREG_POWER_BUTTON_STATUS  */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_POWER_BUTTON_STATUS,
  						ACPI_BITMASK_POWER_BUTTON_STATUS},
  	/* ACPI_BITREG_SLEEP_BUTTON_STATUS  */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_SLEEP_BUTTON_STATUS,
  						ACPI_BITMASK_SLEEP_BUTTON_STATUS},
  	/* ACPI_BITREG_RT_CLOCK_STATUS      */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_RT_CLOCK_STATUS,
  						ACPI_BITMASK_RT_CLOCK_STATUS},
  	/* ACPI_BITREG_WAKE_STATUS          */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_WAKE_STATUS,
  						ACPI_BITMASK_WAKE_STATUS},
  	/* ACPI_BITREG_PCIEXP_WAKE_STATUS   */ {ACPI_REGISTER_PM1_STATUS,
  						ACPI_BITPOSITION_PCIEXP_WAKE_STATUS,
  						ACPI_BITMASK_PCIEXP_WAKE_STATUS},
  
  	/* ACPI_BITREG_TIMER_ENABLE         */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_TIMER_ENABLE,
  						ACPI_BITMASK_TIMER_ENABLE},
  	/* ACPI_BITREG_GLOBAL_LOCK_ENABLE   */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE,
  						ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
  	/* ACPI_BITREG_POWER_BUTTON_ENABLE  */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_POWER_BUTTON_ENABLE,
  						ACPI_BITMASK_POWER_BUTTON_ENABLE},
  	/* ACPI_BITREG_SLEEP_BUTTON_ENABLE  */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE,
  						ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
  	/* ACPI_BITREG_RT_CLOCK_ENABLE      */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_RT_CLOCK_ENABLE,
  						ACPI_BITMASK_RT_CLOCK_ENABLE},
4be44fcd3   Len Brown   [ACPI] Lindent al...
277
278
279
280
281
282
283
284
285
286
287
288
289
  	/* ACPI_BITREG_PCIEXP_WAKE_DISABLE  */ {ACPI_REGISTER_PM1_ENABLE,
  						ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE,
  						ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
  
  	/* ACPI_BITREG_SCI_ENABLE           */ {ACPI_REGISTER_PM1_CONTROL,
  						ACPI_BITPOSITION_SCI_ENABLE,
  						ACPI_BITMASK_SCI_ENABLE},
  	/* ACPI_BITREG_BUS_MASTER_RLD       */ {ACPI_REGISTER_PM1_CONTROL,
  						ACPI_BITPOSITION_BUS_MASTER_RLD,
  						ACPI_BITMASK_BUS_MASTER_RLD},
  	/* ACPI_BITREG_GLOBAL_LOCK_RELEASE  */ {ACPI_REGISTER_PM1_CONTROL,
  						ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE,
  						ACPI_BITMASK_GLOBAL_LOCK_RELEASE},
82d79b866   Bob Moore   ACPICA: Remove re...
290
291
292
  	/* ACPI_BITREG_SLEEP_TYPE           */ {ACPI_REGISTER_PM1_CONTROL,
  						ACPI_BITPOSITION_SLEEP_TYPE,
  						ACPI_BITMASK_SLEEP_TYPE},
4be44fcd3   Len Brown   [ACPI] Lindent al...
293
294
295
296
297
298
299
  	/* ACPI_BITREG_SLEEP_ENABLE         */ {ACPI_REGISTER_PM1_CONTROL,
  						ACPI_BITPOSITION_SLEEP_ENABLE,
  						ACPI_BITMASK_SLEEP_ENABLE},
  
  	/* ACPI_BITREG_ARB_DIS              */ {ACPI_REGISTER_PM2_CONTROL,
  						ACPI_BITPOSITION_ARB_DISABLE,
  						ACPI_BITMASK_ARB_DISABLE}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
300
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
  struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = {
  	/* ACPI_EVENT_PMTIMER       */ {ACPI_BITREG_TIMER_STATUS,
  					ACPI_BITREG_TIMER_ENABLE,
  					ACPI_BITMASK_TIMER_STATUS,
  					ACPI_BITMASK_TIMER_ENABLE},
  	/* ACPI_EVENT_GLOBAL        */ {ACPI_BITREG_GLOBAL_LOCK_STATUS,
  					ACPI_BITREG_GLOBAL_LOCK_ENABLE,
  					ACPI_BITMASK_GLOBAL_LOCK_STATUS,
  					ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
  	/* ACPI_EVENT_POWER_BUTTON  */ {ACPI_BITREG_POWER_BUTTON_STATUS,
  					ACPI_BITREG_POWER_BUTTON_ENABLE,
  					ACPI_BITMASK_POWER_BUTTON_STATUS,
  					ACPI_BITMASK_POWER_BUTTON_ENABLE},
  	/* ACPI_EVENT_SLEEP_BUTTON  */ {ACPI_BITREG_SLEEP_BUTTON_STATUS,
  					ACPI_BITREG_SLEEP_BUTTON_ENABLE,
  					ACPI_BITMASK_SLEEP_BUTTON_STATUS,
  					ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
  	/* ACPI_EVENT_RTC           */ {ACPI_BITREG_RT_CLOCK_STATUS,
  					ACPI_BITREG_RT_CLOCK_ENABLE,
  					ACPI_BITMASK_RT_CLOCK_STATUS,
  					ACPI_BITMASK_RT_CLOCK_ENABLE},
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
322
  };
44f6c0124   Robert Moore   ACPICA 20050408 f...
323
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
324
325
326
327
328
329
330
331
332
   *
   * FUNCTION:    acpi_ut_get_region_name
   *
   * PARAMETERS:  None.
   *
   * RETURN:      Status
   *
   * DESCRIPTION: Translate a Space ID into a name string (Debug only)
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
333
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
334
335
  
  /* Region type decoding */
4be44fcd3   Len Brown   [ACPI] Lindent al...
336
  const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
337
338
339
340
341
  	"SystemMemory",
  	"SystemIO",
  	"PCI_Config",
  	"EmbeddedControl",
  	"SMBus",
34830726c   Bob Moore   ACPICA: Fix names...
342
  	"SystemCMOS",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
343
  	"PCIBARTarget",
3db20bed5   Lin Ming   ACPICA: ACPI 4.0:...
344
  	"IPMI",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
345
  	"DataTable"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
346
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
347
  char *acpi_ut_get_region_name(u8 space_id)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
348
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
349
  	if (space_id >= ACPI_USER_REGION_BEGIN) {
b229cf92e   Bob Moore   ACPI: ACPICA 2006...
350
  		return ("UserDefinedRegion");
4be44fcd3   Len Brown   [ACPI] Lindent al...
351
  	} else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) {
b229cf92e   Bob Moore   ACPI: ACPICA 2006...
352
  		return ("InvalidSpaceId");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
353
  	}
defba1d8f   Bob Moore   [ACPI] ACPICA 200...
354
  	return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id]));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
355
  }
44f6c0124   Robert Moore   ACPICA 20050408 f...
356
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
357
358
359
360
361
362
363
364
365
   *
   * FUNCTION:    acpi_ut_get_event_name
   *
   * PARAMETERS:  None.
   *
   * RETURN:      Status
   *
   * DESCRIPTION: Translate a Event ID into a name string (Debug only)
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
366
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
367
368
  
  /* Event type decoding */
4be44fcd3   Len Brown   [ACPI] Lindent al...
369
  static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
370
  	"PM_Timer",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
371
372
373
374
  	"GlobalLock",
  	"PowerButton",
  	"SleepButton",
  	"RealTimeClock",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
375
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
376
  char *acpi_ut_get_event_name(u32 event_id)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
377
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
378
  	if (event_id > ACPI_EVENT_MAX) {
b229cf92e   Bob Moore   ACPI: ACPICA 2006...
379
  		return ("InvalidEventID");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
380
  	}
4a90c7e86   Bob Moore   [ACPI] ACPICA 200...
381
  	return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id]));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
382
  }
44f6c0124   Robert Moore   ACPICA 20050408 f...
383
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
384
385
386
387
388
389
390
391
392
   *
   * FUNCTION:    acpi_ut_get_type_name
   *
   * PARAMETERS:  None.
   *
   * RETURN:      Status
   *
   * DESCRIPTION: Translate a Type ID into a name string (Debug only)
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
393
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
394
395
396
397
398
  
  /*
   * Elements of acpi_gbl_ns_type_names below must match
   * one-to-one with values of acpi_object_type
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
399
400
401
   * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
   * when stored in a table it really means that we have thus far seen no
   * evidence to indicate what type is actually going to be stored for this entry.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
402
   */
4be44fcd3   Len Brown   [ACPI] Lindent al...
403
  static const char acpi_gbl_bad_type[] = "UNDEFINED";
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
404

44f6c0124   Robert Moore   ACPICA 20050408 f...
405
  /* Printable names of the ACPI object types */
4be44fcd3   Len Brown   [ACPI] Lindent al...
406
  static const char *acpi_gbl_ns_type_names[] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
407
408
409
410
411
  	/* 00 */ "Untyped",
  	/* 01 */ "Integer",
  	/* 02 */ "String",
  	/* 03 */ "Buffer",
  	/* 04 */ "Package",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
412
  	/* 05 */ "FieldUnit",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
413
414
415
416
417
418
419
420
  	/* 06 */ "Device",
  	/* 07 */ "Event",
  	/* 08 */ "Method",
  	/* 09 */ "Mutex",
  	/* 10 */ "Region",
  	/* 11 */ "Power",
  	/* 12 */ "Processor",
  	/* 13 */ "Thermal",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
421
422
423
424
425
426
  	/* 14 */ "BufferField",
  	/* 15 */ "DdbHandle",
  	/* 16 */ "DebugObject",
  	/* 17 */ "RegionField",
  	/* 18 */ "BankField",
  	/* 19 */ "IndexField",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
427
428
  	/* 20 */ "Reference",
  	/* 21 */ "Alias",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
429
  	/* 22 */ "MethodAlias",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
430
  	/* 23 */ "Notify",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
431
432
433
  	/* 24 */ "AddrHandler",
  	/* 25 */ "ResourceDesc",
  	/* 26 */ "ResourceFld",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
434
435
436
437
438
  	/* 27 */ "Scope",
  	/* 28 */ "Extra",
  	/* 29 */ "Data",
  	/* 30 */ "Invalid"
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
439
  char *acpi_ut_get_type_name(acpi_object_type type)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
440
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
441
  	if (type > ACPI_TYPE_INVALID) {
4a90c7e86   Bob Moore   [ACPI] ACPICA 200...
442
  		return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
443
  	}
4a90c7e86   Bob Moore   [ACPI] ACPICA 200...
444
  	return (ACPI_CAST_PTR(char, acpi_gbl_ns_type_names[type]));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
445
  }
4be44fcd3   Len Brown   [ACPI] Lindent al...
446
  char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
447
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
448
  	if (!obj_desc) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
449
450
  		return ("[NULL Object Descriptor]");
  	}
3371c19c2   Bob Moore   ACPICA: Remove AC...
451
  	return (acpi_ut_get_type_name(obj_desc->common.type));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
452
  }
44f6c0124   Robert Moore   ACPICA 20050408 f...
453
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
454
455
456
457
458
459
460
461
462
   *
   * FUNCTION:    acpi_ut_get_node_name
   *
   * PARAMETERS:  Object               - A namespace node
   *
   * RETURN:      Pointer to a string
   *
   * DESCRIPTION: Validate the node and return the node's ACPI name.
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
463
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
464

4be44fcd3   Len Brown   [ACPI] Lindent al...
465
  char *acpi_ut_get_node_name(void *object)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
466
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
467
  	struct acpi_namespace_node *node = (struct acpi_namespace_node *)object;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
468
469
  
  	/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
4be44fcd3   Len Brown   [ACPI] Lindent al...
470
  	if (!object) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
471
472
473
474
  		return ("NULL");
  	}
  
  	/* Check for Root node */
4be44fcd3   Len Brown   [ACPI] Lindent al...
475
  	if ((object == ACPI_ROOT_OBJECT) || (object == acpi_gbl_root_node)) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
476
477
478
479
  		return ("\"\\\" ");
  	}
  
  	/* Descriptor must be a namespace node */
61686124f   Bob Moore   [ACPI] ACPICA 200...
480
  	if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
481
482
483
484
  		return ("####");
  	}
  
  	/* Name must be a valid ACPI name */
c51a4de85   Bob Moore   [ACPI] ACPICA 200...
485
  	if (!acpi_ut_valid_acpi_name(node->name.integer)) {
3d81b236a   Bob Moore   ACPICA: Fix unali...
486
  		node->name.integer = acpi_ut_repair_name(node->name.ascii);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
487
488
489
490
491
492
  	}
  
  	/* Return the name */
  
  	return (node->name.ascii);
  }
44f6c0124   Robert Moore   ACPICA 20050408 f...
493
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
494
495
496
497
498
499
500
501
502
   *
   * FUNCTION:    acpi_ut_get_descriptor_name
   *
   * PARAMETERS:  Object               - An ACPI object
   *
   * RETURN:      Pointer to a string
   *
   * DESCRIPTION: Validate object and return the descriptor type
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
503
504
505
   ******************************************************************************/
  
  /* Printable names of object descriptor types */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
506

4be44fcd3   Len Brown   [ACPI] Lindent al...
507
  static const char *acpi_gbl_desc_type_names[] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
508
509
510
511
512
513
  	/* 00 */ "Invalid",
  	/* 01 */ "Cached",
  	/* 02 */ "State-Generic",
  	/* 03 */ "State-Update",
  	/* 04 */ "State-Package",
  	/* 05 */ "State-Control",
0897831bb   Bob Moore   [ACPI] ACPICA 200...
514
515
516
  	/* 06 */ "State-RootParseScope",
  	/* 07 */ "State-ParseScope",
  	/* 08 */ "State-WalkScope",
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
517
518
519
520
521
522
523
524
  	/* 09 */ "State-Result",
  	/* 10 */ "State-Notify",
  	/* 11 */ "State-Thread",
  	/* 12 */ "Walk",
  	/* 13 */ "Parser",
  	/* 14 */ "Operand",
  	/* 15 */ "Node"
  };
4be44fcd3   Len Brown   [ACPI] Lindent al...
525
  char *acpi_ut_get_descriptor_name(void *object)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
526
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
527
  	if (!object) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
528
529
  		return ("NULL OBJECT");
  	}
4be44fcd3   Len Brown   [ACPI] Lindent al...
530
  	if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) {
defba1d8f   Bob Moore   [ACPI] ACPICA 200...
531
  		return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
532
  	}
defba1d8f   Bob Moore   [ACPI] ACPICA 200...
533
534
535
  	return (ACPI_CAST_PTR(char,
  			      acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE
  						       (object)]));
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
536
537
  
  }
f02a99ac6   Bob Moore   ACPICA: Add funct...
538
539
540
541
542
543
544
545
546
547
548
549
550
  /*******************************************************************************
   *
   * FUNCTION:    acpi_ut_get_reference_name
   *
   * PARAMETERS:  Object               - An ACPI reference object
   *
   * RETURN:      Pointer to a string
   *
   * DESCRIPTION: Decode a reference object sub-type to a string.
   *
   ******************************************************************************/
  
  /* Printable names of reference object sub-types */
1044f1f65   Bob Moore   ACPICA: Cleanup f...
551
552
553
554
555
556
557
558
559
  static const char *acpi_gbl_ref_class_names[] = {
  	/* 00 */ "Local",
  	/* 01 */ "Argument",
  	/* 02 */ "RefOf",
  	/* 03 */ "Index",
  	/* 04 */ "DdbHandle",
  	/* 05 */ "Named Object",
  	/* 06 */ "Debug"
  };
f02a99ac6   Bob Moore   ACPICA: Add funct...
560
561
  const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
  {
1044f1f65   Bob Moore   ACPICA: Cleanup f...
562
563
  	if (!object)
  		return "NULL Object";
f02a99ac6   Bob Moore   ACPICA: Add funct...
564

1044f1f65   Bob Moore   ACPICA: Cleanup f...
565
566
  	if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND)
  		return "Not an Operand object";
f02a99ac6   Bob Moore   ACPICA: Add funct...
567

1044f1f65   Bob Moore   ACPICA: Cleanup f...
568
569
  	if (object->common.type != ACPI_TYPE_LOCAL_REFERENCE)
  		return "Not a Reference object";
f02a99ac6   Bob Moore   ACPICA: Add funct...
570

1044f1f65   Bob Moore   ACPICA: Cleanup f...
571
572
  	if (object->reference.class > ACPI_REFCLASS_MAX)
  		return "Unknown Reference class";
f02a99ac6   Bob Moore   ACPICA: Add funct...
573

1044f1f65   Bob Moore   ACPICA: Cleanup f...
574
  	return acpi_gbl_ref_class_names[object->reference.class];
f02a99ac6   Bob Moore   ACPICA: Add funct...
575
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
576
577
578
579
  #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
  /*
   * Strings and procedures used for debug only
   */
44f6c0124   Robert Moore   ACPICA 20050408 f...
580
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
581
582
583
   *
   * FUNCTION:    acpi_ut_get_mutex_name
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
584
   * PARAMETERS:  mutex_id        - The predefined ID for this mutex.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
585
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
586
587
   * RETURN:      String containing the name of the mutex. Always returns a valid
   *              pointer.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
588
589
590
   *
   * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
591
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
592

4be44fcd3   Len Brown   [ACPI] Lindent al...
593
  char *acpi_ut_get_mutex_name(u32 mutex_id)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
594
  {
4c90ece24   Bob Moore   ACPI: ACPICA 2006...
595
  	if (mutex_id > ACPI_MAX_MUTEX) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
596
597
598
599
600
  		return ("Invalid Mutex ID");
  	}
  
  	return (acpi_gbl_mutex_names[mutex_id]);
  }
514d18d79   Zhang Rui   ACPICA: Update fo...
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
  
  /*******************************************************************************
   *
   * FUNCTION:    acpi_ut_get_notify_name
   *
   * PARAMETERS:  notify_value    - Value from the Notify() request
   *
   * RETURN:      String corresponding to the Notify Value.
   *
   * DESCRIPTION: Translate a Notify Value to a notify namestring.
   *
   ******************************************************************************/
  
  /* Names for Notify() values, used for debug output */
  
  static const char *acpi_gbl_notify_value_names[] = {
  	"Bus Check",
  	"Device Check",
  	"Device Wake",
  	"Eject Request",
  	"Device Check Light",
  	"Frequency Mismatch",
  	"Bus Mode Mismatch",
  	"Power Fault",
  	"Capabilities Check",
  	"Device PLD Check",
  	"Reserved",
  	"System Locality Update"
  };
  
  const char *acpi_ut_get_notify_name(u32 notify_value)
  {
  
  	if (notify_value <= ACPI_NOTIFY_MAX) {
  		return (acpi_gbl_notify_value_names[notify_value]);
  	} else if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
  		return ("Reserved");
  	} else {		/* Greater or equal to 0x80 */
  
  		return ("**Device Specific**");
  	}
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
643
  #endif
44f6c0124   Robert Moore   ACPICA 20050408 f...
644
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
645
646
647
648
649
   *
   * FUNCTION:    acpi_ut_valid_object_type
   *
   * PARAMETERS:  Type            - Object type to be validated
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
650
   * RETURN:      TRUE if valid object type, FALSE otherwise
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
651
652
653
   *
   * DESCRIPTION: Validate an object type
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
654
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
655

4be44fcd3   Len Brown   [ACPI] Lindent al...
656
  u8 acpi_ut_valid_object_type(acpi_object_type type)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
657
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
658
  	if (type > ACPI_TYPE_LOCAL_MAX) {
52fc0b026   Bob Moore   [ACPI] ACPICA 200...
659

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
660
661
662
663
664
665
666
  		/* Note: Assumes all TYPEs are contiguous (external/local) */
  
  		return (FALSE);
  	}
  
  	return (TRUE);
  }
44f6c0124   Robert Moore   ACPICA 20050408 f...
667
  /*******************************************************************************
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
668
   *
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
669
670
   * FUNCTION:    acpi_ut_init_globals
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
671
672
   * PARAMETERS:  None
   *
b417d40b9   Yi Yang   ACPICA: Return st...
673
   * RETURN:      Status
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
674
675
676
677
   *
   * DESCRIPTION: Init library globals.  All globals that require specific
   *              initialization should be initialized here!
   *
44f6c0124   Robert Moore   ACPICA 20050408 f...
678
   ******************************************************************************/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
679

b417d40b9   Yi Yang   ACPICA: Return st...
680
  acpi_status acpi_ut_init_globals(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
681
  {
4be44fcd3   Len Brown   [ACPI] Lindent al...
682
683
  	acpi_status status;
  	u32 i;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
684

b229cf92e   Bob Moore   ACPI: ACPICA 2006...
685
  	ACPI_FUNCTION_TRACE(ut_init_globals);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
686

73459f73e   Robert Moore   ACPICA 20050617-0...
687
  	/* Create all memory caches */
4be44fcd3   Len Brown   [ACPI] Lindent al...
688
689
  	status = acpi_ut_create_caches();
  	if (ACPI_FAILURE(status)) {
b417d40b9   Yi Yang   ACPICA: Return st...
690
  		return_ACPI_STATUS(status);
73459f73e   Robert Moore   ACPICA 20050617-0...
691
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
692

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
693
  	/* Mutex locked flags */
4c90ece24   Bob Moore   ACPI: ACPICA 2006...
694
  	for (i = 0; i < ACPI_NUM_MUTEX; i++) {
4be44fcd3   Len Brown   [ACPI] Lindent al...
695
696
697
  		acpi_gbl_mutex_info[i].mutex = NULL;
  		acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
  		acpi_gbl_mutex_info[i].use_count = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
698
  	}
28f55ebce   Bob Moore   [ACPI] ACPICA 200...
699
700
701
  	for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) {
  		acpi_gbl_owner_id_mask[i] = 0;
  	}
ec41f193e   Bob Moore   ACPICA: Formattin...
702
703
704
705
  
  	/* Last owner_iD is never valid */
  
  	acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
28f55ebce   Bob Moore   [ACPI] ACPICA 200...
706

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
707
  	/* GPE support */
4be44fcd3   Len Brown   [ACPI] Lindent al...
708
709
710
  	acpi_gbl_gpe_xrupt_list_head = NULL;
  	acpi_gbl_gpe_fadt_blocks[0] = NULL;
  	acpi_gbl_gpe_fadt_blocks[1] = NULL;
e97d6bf1a   Bob Moore   ACPICA: New: acpi...
711
  	acpi_current_gpe_count = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
712

3e08e2d2d   Lin Ming   ACPICA: New inter...
713
  	/* Global handlers */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
714

4be44fcd3   Len Brown   [ACPI] Lindent al...
715
716
717
718
  	acpi_gbl_system_notify.handler = NULL;
  	acpi_gbl_device_notify.handler = NULL;
  	acpi_gbl_exception_handler = NULL;
  	acpi_gbl_init_handler = NULL;
3e08e2d2d   Lin Ming   ACPICA: New inter...
719
  	acpi_gbl_table_handler = NULL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
720

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
721
  	/* Global Lock support */
967440e3b   Bob Moore   ACPI: ACPICA 2006...
722
  	acpi_gbl_global_lock_semaphore = NULL;
c81da6660   Bob Moore   ACPICA: Delete re...
723
  	acpi_gbl_global_lock_mutex = NULL;
4be44fcd3   Len Brown   [ACPI] Lindent al...
724
  	acpi_gbl_global_lock_acquired = FALSE;
4be44fcd3   Len Brown   [ACPI] Lindent al...
725
  	acpi_gbl_global_lock_handle = 0;
009c4cbe9   Bob Moore   ACPICA: Add globa...
726
  	acpi_gbl_global_lock_present = FALSE;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
727
728
  
  	/* Miscellaneous variables */
4be44fcd3   Len Brown   [ACPI] Lindent al...
729
730
731
732
733
734
  	acpi_gbl_cm_single_step = FALSE;
  	acpi_gbl_db_terminate_threads = FALSE;
  	acpi_gbl_shutdown = FALSE;
  	acpi_gbl_ns_lookup_count = 0;
  	acpi_gbl_ps_find_count = 0;
  	acpi_gbl_acpi_hardware_present = TRUE;
28f55ebce   Bob Moore   [ACPI] ACPICA 200...
735
736
  	acpi_gbl_last_owner_id_index = 0;
  	acpi_gbl_next_owner_id_offset = 0;
50eca3eb8   Bob Moore   [ACPI] ACPICA 200...
737
738
739
  	acpi_gbl_trace_method_name = 0;
  	acpi_gbl_trace_dbg_level = 0;
  	acpi_gbl_trace_dbg_layer = 0;
4be44fcd3   Len Brown   [ACPI] Lindent al...
740
741
  	acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
  	acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
7f0719039   Bob Moore   ACPICA: New: I/O ...
742
  	acpi_gbl_osi_data = 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
743
744
  
  	/* Hardware oriented */
4be44fcd3   Len Brown   [ACPI] Lindent al...
745
746
  	acpi_gbl_events_initialized = FALSE;
  	acpi_gbl_system_awake_and_running = TRUE;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
747
748
  
  	/* Namespace */
7f0c826a4   Lin Ming   ACPICA: Add suppo...
749
  	acpi_gbl_module_code_list = NULL;
4be44fcd3   Len Brown   [ACPI] Lindent al...
750
  	acpi_gbl_root_node = NULL;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
751
  	acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
61686124f   Bob Moore   [ACPI] ACPICA 200...
752
  	acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
4be44fcd3   Len Brown   [ACPI] Lindent al...
753
754
755
756
757
  	acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
  	acpi_gbl_root_node_struct.child = NULL;
  	acpi_gbl_root_node_struct.peer = NULL;
  	acpi_gbl_root_node_struct.object = NULL;
  	acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
758
759
  
  #ifdef ACPI_DEBUG_OUTPUT
1d18c0582   Bob Moore   ACPICA: Cosmetic ...
760
  	acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
761
  #endif
d41eb99ba   Bob Moore   ACPICA: Added opt...
762
763
764
  #ifdef ACPI_DBG_TRACK_ALLOCATIONS
  	acpi_gbl_display_final_mem_stats = FALSE;
  #endif
b417d40b9   Yi Yang   ACPICA: Return st...
765
  	return_ACPI_STATUS(AE_OK);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
766
  }
8313524a0   Bob Moore   ACPI: ACPICA 2006...
767

e97d6bf1a   Bob Moore   ACPICA: New: acpi...
768
  ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
8313524a0   Bob Moore   ACPI: ACPICA 2006...
769
  ACPI_EXPORT_SYMBOL(acpi_dbg_level)
1044f1f65   Bob Moore   ACPICA: Cleanup f...
770
  ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
e97d6bf1a   Bob Moore   ACPICA: New: acpi...
771
  ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)