aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utxface.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/utilities/utxface.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/utxface.c')
-rw-r--r--drivers/acpi/utilities/utxface.c267
1 files changed, 117 insertions, 150 deletions
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index 850da6817423..f06bd5e5e9d1 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -49,8 +49,7 @@
49#include <acpi/acdebug.h> 49#include <acpi/acdebug.h>
50 50
51#define _COMPONENT ACPI_UTILITIES 51#define _COMPONENT ACPI_UTILITIES
52 ACPI_MODULE_NAME ("utxface") 52ACPI_MODULE_NAME("utxface")
53
54 53
55/******************************************************************************* 54/*******************************************************************************
56 * 55 *
@@ -64,60 +63,54 @@
64 * called, so any early initialization belongs here. 63 * called, so any early initialization belongs here.
65 * 64 *
66 ******************************************************************************/ 65 ******************************************************************************/
67 66acpi_status acpi_initialize_subsystem(void)
68acpi_status
69acpi_initialize_subsystem (
70 void)
71{ 67{
72 acpi_status status; 68 acpi_status status;
73
74 69
75 ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem"); 70 ACPI_FUNCTION_TRACE("acpi_initialize_subsystem");
76 71
77 72 ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace());
78 ACPI_DEBUG_EXEC (acpi_ut_init_stack_ptr_trace ());
79 73
80 /* Initialize the OS-Dependent layer */ 74 /* Initialize the OS-Dependent layer */
81 75
82 status = acpi_os_initialize (); 76 status = acpi_os_initialize();
83 if (ACPI_FAILURE (status)) { 77 if (ACPI_FAILURE(status)) {
84 ACPI_REPORT_ERROR (("OSD failed to initialize, %s\n", 78 ACPI_REPORT_ERROR(("OSD failed to initialize, %s\n",
85 acpi_format_exception (status))); 79 acpi_format_exception(status)));
86 return_ACPI_STATUS (status); 80 return_ACPI_STATUS(status);
87 } 81 }
88 82
89 /* Initialize all globals used by the subsystem */ 83 /* Initialize all globals used by the subsystem */
90 84
91 acpi_ut_init_globals (); 85 acpi_ut_init_globals();
92 86
93 /* Create the default mutex objects */ 87 /* Create the default mutex objects */
94 88
95 status = acpi_ut_mutex_initialize (); 89 status = acpi_ut_mutex_initialize();
96 if (ACPI_FAILURE (status)) { 90 if (ACPI_FAILURE(status)) {
97 ACPI_REPORT_ERROR (("Global mutex creation failure, %s\n", 91 ACPI_REPORT_ERROR(("Global mutex creation failure, %s\n",
98 acpi_format_exception (status))); 92 acpi_format_exception(status)));
99 return_ACPI_STATUS (status); 93 return_ACPI_STATUS(status);
100 } 94 }
101 95
102 /* 96 /*
103 * Initialize the namespace manager and 97 * Initialize the namespace manager and
104 * the root of the namespace tree 98 * the root of the namespace tree
105 */ 99 */
106 status = acpi_ns_root_initialize (); 100 status = acpi_ns_root_initialize();
107 if (ACPI_FAILURE (status)) { 101 if (ACPI_FAILURE(status)) {
108 ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n", 102 ACPI_REPORT_ERROR(("Namespace initialization failure, %s\n",
109 acpi_format_exception (status))); 103 acpi_format_exception(status)));
110 return_ACPI_STATUS (status); 104 return_ACPI_STATUS(status);
111 } 105 }
112 106
113 /* If configured, initialize the AML debugger */ 107 /* If configured, initialize the AML debugger */
114 108
115 ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ()); 109 ACPI_DEBUGGER_EXEC(status = acpi_db_initialize());
116 110
117 return_ACPI_STATUS (status); 111 return_ACPI_STATUS(status);
118} 112}
119 113
120
121/******************************************************************************* 114/*******************************************************************************
122 * 115 *
123 * FUNCTION: acpi_enable_subsystem 116 * FUNCTION: acpi_enable_subsystem
@@ -131,41 +124,39 @@ acpi_initialize_subsystem (
131 * 124 *
132 ******************************************************************************/ 125 ******************************************************************************/
133 126
134acpi_status 127acpi_status acpi_enable_subsystem(u32 flags)
135acpi_enable_subsystem (
136 u32 flags)
137{ 128{
138 acpi_status status = AE_OK; 129 acpi_status status = AE_OK;
139
140
141 ACPI_FUNCTION_TRACE ("acpi_enable_subsystem");
142 130
131 ACPI_FUNCTION_TRACE("acpi_enable_subsystem");
143 132
144 /* 133 /*
145 * We must initialize the hardware before we can enable ACPI. 134 * We must initialize the hardware before we can enable ACPI.
146 * The values from the FADT are validated here. 135 * The values from the FADT are validated here.
147 */ 136 */
148 if (!(flags & ACPI_NO_HARDWARE_INIT)) { 137 if (!(flags & ACPI_NO_HARDWARE_INIT)) {
149 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 138 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
150 "[Init] Initializing ACPI hardware\n")); 139 "[Init] Initializing ACPI hardware\n"));
151 140
152 status = acpi_hw_initialize (); 141 status = acpi_hw_initialize();
153 if (ACPI_FAILURE (status)) { 142 if (ACPI_FAILURE(status)) {
154 return_ACPI_STATUS (status); 143 return_ACPI_STATUS(status);
155 } 144 }
156 } 145 }
157 146
158 /* Enable ACPI mode */ 147 /* Enable ACPI mode */
159 148
160 if (!(flags & ACPI_NO_ACPI_ENABLE)) { 149 if (!(flags & ACPI_NO_ACPI_ENABLE)) {
161 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n")); 150 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
151 "[Init] Going into ACPI mode\n"));
162 152
163 acpi_gbl_original_mode = acpi_hw_get_mode(); 153 acpi_gbl_original_mode = acpi_hw_get_mode();
164 154
165 status = acpi_enable (); 155 status = acpi_enable();
166 if (ACPI_FAILURE (status)) { 156 if (ACPI_FAILURE(status)) {
167 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "acpi_enable failed.\n")); 157 ACPI_DEBUG_PRINT((ACPI_DB_WARN,
168 return_ACPI_STATUS (status); 158 "acpi_enable failed.\n"));
159 return_ACPI_STATUS(status);
169 } 160 }
170 } 161 }
171 162
@@ -175,12 +166,12 @@ acpi_enable_subsystem (
175 * install_address_space_handler interface. 166 * install_address_space_handler interface.
176 */ 167 */
177 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { 168 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
178 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 169 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
179 "[Init] Installing default address space handlers\n")); 170 "[Init] Installing default address space handlers\n"));
180 171
181 status = acpi_ev_install_region_handlers (); 172 status = acpi_ev_install_region_handlers();
182 if (ACPI_FAILURE (status)) { 173 if (ACPI_FAILURE(status)) {
183 return_ACPI_STATUS (status); 174 return_ACPI_STATUS(status);
184 } 175 }
185 } 176 }
186 177
@@ -193,28 +184,28 @@ acpi_enable_subsystem (
193 * execution! 184 * execution!
194 */ 185 */
195 if (!(flags & ACPI_NO_EVENT_INIT)) { 186 if (!(flags & ACPI_NO_EVENT_INIT)) {
196 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 187 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
197 "[Init] Initializing ACPI events\n")); 188 "[Init] Initializing ACPI events\n"));
198 189
199 status = acpi_ev_initialize_events (); 190 status = acpi_ev_initialize_events();
200 if (ACPI_FAILURE (status)) { 191 if (ACPI_FAILURE(status)) {
201 return_ACPI_STATUS (status); 192 return_ACPI_STATUS(status);
202 } 193 }
203 } 194 }
204 195
205 /* Install the SCI handler and Global Lock handler */ 196 /* Install the SCI handler and Global Lock handler */
206 197
207 if (!(flags & ACPI_NO_HANDLER_INIT)) { 198 if (!(flags & ACPI_NO_HANDLER_INIT)) {
208 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 199 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
209 "[Init] Installing SCI/GL handlers\n")); 200 "[Init] Installing SCI/GL handlers\n"));
210 201
211 status = acpi_ev_install_xrupt_handlers (); 202 status = acpi_ev_install_xrupt_handlers();
212 if (ACPI_FAILURE (status)) { 203 if (ACPI_FAILURE(status)) {
213 return_ACPI_STATUS (status); 204 return_ACPI_STATUS(status);
214 } 205 }
215 } 206 }
216 207
217 return_ACPI_STATUS (status); 208 return_ACPI_STATUS(status);
218} 209}
219 210
220/******************************************************************************* 211/*******************************************************************************
@@ -230,15 +221,11 @@ acpi_enable_subsystem (
230 * 221 *
231 ******************************************************************************/ 222 ******************************************************************************/
232 223
233acpi_status 224acpi_status acpi_initialize_objects(u32 flags)
234acpi_initialize_objects (
235 u32 flags)
236{ 225{
237 acpi_status status = AE_OK; 226 acpi_status status = AE_OK;
238
239
240 ACPI_FUNCTION_TRACE ("acpi_initialize_objects");
241 227
228 ACPI_FUNCTION_TRACE("acpi_initialize_objects");
242 229
243 /* 230 /*
244 * Run all _REG methods 231 * Run all _REG methods
@@ -248,12 +235,12 @@ acpi_initialize_objects (
248 * contain executable AML (see call to acpi_ns_initialize_objects below). 235 * contain executable AML (see call to acpi_ns_initialize_objects below).
249 */ 236 */
250 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { 237 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
251 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 238 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
252 "[Init] Executing _REG op_region methods\n")); 239 "[Init] Executing _REG op_region methods\n"));
253 240
254 status = acpi_ev_initialize_op_regions (); 241 status = acpi_ev_initialize_op_regions();
255 if (ACPI_FAILURE (status)) { 242 if (ACPI_FAILURE(status)) {
256 return_ACPI_STATUS (status); 243 return_ACPI_STATUS(status);
257 } 244 }
258 } 245 }
259 246
@@ -263,12 +250,12 @@ acpi_initialize_objects (
263 * objects: operation_regions, buffer_fields, Buffers, and Packages. 250 * objects: operation_regions, buffer_fields, Buffers, and Packages.
264 */ 251 */
265 if (!(flags & ACPI_NO_OBJECT_INIT)) { 252 if (!(flags & ACPI_NO_OBJECT_INIT)) {
266 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 253 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
267 "[Init] Completing Initialization of ACPI Objects\n")); 254 "[Init] Completing Initialization of ACPI Objects\n"));
268 255
269 status = acpi_ns_initialize_objects (); 256 status = acpi_ns_initialize_objects();
270 if (ACPI_FAILURE (status)) { 257 if (ACPI_FAILURE(status)) {
271 return_ACPI_STATUS (status); 258 return_ACPI_STATUS(status);
272 } 259 }
273 } 260 }
274 261
@@ -277,12 +264,12 @@ acpi_initialize_objects (
277 * This runs the _STA and _INI methods. 264 * This runs the _STA and _INI methods.
278 */ 265 */
279 if (!(flags & ACPI_NO_DEVICE_INIT)) { 266 if (!(flags & ACPI_NO_DEVICE_INIT)) {
280 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 267 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
281 "[Init] Initializing ACPI Devices\n")); 268 "[Init] Initializing ACPI Devices\n"));
282 269
283 status = acpi_ns_initialize_devices (); 270 status = acpi_ns_initialize_devices();
284 if (ACPI_FAILURE (status)) { 271 if (ACPI_FAILURE(status)) {
285 return_ACPI_STATUS (status); 272 return_ACPI_STATUS(status);
286 } 273 }
287 } 274 }
288 275
@@ -291,13 +278,12 @@ acpi_initialize_objects (
291 * the table load filled them up more than they will be at runtime -- 278 * the table load filled them up more than they will be at runtime --
292 * thus wasting non-paged memory. 279 * thus wasting non-paged memory.
293 */ 280 */
294 status = acpi_purge_cached_objects (); 281 status = acpi_purge_cached_objects();
295 282
296 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; 283 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK;
297 return_ACPI_STATUS (status); 284 return_ACPI_STATUS(status);
298} 285}
299 286
300
301/******************************************************************************* 287/*******************************************************************************
302 * 288 *
303 * FUNCTION: acpi_terminate 289 * FUNCTION: acpi_terminate
@@ -310,15 +296,11 @@ acpi_initialize_objects (
310 * 296 *
311 ******************************************************************************/ 297 ******************************************************************************/
312 298
313acpi_status 299acpi_status acpi_terminate(void)
314acpi_terminate (
315 void)
316{ 300{
317 acpi_status status; 301 acpi_status status;
318
319
320 ACPI_FUNCTION_TRACE ("acpi_terminate");
321 302
303 ACPI_FUNCTION_TRACE("acpi_terminate");
322 304
323 /* Terminate the AML Debugger if present */ 305 /* Terminate the AML Debugger if present */
324 306
@@ -326,28 +308,25 @@ acpi_terminate (
326 308
327 /* Shutdown and free all resources */ 309 /* Shutdown and free all resources */
328 310
329 acpi_ut_subsystem_shutdown (); 311 acpi_ut_subsystem_shutdown();
330
331 312
332 /* Free the mutex objects */ 313 /* Free the mutex objects */
333 314
334 acpi_ut_mutex_terminate (); 315 acpi_ut_mutex_terminate();
335
336 316
337#ifdef ACPI_DEBUGGER 317#ifdef ACPI_DEBUGGER
338 318
339 /* Shut down the debugger */ 319 /* Shut down the debugger */
340 320
341 acpi_db_terminate (); 321 acpi_db_terminate();
342#endif 322#endif
343 323
344 /* Now we can shutdown the OS-dependent layer */ 324 /* Now we can shutdown the OS-dependent layer */
345 325
346 status = acpi_os_terminate (); 326 status = acpi_os_terminate();
347 return_ACPI_STATUS (status); 327 return_ACPI_STATUS(status);
348} 328}
349 329
350
351#ifdef ACPI_FUTURE_USAGE 330#ifdef ACPI_FUTURE_USAGE
352/******************************************************************************* 331/*******************************************************************************
353 * 332 *
@@ -363,20 +342,16 @@ acpi_terminate (
363 * 342 *
364 ******************************************************************************/ 343 ******************************************************************************/
365 344
366acpi_status 345acpi_status acpi_subsystem_status(void)
367acpi_subsystem_status (
368 void)
369{ 346{
370 347
371 if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) { 348 if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) {
372 return (AE_OK); 349 return (AE_OK);
373 } 350 } else {
374 else {
375 return (AE_ERROR); 351 return (AE_ERROR);
376 } 352 }
377} 353}
378 354
379
380/******************************************************************************* 355/*******************************************************************************
381 * 356 *
382 * FUNCTION: acpi_get_system_info 357 * FUNCTION: acpi_get_system_info
@@ -395,64 +370,60 @@ acpi_subsystem_status (
395 * 370 *
396 ******************************************************************************/ 371 ******************************************************************************/
397 372
398acpi_status 373acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
399acpi_get_system_info (
400 struct acpi_buffer *out_buffer)
401{ 374{
402 struct acpi_system_info *info_ptr; 375 struct acpi_system_info *info_ptr;
403 acpi_status status; 376 acpi_status status;
404 u32 i; 377 u32 i;
405
406
407 ACPI_FUNCTION_TRACE ("acpi_get_system_info");
408 378
379 ACPI_FUNCTION_TRACE("acpi_get_system_info");
409 380
410 /* Parameter validation */ 381 /* Parameter validation */
411 382
412 status = acpi_ut_validate_buffer (out_buffer); 383 status = acpi_ut_validate_buffer(out_buffer);
413 if (ACPI_FAILURE (status)) { 384 if (ACPI_FAILURE(status)) {
414 return_ACPI_STATUS (status); 385 return_ACPI_STATUS(status);
415 } 386 }
416 387
417 /* Validate/Allocate/Clear caller buffer */ 388 /* Validate/Allocate/Clear caller buffer */
418 389
419 status = acpi_ut_initialize_buffer (out_buffer, sizeof (struct acpi_system_info)); 390 status =
420 if (ACPI_FAILURE (status)) { 391 acpi_ut_initialize_buffer(out_buffer,
421 return_ACPI_STATUS (status); 392 sizeof(struct acpi_system_info));
393 if (ACPI_FAILURE(status)) {
394 return_ACPI_STATUS(status);
422 } 395 }
423 396
424 /* 397 /*
425 * Populate the return buffer 398 * Populate the return buffer
426 */ 399 */
427 info_ptr = (struct acpi_system_info *) out_buffer->pointer; 400 info_ptr = (struct acpi_system_info *)out_buffer->pointer;
428 401
429 info_ptr->acpi_ca_version = ACPI_CA_VERSION; 402 info_ptr->acpi_ca_version = ACPI_CA_VERSION;
430 403
431 /* System flags (ACPI capabilities) */ 404 /* System flags (ACPI capabilities) */
432 405
433 info_ptr->flags = ACPI_SYS_MODE_ACPI; 406 info_ptr->flags = ACPI_SYS_MODE_ACPI;
434 407
435 /* Timer resolution - 24 or 32 bits */ 408 /* Timer resolution - 24 or 32 bits */
436 409
437 if (!acpi_gbl_FADT) { 410 if (!acpi_gbl_FADT) {
438 info_ptr->timer_resolution = 0; 411 info_ptr->timer_resolution = 0;
439 } 412 } else if (acpi_gbl_FADT->tmr_val_ext == 0) {
440 else if (acpi_gbl_FADT->tmr_val_ext == 0) {
441 info_ptr->timer_resolution = 24; 413 info_ptr->timer_resolution = 24;
442 } 414 } else {
443 else {
444 info_ptr->timer_resolution = 32; 415 info_ptr->timer_resolution = 32;
445 } 416 }
446 417
447 /* Clear the reserved fields */ 418 /* Clear the reserved fields */
448 419
449 info_ptr->reserved1 = 0; 420 info_ptr->reserved1 = 0;
450 info_ptr->reserved2 = 0; 421 info_ptr->reserved2 = 0;
451 422
452 /* Current debug levels */ 423 /* Current debug levels */
453 424
454 info_ptr->debug_layer = acpi_dbg_layer; 425 info_ptr->debug_layer = acpi_dbg_layer;
455 info_ptr->debug_level = acpi_dbg_level; 426 info_ptr->debug_level = acpi_dbg_level;
456 427
457 /* Current status of the ACPI tables, per table type */ 428 /* Current status of the ACPI tables, per table type */
458 429
@@ -461,10 +432,10 @@ acpi_get_system_info (
461 info_ptr->table_info[i].count = acpi_gbl_table_lists[i].count; 432 info_ptr->table_info[i].count = acpi_gbl_table_lists[i].count;
462 } 433 }
463 434
464 return_ACPI_STATUS (AE_OK); 435 return_ACPI_STATUS(AE_OK);
465} 436}
466EXPORT_SYMBOL(acpi_get_system_info);
467 437
438EXPORT_SYMBOL(acpi_get_system_info);
468 439
469/***************************************************************************** 440/*****************************************************************************
470 * 441 *
@@ -482,9 +453,7 @@ EXPORT_SYMBOL(acpi_get_system_info);
482 ****************************************************************************/ 453 ****************************************************************************/
483 454
484acpi_status 455acpi_status
485acpi_install_initialization_handler ( 456acpi_install_initialization_handler(acpi_init_handler handler, u32 function)
486 acpi_init_handler handler,
487 u32 function)
488{ 457{
489 458
490 if (!handler) { 459 if (!handler) {
@@ -499,7 +468,7 @@ acpi_install_initialization_handler (
499 return AE_OK; 468 return AE_OK;
500} 469}
501 470
502#endif /* ACPI_FUTURE_USAGE */ 471#endif /* ACPI_FUTURE_USAGE */
503 472
504/***************************************************************************** 473/*****************************************************************************
505 * 474 *
@@ -513,15 +482,13 @@ acpi_install_initialization_handler (
513 * 482 *
514 ****************************************************************************/ 483 ****************************************************************************/
515 484
516acpi_status 485acpi_status acpi_purge_cached_objects(void)
517acpi_purge_cached_objects (
518 void)
519{ 486{
520 ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects"); 487 ACPI_FUNCTION_TRACE("acpi_purge_cached_objects");
521 488
522 (void) acpi_os_purge_cache (acpi_gbl_state_cache); 489 (void)acpi_os_purge_cache(acpi_gbl_state_cache);
523 (void) acpi_os_purge_cache (acpi_gbl_operand_cache); 490 (void)acpi_os_purge_cache(acpi_gbl_operand_cache);
524 (void) acpi_os_purge_cache (acpi_gbl_ps_node_cache); 491 (void)acpi_os_purge_cache(acpi_gbl_ps_node_cache);
525 (void) acpi_os_purge_cache (acpi_gbl_ps_node_ext_cache); 492 (void)acpi_os_purge_cache(acpi_gbl_ps_node_ext_cache);
526 return_ACPI_STATUS (AE_OK); 493 return_ACPI_STATUS(AE_OK);
527} 494}