diff options
Diffstat (limited to 'drivers/acpi/utilities/utglobal.c')
-rw-r--r-- | drivers/acpi/utilities/utglobal.c | 557 |
1 files changed, 278 insertions, 279 deletions
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index 0e4161c81076..399e64b51886 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c | |||
@@ -48,8 +48,7 @@ | |||
48 | #include <acpi/acnamesp.h> | 48 | #include <acpi/acnamesp.h> |
49 | 49 | ||
50 | #define _COMPONENT ACPI_UTILITIES | 50 | #define _COMPONENT ACPI_UTILITIES |
51 | ACPI_MODULE_NAME ("utglobal") | 51 | ACPI_MODULE_NAME("utglobal") |
52 | |||
53 | 52 | ||
54 | /******************************************************************************* | 53 | /******************************************************************************* |
55 | * | 54 | * |
@@ -63,17 +62,12 @@ | |||
63 | * DESCRIPTION: This function translates an ACPI exception into an ASCII string. | 62 | * DESCRIPTION: This function translates an ACPI exception into an ASCII string. |
64 | * | 63 | * |
65 | ******************************************************************************/ | 64 | ******************************************************************************/ |
66 | 65 | const char *acpi_format_exception(acpi_status status) | |
67 | const char * | ||
68 | acpi_format_exception ( | ||
69 | acpi_status status) | ||
70 | { | 66 | { |
71 | acpi_status sub_status; | 67 | acpi_status sub_status; |
72 | const char *exception = NULL; | 68 | const char *exception = NULL; |
73 | |||
74 | |||
75 | ACPI_FUNCTION_NAME ("format_exception"); | ||
76 | 69 | ||
70 | ACPI_FUNCTION_NAME("format_exception"); | ||
77 | 71 | ||
78 | sub_status = (status & ~AE_CODE_MASK); | 72 | sub_status = (status & ~AE_CODE_MASK); |
79 | 73 | ||
@@ -81,35 +75,39 @@ acpi_format_exception ( | |||
81 | case AE_CODE_ENVIRONMENTAL: | 75 | case AE_CODE_ENVIRONMENTAL: |
82 | 76 | ||
83 | if (sub_status <= AE_CODE_ENV_MAX) { | 77 | if (sub_status <= AE_CODE_ENV_MAX) { |
84 | exception = acpi_gbl_exception_names_env [sub_status]; | 78 | exception = acpi_gbl_exception_names_env[sub_status]; |
85 | } | 79 | } |
86 | break; | 80 | break; |
87 | 81 | ||
88 | case AE_CODE_PROGRAMMER: | 82 | case AE_CODE_PROGRAMMER: |
89 | 83 | ||
90 | if (sub_status <= AE_CODE_PGM_MAX) { | 84 | if (sub_status <= AE_CODE_PGM_MAX) { |
91 | exception = acpi_gbl_exception_names_pgm [sub_status -1]; | 85 | exception = |
86 | acpi_gbl_exception_names_pgm[sub_status - 1]; | ||
92 | } | 87 | } |
93 | break; | 88 | break; |
94 | 89 | ||
95 | case AE_CODE_ACPI_TABLES: | 90 | case AE_CODE_ACPI_TABLES: |
96 | 91 | ||
97 | if (sub_status <= AE_CODE_TBL_MAX) { | 92 | if (sub_status <= AE_CODE_TBL_MAX) { |
98 | exception = acpi_gbl_exception_names_tbl [sub_status -1]; | 93 | exception = |
94 | acpi_gbl_exception_names_tbl[sub_status - 1]; | ||
99 | } | 95 | } |
100 | break; | 96 | break; |
101 | 97 | ||
102 | case AE_CODE_AML: | 98 | case AE_CODE_AML: |
103 | 99 | ||
104 | if (sub_status <= AE_CODE_AML_MAX) { | 100 | if (sub_status <= AE_CODE_AML_MAX) { |
105 | exception = acpi_gbl_exception_names_aml [sub_status -1]; | 101 | exception = |
102 | acpi_gbl_exception_names_aml[sub_status - 1]; | ||
106 | } | 103 | } |
107 | break; | 104 | break; |
108 | 105 | ||
109 | case AE_CODE_CONTROL: | 106 | case AE_CODE_CONTROL: |
110 | 107 | ||
111 | if (sub_status <= AE_CODE_CTRL_MAX) { | 108 | if (sub_status <= AE_CODE_CTRL_MAX) { |
112 | exception = acpi_gbl_exception_names_ctrl [sub_status -1]; | 109 | exception = |
110 | acpi_gbl_exception_names_ctrl[sub_status - 1]; | ||
113 | } | 111 | } |
114 | break; | 112 | break; |
115 | 113 | ||
@@ -120,16 +118,15 @@ acpi_format_exception ( | |||
120 | if (!exception) { | 118 | if (!exception) { |
121 | /* Exception code was not recognized */ | 119 | /* Exception code was not recognized */ |
122 | 120 | ||
123 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 121 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
124 | "Unknown exception code: 0x%8.8X\n", status)); | 122 | "Unknown exception code: 0x%8.8X\n", status)); |
125 | 123 | ||
126 | return ((const char *) "UNKNOWN_STATUS_CODE"); | 124 | return ((const char *)"UNKNOWN_STATUS_CODE"); |
127 | } | 125 | } |
128 | 126 | ||
129 | return ((const char *) exception); | 127 | return ((const char *)exception); |
130 | } | 128 | } |
131 | 129 | ||
132 | |||
133 | /******************************************************************************* | 130 | /******************************************************************************* |
134 | * | 131 | * |
135 | * Static global variable initialization. | 132 | * Static global variable initialization. |
@@ -142,34 +139,32 @@ acpi_format_exception ( | |||
142 | */ | 139 | */ |
143 | 140 | ||
144 | /* Debug switch - level and trace mask */ | 141 | /* Debug switch - level and trace mask */ |
145 | u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; | 142 | u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; |
146 | EXPORT_SYMBOL(acpi_dbg_level); | 143 | EXPORT_SYMBOL(acpi_dbg_level); |
147 | 144 | ||
148 | /* Debug switch - layer (component) mask */ | 145 | /* Debug switch - layer (component) mask */ |
149 | 146 | ||
150 | u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; | 147 | u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; |
151 | EXPORT_SYMBOL(acpi_dbg_layer); | 148 | EXPORT_SYMBOL(acpi_dbg_layer); |
152 | u32 acpi_gbl_nesting_level = 0; | 149 | u32 acpi_gbl_nesting_level = 0; |
153 | |||
154 | 150 | ||
155 | /* Debugger globals */ | 151 | /* Debugger globals */ |
156 | 152 | ||
157 | u8 acpi_gbl_db_terminate_threads = FALSE; | 153 | u8 acpi_gbl_db_terminate_threads = FALSE; |
158 | u8 acpi_gbl_abort_method = FALSE; | 154 | u8 acpi_gbl_abort_method = FALSE; |
159 | u8 acpi_gbl_method_executing = FALSE; | 155 | u8 acpi_gbl_method_executing = FALSE; |
160 | 156 | ||
161 | /* System flags */ | 157 | /* System flags */ |
162 | 158 | ||
163 | u32 acpi_gbl_startup_flags = 0; | 159 | u32 acpi_gbl_startup_flags = 0; |
164 | 160 | ||
165 | /* System starts uninitialized */ | 161 | /* System starts uninitialized */ |
166 | 162 | ||
167 | u8 acpi_gbl_shutdown = TRUE; | 163 | u8 acpi_gbl_shutdown = TRUE; |
168 | 164 | ||
169 | const u8 acpi_gbl_decode_to8bit [8] = {1,2,4,8,16,32,64,128}; | 165 | const u8 acpi_gbl_decode_to8bit[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; |
170 | 166 | ||
171 | const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = | 167 | const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = { |
172 | { | ||
173 | "\\_S0_", | 168 | "\\_S0_", |
174 | "\\_S1_", | 169 | "\\_S1_", |
175 | "\\_S2_", | 170 | "\\_S2_", |
@@ -178,8 +173,7 @@ const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COU | |||
178 | "\\_S5_" | 173 | "\\_S5_" |
179 | }; | 174 | }; |
180 | 175 | ||
181 | const char *acpi_gbl_highest_dstate_names[4] = | 176 | const char *acpi_gbl_highest_dstate_names[4] = { |
182 | { | ||
183 | "_S1D", | 177 | "_S1D", |
184 | "_S2D", | 178 | "_S2D", |
185 | "_S3D", | 179 | "_S3D", |
@@ -190,8 +184,7 @@ const char *acpi_gbl_highest_dstate_names[4] = | |||
190 | * Strings supported by the _OSI predefined (internal) method. | 184 | * Strings supported by the _OSI predefined (internal) method. |
191 | * When adding strings, be sure to update ACPI_NUM_OSI_STRINGS. | 185 | * When adding strings, be sure to update ACPI_NUM_OSI_STRINGS. |
192 | */ | 186 | */ |
193 | const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = | 187 | const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = { |
194 | { | ||
195 | /* Operating System Vendor Strings */ | 188 | /* Operating System Vendor Strings */ |
196 | 189 | ||
197 | "Linux", | 190 | "Linux", |
@@ -209,7 +202,6 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR | |||
209 | "Extended Address Space Descriptor" | 202 | "Extended Address Space Descriptor" |
210 | }; | 203 | }; |
211 | 204 | ||
212 | |||
213 | /******************************************************************************* | 205 | /******************************************************************************* |
214 | * | 206 | * |
215 | * Namespace globals | 207 | * Namespace globals |
@@ -225,74 +217,70 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR | |||
225 | * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to | 217 | * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to |
226 | * perform a Notify() operation on it. | 218 | * perform a Notify() operation on it. |
227 | */ | 219 | */ |
228 | const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = | 220 | const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = |
229 | { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, | 221 | { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, |
230 | {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, | 222 | {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, |
231 | {"_SB_", ACPI_TYPE_DEVICE, NULL}, | 223 | {"_SB_", ACPI_TYPE_DEVICE, NULL}, |
232 | {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, | 224 | {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, |
233 | {"_TZ_", ACPI_TYPE_THERMAL, NULL}, | 225 | {"_TZ_", ACPI_TYPE_THERMAL, NULL}, |
234 | {"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL}, | 226 | {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL}, |
235 | {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, | 227 | {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, |
236 | {"_GL_", ACPI_TYPE_MUTEX, (char *) 1}, | 228 | {"_GL_", ACPI_TYPE_MUTEX, (char *)1}, |
237 | 229 | ||
238 | #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) | 230 | #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) |
239 | {"_OSI", ACPI_TYPE_METHOD, (char *) 1}, | 231 | {"_OSI", ACPI_TYPE_METHOD, (char *)1}, |
240 | #endif | 232 | #endif |
241 | 233 | ||
242 | /* Table terminator */ | 234 | /* Table terminator */ |
243 | 235 | ||
244 | {NULL, ACPI_TYPE_ANY, NULL} | 236 | {NULL, ACPI_TYPE_ANY, NULL} |
245 | }; | 237 | }; |
246 | 238 | ||
247 | /* | 239 | /* |
248 | * Properties of the ACPI Object Types, both internal and external. | 240 | * Properties of the ACPI Object Types, both internal and external. |
249 | * The table is indexed by values of acpi_object_type | 241 | * The table is indexed by values of acpi_object_type |
250 | */ | 242 | */ |
251 | const u8 acpi_gbl_ns_properties[] = | 243 | const u8 acpi_gbl_ns_properties[] = { |
252 | { | 244 | ACPI_NS_NORMAL, /* 00 Any */ |
253 | ACPI_NS_NORMAL, /* 00 Any */ | 245 | ACPI_NS_NORMAL, /* 01 Number */ |
254 | ACPI_NS_NORMAL, /* 01 Number */ | 246 | ACPI_NS_NORMAL, /* 02 String */ |
255 | ACPI_NS_NORMAL, /* 02 String */ | 247 | ACPI_NS_NORMAL, /* 03 Buffer */ |
256 | ACPI_NS_NORMAL, /* 03 Buffer */ | 248 | ACPI_NS_NORMAL, /* 04 Package */ |
257 | ACPI_NS_NORMAL, /* 04 Package */ | 249 | ACPI_NS_NORMAL, /* 05 field_unit */ |
258 | ACPI_NS_NORMAL, /* 05 field_unit */ | 250 | ACPI_NS_NEWSCOPE, /* 06 Device */ |
259 | ACPI_NS_NEWSCOPE, /* 06 Device */ | 251 | ACPI_NS_NORMAL, /* 07 Event */ |
260 | ACPI_NS_NORMAL, /* 07 Event */ | 252 | ACPI_NS_NEWSCOPE, /* 08 Method */ |
261 | ACPI_NS_NEWSCOPE, /* 08 Method */ | 253 | ACPI_NS_NORMAL, /* 09 Mutex */ |
262 | ACPI_NS_NORMAL, /* 09 Mutex */ | 254 | ACPI_NS_NORMAL, /* 10 Region */ |
263 | ACPI_NS_NORMAL, /* 10 Region */ | 255 | ACPI_NS_NEWSCOPE, /* 11 Power */ |
264 | ACPI_NS_NEWSCOPE, /* 11 Power */ | 256 | ACPI_NS_NEWSCOPE, /* 12 Processor */ |
265 | ACPI_NS_NEWSCOPE, /* 12 Processor */ | 257 | ACPI_NS_NEWSCOPE, /* 13 Thermal */ |
266 | ACPI_NS_NEWSCOPE, /* 13 Thermal */ | 258 | ACPI_NS_NORMAL, /* 14 buffer_field */ |
267 | ACPI_NS_NORMAL, /* 14 buffer_field */ | 259 | ACPI_NS_NORMAL, /* 15 ddb_handle */ |
268 | ACPI_NS_NORMAL, /* 15 ddb_handle */ | 260 | ACPI_NS_NORMAL, /* 16 Debug Object */ |
269 | ACPI_NS_NORMAL, /* 16 Debug Object */ | 261 | ACPI_NS_NORMAL, /* 17 def_field */ |
270 | ACPI_NS_NORMAL, /* 17 def_field */ | 262 | ACPI_NS_NORMAL, /* 18 bank_field */ |
271 | ACPI_NS_NORMAL, /* 18 bank_field */ | 263 | ACPI_NS_NORMAL, /* 19 index_field */ |
272 | ACPI_NS_NORMAL, /* 19 index_field */ | 264 | ACPI_NS_NORMAL, /* 20 Reference */ |
273 | ACPI_NS_NORMAL, /* 20 Reference */ | 265 | ACPI_NS_NORMAL, /* 21 Alias */ |
274 | ACPI_NS_NORMAL, /* 21 Alias */ | 266 | ACPI_NS_NORMAL, /* 22 method_alias */ |
275 | ACPI_NS_NORMAL, /* 22 method_alias */ | 267 | ACPI_NS_NORMAL, /* 23 Notify */ |
276 | ACPI_NS_NORMAL, /* 23 Notify */ | 268 | ACPI_NS_NORMAL, /* 24 Address Handler */ |
277 | ACPI_NS_NORMAL, /* 24 Address Handler */ | 269 | ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */ |
278 | ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */ | 270 | ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */ |
279 | ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */ | 271 | ACPI_NS_NEWSCOPE, /* 27 Scope */ |
280 | ACPI_NS_NEWSCOPE, /* 27 Scope */ | 272 | ACPI_NS_NORMAL, /* 28 Extra */ |
281 | ACPI_NS_NORMAL, /* 28 Extra */ | 273 | ACPI_NS_NORMAL, /* 29 Data */ |
282 | ACPI_NS_NORMAL, /* 29 Data */ | 274 | ACPI_NS_NORMAL /* 30 Invalid */ |
283 | ACPI_NS_NORMAL /* 30 Invalid */ | ||
284 | }; | 275 | }; |
285 | 276 | ||
286 | |||
287 | /* Hex to ASCII conversion table */ | 277 | /* Hex to ASCII conversion table */ |
288 | 278 | ||
289 | static const char acpi_gbl_hex_to_ascii[] = | 279 | static const char acpi_gbl_hex_to_ascii[] = { |
290 | { | 280 | '0', '1', '2', '3', '4', '5', '6', '7', |
291 | '0','1','2','3','4','5','6','7', | 281 | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' |
292 | '8','9','A','B','C','D','E','F' | ||
293 | }; | 282 | }; |
294 | 283 | ||
295 | |||
296 | /******************************************************************************* | 284 | /******************************************************************************* |
297 | * | 285 | * |
298 | * FUNCTION: acpi_ut_hex_to_ascii_char | 286 | * FUNCTION: acpi_ut_hex_to_ascii_char |
@@ -307,16 +295,12 @@ static const char acpi_gbl_hex_to_ascii[] = | |||
307 | * | 295 | * |
308 | ******************************************************************************/ | 296 | ******************************************************************************/ |
309 | 297 | ||
310 | char | 298 | char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position) |
311 | acpi_ut_hex_to_ascii_char ( | ||
312 | acpi_integer integer, | ||
313 | u32 position) | ||
314 | { | 299 | { |
315 | 300 | ||
316 | return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]); | 301 | return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]); |
317 | } | 302 | } |
318 | 303 | ||
319 | |||
320 | /******************************************************************************* | 304 | /******************************************************************************* |
321 | * | 305 | * |
322 | * Table name globals | 306 | * Table name globals |
@@ -330,67 +314,139 @@ acpi_ut_hex_to_ascii_char ( | |||
330 | * | 314 | * |
331 | ******************************************************************************/ | 315 | ******************************************************************************/ |
332 | 316 | ||
333 | struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; | 317 | struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; |
334 | 318 | ||
335 | struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES] = | 319 | struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES] = { |
336 | { | ||
337 | /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ | 320 | /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ |
338 | 321 | ||
339 | /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, | 322 | /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof(RSDP_SIG) - 1, |
340 | /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, | 323 | ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE} |
341 | /* FADT 2 */ {FADT_SIG, FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, | 324 | , |
342 | /* FACS 3 */ {FACS_SIG, FACS_SIG, (void *) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, | 325 | /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *)&acpi_gbl_DSDT, |
343 | /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, | 326 | sizeof(DSDT_SIG) - 1, |
344 | /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, | 327 | ACPI_TABLE_SECONDARY | ACPI_TABLE_SINGLE | |
345 | /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, | 328 | ACPI_TABLE_EXECUTABLE} |
329 | , | ||
330 | /* FADT 2 */ {FADT_SIG, FADT_SIG, (void *)&acpi_gbl_FADT, | ||
331 | sizeof(FADT_SIG) - 1, | ||
332 | ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE} | ||
333 | , | ||
334 | /* FACS 3 */ {FACS_SIG, FACS_SIG, (void *)&acpi_gbl_FACS, | ||
335 | sizeof(FACS_SIG) - 1, | ||
336 | ACPI_TABLE_SECONDARY | ACPI_TABLE_SINGLE} | ||
337 | , | ||
338 | /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof(PSDT_SIG) - 1, | ||
339 | ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | | ||
340 | ACPI_TABLE_EXECUTABLE} | ||
341 | , | ||
342 | /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof(SSDT_SIG) - 1, | ||
343 | ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | | ||
344 | ACPI_TABLE_EXECUTABLE} | ||
345 | , | ||
346 | /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof(RSDT_SIG) - 1, | ||
347 | ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE} | ||
348 | , | ||
346 | }; | 349 | }; |
347 | 350 | ||
348 | |||
349 | /****************************************************************************** | 351 | /****************************************************************************** |
350 | * | 352 | * |
351 | * Event and Hardware globals | 353 | * Event and Hardware globals |
352 | * | 354 | * |
353 | ******************************************************************************/ | 355 | ******************************************************************************/ |
354 | 356 | ||
355 | struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = | 357 | struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = { |
356 | { | ||
357 | /* Name Parent Register Register Bit Position Register Bit Mask */ | 358 | /* Name Parent Register Register Bit Position Register Bit Mask */ |
358 | 359 | ||
359 | /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, | 360 | /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
360 | /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, | 361 | ACPI_BITPOSITION_TIMER_STATUS, |
361 | /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, | 362 | ACPI_BITMASK_TIMER_STATUS}, |
362 | /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, | 363 | /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
363 | /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, | 364 | ACPI_BITPOSITION_BUS_MASTER_STATUS, |
364 | /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, | 365 | ACPI_BITMASK_BUS_MASTER_STATUS}, |
365 | /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, | 366 | /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
366 | /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS}, | 367 | ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, |
367 | 368 | ACPI_BITMASK_GLOBAL_LOCK_STATUS}, | |
368 | /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, | 369 | /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
369 | /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, | 370 | ACPI_BITPOSITION_POWER_BUTTON_STATUS, |
370 | /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, | 371 | ACPI_BITMASK_POWER_BUTTON_STATUS}, |
371 | /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, | 372 | /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
372 | /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, | 373 | ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, |
373 | /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, | 374 | ACPI_BITMASK_SLEEP_BUTTON_STATUS}, |
374 | /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, | 375 | /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
375 | 376 | ACPI_BITPOSITION_RT_CLOCK_STATUS, | |
376 | /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, | 377 | ACPI_BITMASK_RT_CLOCK_STATUS}, |
377 | /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, | 378 | /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
378 | /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, | 379 | ACPI_BITPOSITION_WAKE_STATUS, |
379 | /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, | 380 | ACPI_BITMASK_WAKE_STATUS}, |
380 | /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, | 381 | /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, |
381 | /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, | 382 | ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, |
382 | 383 | ACPI_BITMASK_PCIEXP_WAKE_STATUS}, | |
383 | /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} | 384 | |
385 | /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
386 | ACPI_BITPOSITION_TIMER_ENABLE, | ||
387 | ACPI_BITMASK_TIMER_ENABLE}, | ||
388 | /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
389 | ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, | ||
390 | ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, | ||
391 | /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
392 | ACPI_BITPOSITION_POWER_BUTTON_ENABLE, | ||
393 | ACPI_BITMASK_POWER_BUTTON_ENABLE}, | ||
394 | /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
395 | ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, | ||
396 | ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, | ||
397 | /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
398 | ACPI_BITPOSITION_RT_CLOCK_ENABLE, | ||
399 | ACPI_BITMASK_RT_CLOCK_ENABLE}, | ||
400 | /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, | ||
401 | /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, | ||
402 | ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, | ||
403 | ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, | ||
404 | |||
405 | /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, | ||
406 | ACPI_BITPOSITION_SCI_ENABLE, | ||
407 | ACPI_BITMASK_SCI_ENABLE}, | ||
408 | /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, | ||
409 | ACPI_BITPOSITION_BUS_MASTER_RLD, | ||
410 | ACPI_BITMASK_BUS_MASTER_RLD}, | ||
411 | /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, | ||
412 | ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, | ||
413 | ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, | ||
414 | /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, | ||
415 | ACPI_BITPOSITION_SLEEP_TYPE_X, | ||
416 | ACPI_BITMASK_SLEEP_TYPE_X}, | ||
417 | /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, | ||
418 | ACPI_BITPOSITION_SLEEP_TYPE_X, | ||
419 | ACPI_BITMASK_SLEEP_TYPE_X}, | ||
420 | /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, | ||
421 | ACPI_BITPOSITION_SLEEP_ENABLE, | ||
422 | ACPI_BITMASK_SLEEP_ENABLE}, | ||
423 | |||
424 | /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, | ||
425 | ACPI_BITPOSITION_ARB_DISABLE, | ||
426 | ACPI_BITMASK_ARB_DISABLE} | ||
384 | }; | 427 | }; |
385 | 428 | ||
386 | 429 | struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = { | |
387 | struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = | 430 | /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, |
388 | { | 431 | ACPI_BITREG_TIMER_ENABLE, |
389 | /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, | 432 | ACPI_BITMASK_TIMER_STATUS, |
390 | /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, | 433 | ACPI_BITMASK_TIMER_ENABLE}, |
391 | /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, | 434 | /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, |
392 | /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, | 435 | ACPI_BITREG_GLOBAL_LOCK_ENABLE, |
393 | /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, | 436 | ACPI_BITMASK_GLOBAL_LOCK_STATUS, |
437 | ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, | ||
438 | /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, | ||
439 | ACPI_BITREG_POWER_BUTTON_ENABLE, | ||
440 | ACPI_BITMASK_POWER_BUTTON_STATUS, | ||
441 | ACPI_BITMASK_POWER_BUTTON_ENABLE}, | ||
442 | /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, | ||
443 | ACPI_BITREG_SLEEP_BUTTON_ENABLE, | ||
444 | ACPI_BITMASK_SLEEP_BUTTON_STATUS, | ||
445 | ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, | ||
446 | /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, | ||
447 | ACPI_BITREG_RT_CLOCK_ENABLE, | ||
448 | ACPI_BITMASK_RT_CLOCK_STATUS, | ||
449 | ACPI_BITMASK_RT_CLOCK_ENABLE}, | ||
394 | }; | 450 | }; |
395 | 451 | ||
396 | /******************************************************************************* | 452 | /******************************************************************************* |
@@ -407,8 +463,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE | |||
407 | 463 | ||
408 | /* Region type decoding */ | 464 | /* Region type decoding */ |
409 | 465 | ||
410 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = | 466 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { |
411 | { | ||
412 | /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ | 467 | /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ |
413 | "SystemMemory", | 468 | "SystemMemory", |
414 | "SystemIO", | 469 | "SystemIO", |
@@ -421,25 +476,18 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = | |||
421 | /*! [End] no source code translation !*/ | 476 | /*! [End] no source code translation !*/ |
422 | }; | 477 | }; |
423 | 478 | ||
424 | 479 | char *acpi_ut_get_region_name(u8 space_id) | |
425 | char * | ||
426 | acpi_ut_get_region_name ( | ||
427 | u8 space_id) | ||
428 | { | 480 | { |
429 | 481 | ||
430 | if (space_id >= ACPI_USER_REGION_BEGIN) | 482 | if (space_id >= ACPI_USER_REGION_BEGIN) { |
431 | { | ||
432 | return ("user_defined_region"); | 483 | return ("user_defined_region"); |
433 | } | 484 | } else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) { |
434 | else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) | ||
435 | { | ||
436 | return ("invalid_space_id"); | 485 | return ("invalid_space_id"); |
437 | } | 486 | } |
438 | 487 | ||
439 | return ((char *) acpi_gbl_region_types[space_id]); | 488 | return ((char *)acpi_gbl_region_types[space_id]); |
440 | } | 489 | } |
441 | 490 | ||
442 | |||
443 | /******************************************************************************* | 491 | /******************************************************************************* |
444 | * | 492 | * |
445 | * FUNCTION: acpi_ut_get_event_name | 493 | * FUNCTION: acpi_ut_get_event_name |
@@ -454,8 +502,7 @@ acpi_ut_get_region_name ( | |||
454 | 502 | ||
455 | /* Event type decoding */ | 503 | /* Event type decoding */ |
456 | 504 | ||
457 | static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = | 505 | static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { |
458 | { | ||
459 | "PM_Timer", | 506 | "PM_Timer", |
460 | "global_lock", | 507 | "global_lock", |
461 | "power_button", | 508 | "power_button", |
@@ -463,21 +510,16 @@ static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = | |||
463 | "real_time_clock", | 510 | "real_time_clock", |
464 | }; | 511 | }; |
465 | 512 | ||
466 | 513 | char *acpi_ut_get_event_name(u32 event_id) | |
467 | char * | ||
468 | acpi_ut_get_event_name ( | ||
469 | u32 event_id) | ||
470 | { | 514 | { |
471 | 515 | ||
472 | if (event_id > ACPI_EVENT_MAX) | 516 | if (event_id > ACPI_EVENT_MAX) { |
473 | { | ||
474 | return ("invalid_event_iD"); | 517 | return ("invalid_event_iD"); |
475 | } | 518 | } |
476 | 519 | ||
477 | return ((char *) acpi_gbl_event_types[event_id]); | 520 | return ((char *)acpi_gbl_event_types[event_id]); |
478 | } | 521 | } |
479 | 522 | ||
480 | |||
481 | /******************************************************************************* | 523 | /******************************************************************************* |
482 | * | 524 | * |
483 | * FUNCTION: acpi_ut_get_type_name | 525 | * FUNCTION: acpi_ut_get_type_name |
@@ -498,12 +540,11 @@ acpi_ut_get_event_name ( | |||
498 | * when stored in a table it really means that we have thus far seen no | 540 | * when stored in a table it really means that we have thus far seen no |
499 | * evidence to indicate what type is actually going to be stored for this entry. | 541 | * evidence to indicate what type is actually going to be stored for this entry. |
500 | */ | 542 | */ |
501 | static const char acpi_gbl_bad_type[] = "UNDEFINED"; | 543 | static const char acpi_gbl_bad_type[] = "UNDEFINED"; |
502 | 544 | ||
503 | /* Printable names of the ACPI object types */ | 545 | /* Printable names of the ACPI object types */ |
504 | 546 | ||
505 | static const char *acpi_gbl_ns_type_names[] = | 547 | static const char *acpi_gbl_ns_type_names[] = { |
506 | { | ||
507 | /* 00 */ "Untyped", | 548 | /* 00 */ "Untyped", |
508 | /* 01 */ "Integer", | 549 | /* 01 */ "Integer", |
509 | /* 02 */ "String", | 550 | /* 02 */ "String", |
@@ -537,35 +578,26 @@ static const char *acpi_gbl_ns_type_names[] = | |||
537 | /* 30 */ "Invalid" | 578 | /* 30 */ "Invalid" |
538 | }; | 579 | }; |
539 | 580 | ||
540 | 581 | char *acpi_ut_get_type_name(acpi_object_type type) | |
541 | char * | ||
542 | acpi_ut_get_type_name ( | ||
543 | acpi_object_type type) | ||
544 | { | 582 | { |
545 | 583 | ||
546 | if (type > ACPI_TYPE_INVALID) | 584 | if (type > ACPI_TYPE_INVALID) { |
547 | { | 585 | return ((char *)acpi_gbl_bad_type); |
548 | return ((char *) acpi_gbl_bad_type); | ||
549 | } | 586 | } |
550 | 587 | ||
551 | return ((char *) acpi_gbl_ns_type_names[type]); | 588 | return ((char *)acpi_gbl_ns_type_names[type]); |
552 | } | 589 | } |
553 | 590 | ||
554 | 591 | char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) | |
555 | char * | ||
556 | acpi_ut_get_object_type_name ( | ||
557 | union acpi_operand_object *obj_desc) | ||
558 | { | 592 | { |
559 | 593 | ||
560 | if (!obj_desc) | 594 | if (!obj_desc) { |
561 | { | ||
562 | return ("[NULL Object Descriptor]"); | 595 | return ("[NULL Object Descriptor]"); |
563 | } | 596 | } |
564 | 597 | ||
565 | return (acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc))); | 598 | return (acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc))); |
566 | } | 599 | } |
567 | 600 | ||
568 | |||
569 | /******************************************************************************* | 601 | /******************************************************************************* |
570 | * | 602 | * |
571 | * FUNCTION: acpi_ut_get_node_name | 603 | * FUNCTION: acpi_ut_get_node_name |
@@ -578,39 +610,31 @@ acpi_ut_get_object_type_name ( | |||
578 | * | 610 | * |
579 | ******************************************************************************/ | 611 | ******************************************************************************/ |
580 | 612 | ||
581 | char * | 613 | char *acpi_ut_get_node_name(void *object) |
582 | acpi_ut_get_node_name ( | ||
583 | void *object) | ||
584 | { | 614 | { |
585 | struct acpi_namespace_node *node = (struct acpi_namespace_node *) object; | 615 | struct acpi_namespace_node *node = (struct acpi_namespace_node *)object; |
586 | |||
587 | 616 | ||
588 | /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ | 617 | /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ |
589 | 618 | ||
590 | if (!object) | 619 | if (!object) { |
591 | { | ||
592 | return ("NULL"); | 620 | return ("NULL"); |
593 | } | 621 | } |
594 | 622 | ||
595 | /* Check for Root node */ | 623 | /* Check for Root node */ |
596 | 624 | ||
597 | if ((object == ACPI_ROOT_OBJECT) || | 625 | if ((object == ACPI_ROOT_OBJECT) || (object == acpi_gbl_root_node)) { |
598 | (object == acpi_gbl_root_node)) | ||
599 | { | ||
600 | return ("\"\\\" "); | 626 | return ("\"\\\" "); |
601 | } | 627 | } |
602 | 628 | ||
603 | /* Descriptor must be a namespace node */ | 629 | /* Descriptor must be a namespace node */ |
604 | 630 | ||
605 | if (node->descriptor != ACPI_DESC_TYPE_NAMED) | 631 | if (node->descriptor != ACPI_DESC_TYPE_NAMED) { |
606 | { | ||
607 | return ("####"); | 632 | return ("####"); |
608 | } | 633 | } |
609 | 634 | ||
610 | /* Name must be a valid ACPI name */ | 635 | /* Name must be a valid ACPI name */ |
611 | 636 | ||
612 | if (!acpi_ut_valid_acpi_name (* (u32 *) node->name.ascii)) | 637 | if (!acpi_ut_valid_acpi_name(*(u32 *) node->name.ascii)) { |
613 | { | ||
614 | return ("????"); | 638 | return ("????"); |
615 | } | 639 | } |
616 | 640 | ||
@@ -619,7 +643,6 @@ acpi_ut_get_node_name ( | |||
619 | return (node->name.ascii); | 643 | return (node->name.ascii); |
620 | } | 644 | } |
621 | 645 | ||
622 | |||
623 | /******************************************************************************* | 646 | /******************************************************************************* |
624 | * | 647 | * |
625 | * FUNCTION: acpi_ut_get_descriptor_name | 648 | * FUNCTION: acpi_ut_get_descriptor_name |
@@ -634,8 +657,7 @@ acpi_ut_get_node_name ( | |||
634 | 657 | ||
635 | /* Printable names of object descriptor types */ | 658 | /* Printable names of object descriptor types */ |
636 | 659 | ||
637 | static const char *acpi_gbl_desc_type_names[] = | 660 | static const char *acpi_gbl_desc_type_names[] = { |
638 | { | ||
639 | /* 00 */ "Invalid", | 661 | /* 00 */ "Invalid", |
640 | /* 01 */ "Cached", | 662 | /* 01 */ "Cached", |
641 | /* 02 */ "State-Generic", | 663 | /* 02 */ "State-Generic", |
@@ -654,27 +676,22 @@ static const char *acpi_gbl_desc_type_names[] = | |||
654 | /* 15 */ "Node" | 676 | /* 15 */ "Node" |
655 | }; | 677 | }; |
656 | 678 | ||
657 | 679 | char *acpi_ut_get_descriptor_name(void *object) | |
658 | char * | ||
659 | acpi_ut_get_descriptor_name ( | ||
660 | void *object) | ||
661 | { | 680 | { |
662 | 681 | ||
663 | if (!object) | 682 | if (!object) { |
664 | { | ||
665 | return ("NULL OBJECT"); | 683 | return ("NULL OBJECT"); |
666 | } | 684 | } |
667 | 685 | ||
668 | if (ACPI_GET_DESCRIPTOR_TYPE (object) > ACPI_DESC_TYPE_MAX) | 686 | if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) { |
669 | { | 687 | return ((char *)acpi_gbl_bad_type); |
670 | return ((char *) acpi_gbl_bad_type); | ||
671 | } | 688 | } |
672 | 689 | ||
673 | return ((char *) acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE (object)]); | 690 | return ((char *) |
691 | acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE(object)]); | ||
674 | 692 | ||
675 | } | 693 | } |
676 | 694 | ||
677 | |||
678 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 695 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
679 | /* | 696 | /* |
680 | * Strings and procedures used for debug only | 697 | * Strings and procedures used for debug only |
@@ -693,13 +710,10 @@ acpi_ut_get_descriptor_name ( | |||
693 | * | 710 | * |
694 | ******************************************************************************/ | 711 | ******************************************************************************/ |
695 | 712 | ||
696 | char * | 713 | char *acpi_ut_get_mutex_name(u32 mutex_id) |
697 | acpi_ut_get_mutex_name ( | ||
698 | u32 mutex_id) | ||
699 | { | 714 | { |
700 | 715 | ||
701 | if (mutex_id > MAX_MUTEX) | 716 | if (mutex_id > MAX_MUTEX) { |
702 | { | ||
703 | return ("Invalid Mutex ID"); | 717 | return ("Invalid Mutex ID"); |
704 | } | 718 | } |
705 | 719 | ||
@@ -707,7 +721,6 @@ acpi_ut_get_mutex_name ( | |||
707 | } | 721 | } |
708 | #endif | 722 | #endif |
709 | 723 | ||
710 | |||
711 | /******************************************************************************* | 724 | /******************************************************************************* |
712 | * | 725 | * |
713 | * FUNCTION: acpi_ut_valid_object_type | 726 | * FUNCTION: acpi_ut_valid_object_type |
@@ -720,13 +733,10 @@ acpi_ut_get_mutex_name ( | |||
720 | * | 733 | * |
721 | ******************************************************************************/ | 734 | ******************************************************************************/ |
722 | 735 | ||
723 | u8 | 736 | u8 acpi_ut_valid_object_type(acpi_object_type type) |
724 | acpi_ut_valid_object_type ( | ||
725 | acpi_object_type type) | ||
726 | { | 737 | { |
727 | 738 | ||
728 | if (type > ACPI_TYPE_LOCAL_MAX) | 739 | if (type > ACPI_TYPE_LOCAL_MAX) { |
729 | { | ||
730 | /* Note: Assumes all TYPEs are contiguous (external/local) */ | 740 | /* Note: Assumes all TYPEs are contiguous (external/local) */ |
731 | 741 | ||
732 | return (FALSE); | 742 | return (FALSE); |
@@ -735,7 +745,6 @@ acpi_ut_valid_object_type ( | |||
735 | return (TRUE); | 745 | return (TRUE); |
736 | } | 746 | } |
737 | 747 | ||
738 | |||
739 | /******************************************************************************* | 748 | /******************************************************************************* |
740 | * | 749 | * |
741 | * FUNCTION: acpi_ut_init_globals | 750 | * FUNCTION: acpi_ut_init_globals |
@@ -749,106 +758,96 @@ acpi_ut_valid_object_type ( | |||
749 | * | 758 | * |
750 | ******************************************************************************/ | 759 | ******************************************************************************/ |
751 | 760 | ||
752 | void | 761 | void acpi_ut_init_globals(void) |
753 | acpi_ut_init_globals ( | ||
754 | void) | ||
755 | { | 762 | { |
756 | acpi_status status; | 763 | acpi_status status; |
757 | u32 i; | 764 | u32 i; |
758 | |||
759 | |||
760 | ACPI_FUNCTION_TRACE ("ut_init_globals"); | ||
761 | 765 | ||
766 | ACPI_FUNCTION_TRACE("ut_init_globals"); | ||
762 | 767 | ||
763 | /* Create all memory caches */ | 768 | /* Create all memory caches */ |
764 | 769 | ||
765 | status = acpi_ut_create_caches (); | 770 | status = acpi_ut_create_caches(); |
766 | if (ACPI_FAILURE (status)) | 771 | if (ACPI_FAILURE(status)) { |
767 | { | ||
768 | return; | 772 | return; |
769 | } | 773 | } |
770 | 774 | ||
771 | /* ACPI table structure */ | 775 | /* ACPI table structure */ |
772 | 776 | ||
773 | for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) | 777 | for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) { |
774 | { | 778 | acpi_gbl_table_lists[i].next = NULL; |
775 | acpi_gbl_table_lists[i].next = NULL; | 779 | acpi_gbl_table_lists[i].count = 0; |
776 | acpi_gbl_table_lists[i].count = 0; | ||
777 | } | 780 | } |
778 | 781 | ||
779 | /* Mutex locked flags */ | 782 | /* Mutex locked flags */ |
780 | 783 | ||
781 | for (i = 0; i < NUM_MUTEX; i++) | 784 | for (i = 0; i < NUM_MUTEX; i++) { |
782 | { | 785 | acpi_gbl_mutex_info[i].mutex = NULL; |
783 | acpi_gbl_mutex_info[i].mutex = NULL; | 786 | acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; |
784 | acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; | 787 | acpi_gbl_mutex_info[i].use_count = 0; |
785 | acpi_gbl_mutex_info[i].use_count = 0; | ||
786 | } | 788 | } |
787 | 789 | ||
788 | /* GPE support */ | 790 | /* GPE support */ |
789 | 791 | ||
790 | acpi_gbl_gpe_xrupt_list_head = NULL; | 792 | acpi_gbl_gpe_xrupt_list_head = NULL; |
791 | acpi_gbl_gpe_fadt_blocks[0] = NULL; | 793 | acpi_gbl_gpe_fadt_blocks[0] = NULL; |
792 | acpi_gbl_gpe_fadt_blocks[1] = NULL; | 794 | acpi_gbl_gpe_fadt_blocks[1] = NULL; |
793 | 795 | ||
794 | /* Global notify handlers */ | 796 | /* Global notify handlers */ |
795 | 797 | ||
796 | acpi_gbl_system_notify.handler = NULL; | 798 | acpi_gbl_system_notify.handler = NULL; |
797 | acpi_gbl_device_notify.handler = NULL; | 799 | acpi_gbl_device_notify.handler = NULL; |
798 | acpi_gbl_exception_handler = NULL; | 800 | acpi_gbl_exception_handler = NULL; |
799 | acpi_gbl_init_handler = NULL; | 801 | acpi_gbl_init_handler = NULL; |
800 | 802 | ||
801 | /* Global "typed" ACPI table pointers */ | 803 | /* Global "typed" ACPI table pointers */ |
802 | 804 | ||
803 | acpi_gbl_RSDP = NULL; | 805 | acpi_gbl_RSDP = NULL; |
804 | acpi_gbl_XSDT = NULL; | 806 | acpi_gbl_XSDT = NULL; |
805 | acpi_gbl_FACS = NULL; | 807 | acpi_gbl_FACS = NULL; |
806 | acpi_gbl_FADT = NULL; | 808 | acpi_gbl_FADT = NULL; |
807 | acpi_gbl_DSDT = NULL; | 809 | acpi_gbl_DSDT = NULL; |
808 | 810 | ||
809 | /* Global Lock support */ | 811 | /* Global Lock support */ |
810 | 812 | ||
811 | acpi_gbl_global_lock_acquired = FALSE; | 813 | acpi_gbl_global_lock_acquired = FALSE; |
812 | acpi_gbl_global_lock_thread_count = 0; | 814 | acpi_gbl_global_lock_thread_count = 0; |
813 | acpi_gbl_global_lock_handle = 0; | 815 | acpi_gbl_global_lock_handle = 0; |
814 | 816 | ||
815 | /* Miscellaneous variables */ | 817 | /* Miscellaneous variables */ |
816 | 818 | ||
817 | acpi_gbl_table_flags = ACPI_PHYSICAL_POINTER; | 819 | acpi_gbl_table_flags = ACPI_PHYSICAL_POINTER; |
818 | acpi_gbl_rsdp_original_location = 0; | 820 | acpi_gbl_rsdp_original_location = 0; |
819 | acpi_gbl_cm_single_step = FALSE; | 821 | acpi_gbl_cm_single_step = FALSE; |
820 | acpi_gbl_db_terminate_threads = FALSE; | 822 | acpi_gbl_db_terminate_threads = FALSE; |
821 | acpi_gbl_shutdown = FALSE; | 823 | acpi_gbl_shutdown = FALSE; |
822 | acpi_gbl_ns_lookup_count = 0; | 824 | acpi_gbl_ns_lookup_count = 0; |
823 | acpi_gbl_ps_find_count = 0; | 825 | acpi_gbl_ps_find_count = 0; |
824 | acpi_gbl_acpi_hardware_present = TRUE; | 826 | acpi_gbl_acpi_hardware_present = TRUE; |
825 | acpi_gbl_owner_id_mask = 0; | 827 | acpi_gbl_owner_id_mask = 0; |
826 | acpi_gbl_debugger_configuration = DEBUGGER_THREADING; | 828 | acpi_gbl_debugger_configuration = DEBUGGER_THREADING; |
827 | acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; | 829 | acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; |
828 | 830 | ||
829 | /* Hardware oriented */ | 831 | /* Hardware oriented */ |
830 | 832 | ||
831 | acpi_gbl_events_initialized = FALSE; | 833 | acpi_gbl_events_initialized = FALSE; |
832 | acpi_gbl_system_awake_and_running = TRUE; | 834 | acpi_gbl_system_awake_and_running = TRUE; |
833 | 835 | ||
834 | /* Namespace */ | 836 | /* Namespace */ |
835 | 837 | ||
836 | acpi_gbl_root_node = NULL; | 838 | acpi_gbl_root_node = NULL; |
837 | 839 | ||
838 | acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; | 840 | acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; |
839 | acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; | 841 | acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; |
840 | acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE; | 842 | acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE; |
841 | acpi_gbl_root_node_struct.child = NULL; | 843 | acpi_gbl_root_node_struct.child = NULL; |
842 | acpi_gbl_root_node_struct.peer = NULL; | 844 | acpi_gbl_root_node_struct.peer = NULL; |
843 | acpi_gbl_root_node_struct.object = NULL; | 845 | acpi_gbl_root_node_struct.object = NULL; |
844 | acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST; | 846 | acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST; |
845 | |||
846 | 847 | ||
847 | #ifdef ACPI_DEBUG_OUTPUT | 848 | #ifdef ACPI_DEBUG_OUTPUT |
848 | acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX; | 849 | acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX; |
849 | #endif | 850 | #endif |
850 | 851 | ||
851 | return_VOID; | 852 | return_VOID; |
852 | } | 853 | } |
853 | |||
854 | |||