Diff markup
1 /********************************************* 1 /******************************************************************************
2 * 2 *
3 * Module Name: utxface - External interfaces 3 * Module Name: utxface - External interfaces for "global" ACPI functions
4 * 4 *
5 ********************************************* 5 *****************************************************************************/
6 6
7 /* 7 /*
8 * Copyright (C) 2000 - 2007, R. Byron Moore !! 8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that t 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must reta 14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the 15 * notice, this list of conditions, and the following disclaimer,
16 * without modification. 16 * without modification.
17 * 2. Redistributions in binary form must repr 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANT 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution mu 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Discla 20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution. 21 * binary redistribution.
22 * 3. Neither the names of the above-listed co 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endor 23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prio 24 * from this software without specific prior written permission.
25 * 25 *
26 * Alternatively, this software may be distrib 26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation. 28 * Software Foundation.
29 * 29 *
30 * NO WARRANTY 30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTI 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCH 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECI 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PRO 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILI 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIG 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
>> 44 #include <linux/module.h>
>> 45
44 #include <acpi/acpi.h> 46 #include <acpi/acpi.h>
45 #include <acpi/acevents.h> 47 #include <acpi/acevents.h>
46 #include <acpi/acnamesp.h> 48 #include <acpi/acnamesp.h>
>> 49 #include <acpi/acparser.h>
>> 50 #include <acpi/acdispat.h>
47 #include <acpi/acdebug.h> 51 #include <acpi/acdebug.h>
48 52
49 #define _COMPONENT ACPI_UTILITIES 53 #define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME("utxface") !! 54 ACPI_MODULE_NAME ("utxface")
>> 55
51 56
52 /********************************************* 57 /*******************************************************************************
53 * 58 *
54 * FUNCTION: acpi_initialize_subsystem 59 * FUNCTION: acpi_initialize_subsystem
55 * 60 *
56 * PARAMETERS: None 61 * PARAMETERS: None
57 * 62 *
58 * RETURN: Status 63 * RETURN: Status
59 * 64 *
60 * DESCRIPTION: Initializes all global variabl 65 * DESCRIPTION: Initializes all global variables. This is the first function
61 * called, so any early initializ 66 * called, so any early initialization belongs here.
62 * 67 *
63 ********************************************* 68 ******************************************************************************/
64 acpi_status __init acpi_initialize_subsystem(v !! 69
>> 70 acpi_status
>> 71 acpi_initialize_subsystem (
>> 72 void)
65 { 73 {
66 acpi_status status; !! 74 acpi_status status;
67 75
68 ACPI_FUNCTION_TRACE(acpi_initialize_su !! 76 ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem");
69 77
70 acpi_gbl_startup_flags = ACPI_SUBSYSTE <<
71 ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr <<
72 78
73 /* Initialize the OS-Dependent layer * !! 79 ACPI_DEBUG_EXEC (acpi_ut_init_stack_ptr_trace ());
74 80
75 status = acpi_os_initialize(); <<
76 if (ACPI_FAILURE(status)) { <<
77 ACPI_EXCEPTION((AE_INFO, statu <<
78 return_ACPI_STATUS(status); <<
79 } <<
80 81
81 /* Initialize all globals used by the 82 /* Initialize all globals used by the subsystem */
82 83
83 acpi_ut_init_globals(); !! 84 acpi_ut_init_globals ();
>> 85
>> 86 /* Initialize the OS-Dependent layer */
>> 87
>> 88 status = acpi_os_initialize ();
>> 89 if (ACPI_FAILURE (status)) {
>> 90 ACPI_REPORT_ERROR (("OSD failed to initialize, %s\n",
>> 91 acpi_format_exception (status)));
>> 92 return_ACPI_STATUS (status);
>> 93 }
84 94
85 /* Create the default mutex objects */ 95 /* Create the default mutex objects */
86 96
87 status = acpi_ut_mutex_initialize(); !! 97 status = acpi_ut_mutex_initialize ();
88 if (ACPI_FAILURE(status)) { !! 98 if (ACPI_FAILURE (status)) {
89 ACPI_EXCEPTION((AE_INFO, statu !! 99 ACPI_REPORT_ERROR (("Global mutex creation failure, %s\n",
90 "During Global !! 100 acpi_format_exception (status)));
91 return_ACPI_STATUS(status); !! 101 return_ACPI_STATUS (status);
92 } 102 }
93 103
94 /* 104 /*
95 * Initialize the namespace manager an 105 * Initialize the namespace manager and
96 * the root of the namespace tree 106 * the root of the namespace tree
97 */ 107 */
98 status = acpi_ns_root_initialize(); !! 108
99 if (ACPI_FAILURE(status)) { !! 109 status = acpi_ns_root_initialize ();
100 ACPI_EXCEPTION((AE_INFO, statu !! 110 if (ACPI_FAILURE (status)) {
101 "During Namesp !! 111 ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n",
102 return_ACPI_STATUS(status); !! 112 acpi_format_exception (status)));
>> 113 return_ACPI_STATUS (status);
103 } 114 }
104 115
>> 116
105 /* If configured, initialize the AML d 117 /* If configured, initialize the AML debugger */
106 118
107 ACPI_DEBUGGER_EXEC(status = acpi_db_in !! 119 ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ());
108 return_ACPI_STATUS(status); !! 120
>> 121 return_ACPI_STATUS (status);
109 } 122 }
110 123
>> 124
111 /********************************************* 125 /*******************************************************************************
112 * 126 *
113 * FUNCTION: acpi_enable_subsystem 127 * FUNCTION: acpi_enable_subsystem
114 * 128 *
115 * PARAMETERS: Flags - Init/enable 129 * PARAMETERS: Flags - Init/enable Options
116 * 130 *
117 * RETURN: Status 131 * RETURN: Status
118 * 132 *
119 * DESCRIPTION: Completes the subsystem initia 133 * DESCRIPTION: Completes the subsystem initialization including hardware.
120 * Puts system into ACPI mode if 134 * Puts system into ACPI mode if it isn't already.
121 * 135 *
122 ********************************************* 136 ******************************************************************************/
123 acpi_status acpi_enable_subsystem(u32 flags) !! 137
>> 138 acpi_status
>> 139 acpi_enable_subsystem (
>> 140 u32 flags)
124 { 141 {
125 acpi_status status = AE_OK; !! 142 acpi_status status = AE_OK;
>> 143
>> 144
>> 145 ACPI_FUNCTION_TRACE ("acpi_enable_subsystem");
>> 146
126 147
127 ACPI_FUNCTION_TRACE(acpi_enable_subsys !! 148 /*
>> 149 * We must initialize the hardware before we can enable ACPI.
>> 150 * The values from the FADT are validated here.
>> 151 */
>> 152 if (!(flags & ACPI_NO_HARDWARE_INIT)) {
>> 153 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI hardware\n"));
>> 154
>> 155 status = acpi_hw_initialize ();
>> 156 if (ACPI_FAILURE (status)) {
>> 157 return_ACPI_STATUS (status);
>> 158 }
>> 159 }
128 160
129 /* Enable ACPI mode */ 161 /* Enable ACPI mode */
130 162
131 if (!(flags & ACPI_NO_ACPI_ENABLE)) { 163 if (!(flags & ACPI_NO_ACPI_ENABLE)) {
132 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 164 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
133 "[Init] Goin <<
134 165
135 acpi_gbl_original_mode = acpi_ 166 acpi_gbl_original_mode = acpi_hw_get_mode();
136 167
137 status = acpi_enable(); !! 168 status = acpi_enable ();
138 if (ACPI_FAILURE(status)) { !! 169 if (ACPI_FAILURE (status)) {
139 ACPI_WARNING((AE_INFO, !! 170 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "acpi_enable failed.\n"));
140 return_ACPI_STATUS(sta !! 171 return_ACPI_STATUS (status);
141 } 172 }
142 } 173 }
143 174
144 /* 175 /*
145 * Install the default op_region handl 176 * Install the default op_region handlers. These are installed unless
146 * other handlers have already been in 177 * other handlers have already been installed via the
147 * install_address_space_handler inter 178 * install_address_space_handler interface.
148 */ 179 */
149 if (!(flags & ACPI_NO_ADDRESS_SPACE_IN 180 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
150 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 181 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n"));
151 "[Init] Inst <<
152 182
153 status = acpi_ev_install_regio !! 183 status = acpi_ev_install_region_handlers ();
154 if (ACPI_FAILURE(status)) { !! 184 if (ACPI_FAILURE (status)) {
155 return_ACPI_STATUS(sta !! 185 return_ACPI_STATUS (status);
156 } 186 }
157 } 187 }
158 188
159 /* 189 /*
160 * Initialize ACPI Event handling (Fix 190 * Initialize ACPI Event handling (Fixed and General Purpose)
161 * 191 *
162 * Note1: We must have the hardware an !! 192 * NOTE: We must have the hardware AND events initialized before we can execute
163 * execute any control methods safely. !! 193 * ANY control methods SAFELY. Any control method can require ACPI hardware
164 * ACPI hardware support, so the hardw !! 194 * support, so the hardware MUST be initialized before execution!
165 * any method execution! <<
166 * <<
167 * Note2: Fixed events are initialized <<
168 * initialized, but cannot be enabled <<
169 * completely initialized (SCI and glo <<
170 */ 195 */
171 if (!(flags & ACPI_NO_EVENT_INIT)) { 196 if (!(flags & ACPI_NO_EVENT_INIT)) {
172 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 197 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI events\n"));
173 "[Init] Init <<
174 198
175 status = acpi_ev_initialize_ev !! 199 status = acpi_ev_initialize_events ();
176 if (ACPI_FAILURE(status)) { !! 200 if (ACPI_FAILURE (status)) {
177 return_ACPI_STATUS(sta !! 201 return_ACPI_STATUS (status);
178 } 202 }
179 } 203 }
180 204
181 /* !! 205 /* Install the SCI handler and Global Lock handler */
182 * Install the SCI handler and Global <<
183 * hardware initialization. <<
184 */ <<
185 if (!(flags & ACPI_NO_HANDLER_INIT)) { <<
186 ACPI_DEBUG_PRINT((ACPI_DB_EXEC <<
187 "[Init] Inst <<
188 206
189 status = acpi_ev_install_xrupt !! 207 if (!(flags & ACPI_NO_HANDLER_INIT)) {
190 if (ACPI_FAILURE(status)) { !! 208 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing SCI/GL handlers\n"));
191 return_ACPI_STATUS(sta <<
192 } <<
193 } <<
194 209
195 /* !! 210 status = acpi_ev_install_xrupt_handlers ();
196 * Complete the GPE initialization for !! 211 if (ACPI_FAILURE (status)) {
197 * (GPE block 0 and 1). !! 212 return_ACPI_STATUS (status);
198 * <<
199 * Note1: This is where the _PRW metho <<
200 * methods can only be executed after <<
201 * installed and initialized. <<
202 * <<
203 * Note2: Currently, there seems to be <<
204 * before execution of the _PRW method <<
205 */ <<
206 if (!(flags & ACPI_NO_EVENT_INIT)) { <<
207 status = acpi_ev_install_fadt_ <<
208 if (ACPI_FAILURE(status)) { <<
209 return (status); <<
210 } 213 }
211 } 214 }
212 215
213 return_ACPI_STATUS(status); !! 216 return_ACPI_STATUS (status);
214 } 217 }
215 218
216 ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) <<
217 <<
218 /********************************************* 219 /*******************************************************************************
219 * 220 *
220 * FUNCTION: acpi_initialize_objects 221 * FUNCTION: acpi_initialize_objects
221 * 222 *
222 * PARAMETERS: Flags - Init/enable 223 * PARAMETERS: Flags - Init/enable Options
223 * 224 *
224 * RETURN: Status 225 * RETURN: Status
225 * 226 *
226 * DESCRIPTION: Completes namespace initializa 227 * DESCRIPTION: Completes namespace initialization by initializing device
227 * objects and executing AML code 228 * objects and executing AML code for Regions, buffers, etc.
228 * 229 *
229 ********************************************* 230 ******************************************************************************/
230 acpi_status acpi_initialize_objects(u32 flags) !! 231
>> 232 acpi_status
>> 233 acpi_initialize_objects (
>> 234 u32 flags)
231 { 235 {
232 acpi_status status = AE_OK; !! 236 acpi_status status = AE_OK;
>> 237
>> 238
>> 239 ACPI_FUNCTION_TRACE ("acpi_initialize_objects");
233 240
234 ACPI_FUNCTION_TRACE(acpi_initialize_ob <<
235 241
236 /* 242 /*
237 * Run all _REG methods 243 * Run all _REG methods
238 * 244 *
239 * Note: Any objects accessed by the _ !! 245 * NOTE: Any objects accessed
240 * initialized, even if they contain e !! 246 * by the _REG methods will be automatically initialized, even if they
241 * acpi_ns_initialize_objects below). !! 247 * contain executable AML (see call to acpi_ns_initialize_objects below).
242 */ 248 */
243 if (!(flags & ACPI_NO_ADDRESS_SPACE_IN 249 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
244 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 250 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Executing _REG op_region methods\n"));
245 "[Init] Exec <<
246 251
247 status = acpi_ev_initialize_op !! 252 status = acpi_ev_initialize_op_regions ();
248 if (ACPI_FAILURE(status)) { !! 253 if (ACPI_FAILURE (status)) {
249 return_ACPI_STATUS(sta !! 254 return_ACPI_STATUS (status);
250 } 255 }
251 } 256 }
252 257
253 /* 258 /*
254 * Initialize the objects that remain !! 259 * Initialize the objects that remain uninitialized. This
255 * executable AML that may be part of !! 260 * runs the executable AML that may be part of the declaration of these
256 * operation_regions, buffer_fields, B !! 261 * objects: operation_regions, buffer_fields, Buffers, and Packages.
257 */ 262 */
258 if (!(flags & ACPI_NO_OBJECT_INIT)) { 263 if (!(flags & ACPI_NO_OBJECT_INIT)) {
259 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 264 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Completing Initialization of ACPI Objects\n"));
260 "[Init] Comp <<
261 265
262 status = acpi_ns_initialize_ob !! 266 status = acpi_ns_initialize_objects ();
263 if (ACPI_FAILURE(status)) { !! 267 if (ACPI_FAILURE (status)) {
264 return_ACPI_STATUS(sta !! 268 return_ACPI_STATUS (status);
265 } 269 }
266 } 270 }
267 271
268 /* 272 /*
269 * Initialize all device objects in th !! 273 * Initialize all device objects in the namespace
270 * _STA and _INI methods. !! 274 * This runs the _STA and _INI methods.
271 */ 275 */
272 if (!(flags & ACPI_NO_DEVICE_INIT)) { 276 if (!(flags & ACPI_NO_DEVICE_INIT)) {
273 ACPI_DEBUG_PRINT((ACPI_DB_EXEC !! 277 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n"));
274 "[Init] Init <<
275 278
276 status = acpi_ns_initialize_de !! 279 status = acpi_ns_initialize_devices ();
277 if (ACPI_FAILURE(status)) { !! 280 if (ACPI_FAILURE (status)) {
278 return_ACPI_STATUS(sta !! 281 return_ACPI_STATUS (status);
279 } 282 }
280 } 283 }
281 284
282 /* 285 /*
283 * Empty the caches (delete the cached 286 * Empty the caches (delete the cached objects) on the assumption that
284 * the table load filled them up more 287 * the table load filled them up more than they will be at runtime --
285 * thus wasting non-paged memory. 288 * thus wasting non-paged memory.
286 */ 289 */
287 status = acpi_purge_cached_objects(); !! 290 status = acpi_purge_cached_objects ();
288 291
289 acpi_gbl_startup_flags |= ACPI_INITIAL 292 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK;
290 return_ACPI_STATUS(status); !! 293 return_ACPI_STATUS (status);
291 } 294 }
292 295
293 ACPI_EXPORT_SYMBOL(acpi_initialize_objects) <<
294 296
295 /********************************************* 297 /*******************************************************************************
296 * 298 *
297 * FUNCTION: acpi_terminate 299 * FUNCTION: acpi_terminate
298 * 300 *
299 * PARAMETERS: None 301 * PARAMETERS: None
300 * 302 *
301 * RETURN: Status 303 * RETURN: Status
302 * 304 *
303 * DESCRIPTION: Shutdown the ACPI subsystem. 305 * DESCRIPTION: Shutdown the ACPI subsystem. Release all resources.
304 * 306 *
305 ********************************************* 307 ******************************************************************************/
306 acpi_status acpi_terminate(void) !! 308
>> 309 acpi_status
>> 310 acpi_terminate (void)
307 { 311 {
308 acpi_status status; !! 312 acpi_status status;
>> 313
>> 314
>> 315 ACPI_FUNCTION_TRACE ("acpi_terminate");
309 316
310 ACPI_FUNCTION_TRACE(acpi_terminate); <<
311 317
312 /* Terminate the AML Debugger if prese 318 /* Terminate the AML Debugger if present */
313 319
314 ACPI_DEBUGGER_EXEC(acpi_gbl_db_termina 320 ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE);
315 321
316 /* Shutdown and free all resources */ 322 /* Shutdown and free all resources */
317 323
318 acpi_ut_subsystem_shutdown(); !! 324 acpi_ut_subsystem_shutdown ();
>> 325
319 326
320 /* Free the mutex objects */ 327 /* Free the mutex objects */
321 328
322 acpi_ut_mutex_terminate(); !! 329 acpi_ut_mutex_terminate ();
>> 330
323 331
324 #ifdef ACPI_DEBUGGER 332 #ifdef ACPI_DEBUGGER
325 333
326 /* Shut down the debugger */ 334 /* Shut down the debugger */
327 335
328 acpi_db_terminate(); !! 336 acpi_db_terminate ();
329 #endif 337 #endif
330 338
331 /* Now we can shutdown the OS-dependen 339 /* Now we can shutdown the OS-dependent layer */
332 340
333 status = acpi_os_terminate(); !! 341 status = acpi_os_terminate ();
334 return_ACPI_STATUS(status); !! 342 return_ACPI_STATUS (status);
335 } 343 }
336 344
337 ACPI_EXPORT_SYMBOL(acpi_terminate) !! 345
338 #ifdef ACPI_FUTURE_USAGE 346 #ifdef ACPI_FUTURE_USAGE
339 /********************************************* !! 347
>> 348 /*****************************************************************************
340 * 349 *
341 * FUNCTION: acpi_subsystem_status 350 * FUNCTION: acpi_subsystem_status
342 * 351 *
343 * PARAMETERS: None 352 * PARAMETERS: None
344 * 353 *
345 * RETURN: Status of the ACPI subsystem 354 * RETURN: Status of the ACPI subsystem
346 * 355 *
347 * DESCRIPTION: Other drivers that use the ACP 356 * DESCRIPTION: Other drivers that use the ACPI subsystem should call this
348 * before making any other calls, !! 357 * before making any other calls, to ensure the subsystem initial-
349 * initialized successfully. !! 358 * ized successfully.
350 * 359 *
351 ********************************************* !! 360 ****************************************************************************/
352 acpi_status acpi_subsystem_status(void) <<
353 { <<
354 361
>> 362 acpi_status
>> 363 acpi_subsystem_status (void)
>> 364 {
355 if (acpi_gbl_startup_flags & ACPI_INIT 365 if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) {
356 return (AE_OK); 366 return (AE_OK);
357 } else { !! 367 }
>> 368 else {
358 return (AE_ERROR); 369 return (AE_ERROR);
359 } 370 }
360 } 371 }
361 372
362 ACPI_EXPORT_SYMBOL(acpi_subsystem_status) <<
363 373
364 /********************************************* !! 374 /******************************************************************************
365 * 375 *
366 * FUNCTION: acpi_get_system_info 376 * FUNCTION: acpi_get_system_info
367 * 377 *
368 * PARAMETERS: out_buffer - A buffer to !! 378 * PARAMETERS: out_buffer - a pointer to a buffer to receive the
369 * device !! 379 * resources for the device
>> 380 * buffer_length - the number of bytes available in the buffer
370 * 381 *
371 * RETURN: Status - the status o 382 * RETURN: Status - the status of the call
372 * 383 *
373 * DESCRIPTION: This function is called to get 384 * DESCRIPTION: This function is called to get information about the current
374 * state of the ACPI subsystem. 385 * state of the ACPI subsystem. It will return system information
375 * in the out_buffer. 386 * in the out_buffer.
376 * 387 *
377 * If the function fails an appro 388 * If the function fails an appropriate status will be returned
378 * and the value of out_buffer is 389 * and the value of out_buffer is undefined.
379 * 390 *
380 ********************************************* 391 ******************************************************************************/
381 acpi_status acpi_get_system_info(struct acpi_b !! 392
>> 393 acpi_status
>> 394 acpi_get_system_info (
>> 395 struct acpi_buffer *out_buffer)
382 { 396 {
383 struct acpi_system_info *info_ptr; !! 397 struct acpi_system_info *info_ptr;
384 acpi_status status; !! 398 u32 i;
>> 399 acpi_status status;
>> 400
>> 401
>> 402 ACPI_FUNCTION_TRACE ("acpi_get_system_info");
385 403
386 ACPI_FUNCTION_TRACE(acpi_get_system_in <<
387 404
388 /* Parameter validation */ 405 /* Parameter validation */
389 406
390 status = acpi_ut_validate_buffer(out_b !! 407 status = acpi_ut_validate_buffer (out_buffer);
391 if (ACPI_FAILURE(status)) { !! 408 if (ACPI_FAILURE (status)) {
392 return_ACPI_STATUS(status); !! 409 return_ACPI_STATUS (status);
393 } 410 }
394 411
395 /* Validate/Allocate/Clear caller buff 412 /* Validate/Allocate/Clear caller buffer */
396 413
397 status = !! 414 status = acpi_ut_initialize_buffer (out_buffer, sizeof (struct acpi_system_info));
398 acpi_ut_initialize_buffer(out_buff !! 415 if (ACPI_FAILURE (status)) {
399 sizeof(s !! 416 return_ACPI_STATUS (status);
400 if (ACPI_FAILURE(status)) { <<
401 return_ACPI_STATUS(status); <<
402 } 417 }
403 418
404 /* 419 /*
405 * Populate the return buffer 420 * Populate the return buffer
406 */ 421 */
407 info_ptr = (struct acpi_system_info *) !! 422 info_ptr = (struct acpi_system_info *) out_buffer->pointer;
408 423
409 info_ptr->acpi_ca_version = ACPI_CA_VE !! 424 info_ptr->acpi_ca_version = ACPI_CA_VERSION;
410 425
411 /* System flags (ACPI capabilities) */ 426 /* System flags (ACPI capabilities) */
412 427
413 info_ptr->flags = ACPI_SYS_MODE_ACPI; !! 428 info_ptr->flags = ACPI_SYS_MODE_ACPI;
414 429
415 /* Timer resolution - 24 or 32 bits * 430 /* Timer resolution - 24 or 32 bits */
416 431
417 if (acpi_gbl_FADT.flags & ACPI_FADT_32 !! 432 if (!acpi_gbl_FADT) {
>> 433 info_ptr->timer_resolution = 0;
>> 434 }
>> 435 else if (acpi_gbl_FADT->tmr_val_ext == 0) {
418 info_ptr->timer_resolution = 2 436 info_ptr->timer_resolution = 24;
419 } else { !! 437 }
>> 438 else {
420 info_ptr->timer_resolution = 3 439 info_ptr->timer_resolution = 32;
421 } 440 }
422 441
423 /* Clear the reserved fields */ 442 /* Clear the reserved fields */
424 443
425 info_ptr->reserved1 = 0; !! 444 info_ptr->reserved1 = 0;
426 info_ptr->reserved2 = 0; !! 445 info_ptr->reserved2 = 0;
427 446
428 /* Current debug levels */ 447 /* Current debug levels */
429 448
430 info_ptr->debug_layer = acpi_dbg_layer !! 449 info_ptr->debug_layer = acpi_dbg_layer;
431 info_ptr->debug_level = acpi_dbg_level !! 450 info_ptr->debug_level = acpi_dbg_level;
>> 451
>> 452 /* Current status of the ACPI tables, per table type */
>> 453
>> 454 info_ptr->num_table_types = NUM_ACPI_TABLE_TYPES;
>> 455 for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) {
>> 456 info_ptr->table_info[i].count = acpi_gbl_table_lists[i].count;
>> 457 }
432 458
433 return_ACPI_STATUS(AE_OK); !! 459 return_ACPI_STATUS (AE_OK);
434 } 460 }
>> 461 EXPORT_SYMBOL(acpi_get_system_info);
435 462
436 ACPI_EXPORT_SYMBOL(acpi_get_system_info) <<
437 463
438 /********************************************* 464 /*****************************************************************************
439 * 465 *
440 * FUNCTION: acpi_install_initialization_ha 466 * FUNCTION: acpi_install_initialization_handler
441 * 467 *
442 * PARAMETERS: Handler - Callback 468 * PARAMETERS: Handler - Callback procedure
443 * Function - Not (cur <<
444 * 469 *
445 * RETURN: Status 470 * RETURN: Status
446 * 471 *
447 * DESCRIPTION: Install an initialization hand 472 * DESCRIPTION: Install an initialization handler
448 * 473 *
449 * TBD: When a second function is added, must 474 * TBD: When a second function is added, must save the Function also.
450 * 475 *
451 ********************************************* 476 ****************************************************************************/
>> 477
452 acpi_status 478 acpi_status
453 acpi_install_initialization_handler(acpi_init_ !! 479 acpi_install_initialization_handler (
>> 480 acpi_init_handler handler,
>> 481 u32 function)
454 { 482 {
455 483
456 if (!handler) { 484 if (!handler) {
457 return (AE_BAD_PARAMETER); 485 return (AE_BAD_PARAMETER);
458 } 486 }
459 487
460 if (acpi_gbl_init_handler) { 488 if (acpi_gbl_init_handler) {
461 return (AE_ALREADY_EXISTS); 489 return (AE_ALREADY_EXISTS);
462 } 490 }
463 491
464 acpi_gbl_init_handler = handler; 492 acpi_gbl_init_handler = handler;
465 return AE_OK; 493 return AE_OK;
466 } 494 }
467 495
468 ACPI_EXPORT_SYMBOL(acpi_install_initialization !! 496 #endif /* ACPI_FUTURE_USAGE */
469 #endif /* ACPI_FUTUR !! 497
>> 498
470 /********************************************* 499 /*****************************************************************************
471 * 500 *
472 * FUNCTION: acpi_purge_cached_objects 501 * FUNCTION: acpi_purge_cached_objects
473 * 502 *
474 * PARAMETERS: None 503 * PARAMETERS: None
475 * 504 *
476 * RETURN: Status 505 * RETURN: Status
477 * 506 *
478 * DESCRIPTION: Empty all caches (delete the c 507 * DESCRIPTION: Empty all caches (delete the cached objects)
479 * 508 *
480 ********************************************* 509 ****************************************************************************/
481 acpi_status acpi_purge_cached_objects(void) !! 510
>> 511 acpi_status
>> 512 acpi_purge_cached_objects (void)
482 { 513 {
483 ACPI_FUNCTION_TRACE(acpi_purge_cached_ !! 514 ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects");
484 515
485 (void)acpi_os_purge_cache(acpi_gbl_sta <<
486 (void)acpi_os_purge_cache(acpi_gbl_ope <<
487 (void)acpi_os_purge_cache(acpi_gbl_ps_ <<
488 (void)acpi_os_purge_cache(acpi_gbl_ps_ <<
489 return_ACPI_STATUS(AE_OK); <<
490 } <<
491 516
492 ACPI_EXPORT_SYMBOL(acpi_purge_cached_objects) !! 517 #ifdef ACPI_ENABLE_OBJECT_CACHE
>> 518 acpi_ut_delete_generic_state_cache ();
>> 519 acpi_ut_delete_object_cache ();
>> 520 acpi_ds_delete_walk_state_cache ();
>> 521 acpi_ps_delete_parse_cache ();
>> 522 #endif
>> 523
>> 524 return_ACPI_STATUS (AE_OK);
>> 525 }
493 526
|
This page was automatically generated by the
LXR engine.
|