aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-05-26 16:36:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:44:35 -0400
commit4119532c95547821dbe72d6916dfa1b2148475b3 (patch)
tree564eb8f69924fb7dc72e93526faf1547acac7d30 /drivers/acpi/events
parentb8d35192c55fb055792ff0641408eaaec7c88988 (diff)
ACPI: ACPICA 20060526
Restructured, flattened, and simplified the internal interfaces for namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) Fixed a problem with the CopyObject operator where the first parameter was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. Fixed a problem where a ShiftLeft or ShiftRight of more than 64 bits produced incorrect results with some C compilers. Since the behavior of C compilers when the shift value is larger than the datatype width is apparently not well defined, the interpreter now detects this condition and simply returns zero as expected in all such cases. (BZ 395) Fixed problem reports (Valery Podrezov) integrated: - Update String-to-Integer conversion to match ACPI 3.0A spec http://bugzilla.kernel.org/show_bug.cgi?id=5329 Allow interpreter to handle nested method declarations http://bugzilla.kernel.org/show_bug.cgi?id=5361 Fixed problem reports (Fiodor Suietov) integrated: - acpi_terminate() doesn't free debug memory allocation list objects (BZ 355) - After Core Subsystem shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) - acpi_os_unmap_memory() for RSDP can be invoked inconsistently (BZ 357) - Resource Manager should return AE_TYPE for non-device objects (BZ 358) - Incomplete cleanup branch in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free() instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360) - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) - Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362) - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT is loaded (BZ 365) - Status of the Global Initialization Handler call not used (BZ 366) - Incorrect object parameter to Global Initialization Handler (BZ 367) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/events')
-rw-r--r--drivers/acpi/events/evgpe.c39
-rw-r--r--drivers/acpi/events/evmisc.c18
-rw-r--r--drivers/acpi/events/evregion.c65
-rw-r--r--drivers/acpi/events/evrgnini.c5
4 files changed, 79 insertions, 48 deletions
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index aa179dc78011..23fe53ba7375 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -488,9 +488,9 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
488 * 488 *
489 * RETURN: None 489 * RETURN: None
490 * 490 *
491 * DESCRIPTION: Perform the actual execution of a GPE control method. This 491 * DESCRIPTION: Perform the actual execution of a GPE control method. This
492 * function is called from an invocation of acpi_os_exece 492 * function is called from an invocation of acpi_os_execute and
493 * (and therefore does NOT execute at interrupt level) so that 493 * therefore does NOT execute at interrupt level - so that
494 * the control method itself is not executed in the context of 494 * the control method itself is not executed in the context of
495 * an interrupt handler. 495 * an interrupt handler.
496 * 496 *
@@ -502,7 +502,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
502 u32 gpe_number = 0; 502 u32 gpe_number = 0;
503 acpi_status status; 503 acpi_status status;
504 struct acpi_gpe_event_info local_gpe_event_info; 504 struct acpi_gpe_event_info local_gpe_event_info;
505 struct acpi_parameter_info info; 505 struct acpi_evaluate_info *info;
506 506
507 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); 507 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
508 508
@@ -540,16 +540,29 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
540 */ 540 */
541 if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) == 541 if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
542 ACPI_GPE_DISPATCH_METHOD) { 542 ACPI_GPE_DISPATCH_METHOD) {
543 /*
544 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
545 * control method that corresponds to this GPE
546 */
547 info.node = local_gpe_event_info.dispatch.method_node;
548 info.parameters =
549 ACPI_CAST_PTR(union acpi_operand_object *, gpe_event_info);
550 info.parameter_type = ACPI_PARAM_GPE;
551 543
552 status = acpi_ns_evaluate_by_handle(&info); 544 /* Allocate the evaluation information block */
545
546 info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
547 if (!info) {
548 status = AE_NO_MEMORY;
549 } else {
550 /*
551 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
552 * control method that corresponds to this GPE
553 */
554 info->prefix_node =
555 local_gpe_event_info.dispatch.method_node;
556 info->parameters =
557 ACPI_CAST_PTR(union acpi_operand_object *,
558 gpe_event_info);
559 info->parameter_type = ACPI_PARAM_GPE;
560 info->flags = ACPI_IGNORE_RETURN_VALUE;
561
562 status = acpi_ns_evaluate(info);
563 ACPI_FREE(info);
564 }
565
553 if (ACPI_FAILURE(status)) { 566 if (ACPI_FAILURE(status)) {
554 ACPI_EXCEPTION((AE_INFO, status, 567 ACPI_EXCEPTION((AE_INFO, status,
555 "While evaluating method [%4.4s] for GPE[%2X]", 568 "While evaluating method [%4.4s] for GPE[%2X]",
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 24e0b8d36f31..6eef4efddcf6 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -49,12 +49,13 @@
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evmisc") 50ACPI_MODULE_NAME("evmisc")
51 51
52/* Names for Notify() values, used for debug output */
52#ifdef ACPI_DEBUG_OUTPUT 53#ifdef ACPI_DEBUG_OUTPUT
53static const char *acpi_notify_value_names[] = { 54static const char *acpi_notify_value_names[] = {
54 "Bus Check", 55 "Bus Check",
55 "Device Check", 56 "Device Check",
56 "Device Wake", 57 "Device Wake",
57 "Eject request", 58 "Eject Request",
58 "Device Check Light", 59 "Device Check Light",
59 "Frequency Mismatch", 60 "Frequency Mismatch",
60 "Bus Mode Mismatch", 61 "Bus Mode Mismatch",
@@ -191,8 +192,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
191 notify_info->notify.value = (u16) notify_value; 192 notify_info->notify.value = (u16) notify_value;
192 notify_info->notify.handler_obj = handler_obj; 193 notify_info->notify.handler_obj = handler_obj;
193 194
194 status = acpi_os_execute(OSL_NOTIFY_HANDLER, 195 status =
195 acpi_ev_notify_dispatch, notify_info); 196 acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
197 notify_info);
196 if (ACPI_FAILURE(status)) { 198 if (ACPI_FAILURE(status)) {
197 acpi_ut_delete_generic_state(notify_info); 199 acpi_ut_delete_generic_state(notify_info);
198 } 200 }
@@ -345,8 +347,9 @@ static u32 acpi_ev_global_lock_handler(void *context)
345 347
346 /* Run the Global Lock thread which will signal all waiting threads */ 348 /* Run the Global Lock thread which will signal all waiting threads */
347 349
348 status = acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER, 350 status =
349 acpi_ev_global_lock_thread, context); 351 acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
352 acpi_ev_global_lock_thread, context);
350 if (ACPI_FAILURE(status)) { 353 if (ACPI_FAILURE(status)) {
351 ACPI_EXCEPTION((AE_INFO, status, 354 ACPI_EXCEPTION((AE_INFO, status,
352 "Could not queue Global Lock thread")); 355 "Could not queue Global Lock thread"));
@@ -462,8 +465,9 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
462 * Acquire the global lock semaphore first. 465 * Acquire the global lock semaphore first.
463 * Since this wait will block, we must release the interpreter 466 * Since this wait will block, we must release the interpreter
464 */ 467 */
465 status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore, 468 status =
466 timeout); 469 acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
470 timeout);
467 return_ACPI_STATUS(status); 471 return_ACPI_STATUS(status);
468} 472}
469 473
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index edf9d2e1dff9..094a17e4c86d 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -193,8 +193,8 @@ acpi_status acpi_ev_initialize_op_regions(void)
193acpi_status 193acpi_status
194acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) 194acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
195{ 195{
196 struct acpi_parameter_info info; 196 struct acpi_evaluate_info *info;
197 union acpi_operand_object *params[3]; 197 union acpi_operand_object *args[3];
198 union acpi_operand_object *region_obj2; 198 union acpi_operand_object *region_obj2;
199 acpi_status status; 199 acpi_status status;
200 200
@@ -209,47 +209,60 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
209 return_ACPI_STATUS(AE_OK); 209 return_ACPI_STATUS(AE_OK);
210 } 210 }
211 211
212 /* Allocate and initialize the evaluation information block */
213
214 info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
215 if (!info) {
216 return_ACPI_STATUS(AE_NO_MEMORY);
217 }
218
219 info->prefix_node = region_obj2->extra.method_REG;
220 info->pathname = NULL;
221 info->parameters = args;
222 info->parameter_type = ACPI_PARAM_ARGS;
223 info->flags = ACPI_IGNORE_RETURN_VALUE;
224
212 /* 225 /*
213 * The _REG method has two arguments: 226 * The _REG method has two arguments:
214 * 227 *
215 * Arg0, Integer: Operation region space ID 228 * Arg0 - Integer:
216 * Same value as region_obj->Region.space_id 229 * Operation region space ID Same value as region_obj->Region.space_id
217 * Arg1, Integer: connection status 230 *
218 * 1 for connecting the handler, 231 * Arg1 - Integer:
219 * 0 for disconnecting the handler 232 * connection status 1 for connecting the handler, 0 for disconnecting
220 * Passed as a parameter 233 * the handler (Passed as a parameter)
221 */ 234 */
222 params[0] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 235 args[0] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
223 if (!params[0]) { 236 if (!args[0]) {
224 return_ACPI_STATUS(AE_NO_MEMORY); 237 status = AE_NO_MEMORY;
238 goto cleanup1;
225 } 239 }
226 240
227 params[1] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 241 args[1] = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
228 if (!params[1]) { 242 if (!args[1]) {
229 status = AE_NO_MEMORY; 243 status = AE_NO_MEMORY;
230 goto cleanup; 244 goto cleanup2;
231 } 245 }
232 246
233 /* Setup the parameter objects */ 247 /* Setup the parameter objects */
234 248
235 params[0]->integer.value = region_obj->region.space_id; 249 args[0]->integer.value = region_obj->region.space_id;
236 params[1]->integer.value = function; 250 args[1]->integer.value = function;
237 params[2] = NULL; 251 args[2] = NULL;
238
239 info.node = region_obj2->extra.method_REG;
240 info.parameters = params;
241 info.parameter_type = ACPI_PARAM_ARGS;
242 252
243 /* Execute the method, no return value */ 253 /* Execute the method, no return value */
244 254
245 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname 255 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
246 (ACPI_TYPE_METHOD, info.node, NULL)); 256 (ACPI_TYPE_METHOD, info->prefix_node, NULL));
247 status = acpi_ns_evaluate_by_handle(&info); 257
258 status = acpi_ns_evaluate(info);
259 acpi_ut_remove_reference(args[1]);
248 260
249 acpi_ut_remove_reference(params[1]); 261 cleanup2:
262 acpi_ut_remove_reference(args[0]);
250 263
251 cleanup: 264 cleanup1:
252 acpi_ut_remove_reference(params[0]); 265 ACPI_FREE(info);
253 return_ACPI_STATUS(status); 266 return_ACPI_STATUS(status);
254} 267}
255 268
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 1cecd577b899..5b3c7a85eb9a 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -475,8 +475,9 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
475 475
476 /* Find any "_REG" method associated with this region definition */ 476 /* Find any "_REG" method associated with this region definition */
477 477
478 status = acpi_ns_search_node(*reg_name_ptr, node, 478 status =
479 ACPI_TYPE_METHOD, &method_node); 479 acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD,
480 &method_node);
480 if (ACPI_SUCCESS(status)) { 481 if (ACPI_SUCCESS(status)) {
481 /* 482 /*
482 * The _REG method is optional and there can be only one per region 483 * The _REG method is optional and there can be only one per region