diff options
Diffstat (limited to 'drivers/acpi/events')
-rw-r--r-- | drivers/acpi/events/evgpe.c | 39 | ||||
-rw-r--r-- | drivers/acpi/events/evmisc.c | 18 | ||||
-rw-r--r-- | drivers/acpi/events/evregion.c | 65 | ||||
-rw-r--r-- | drivers/acpi/events/evrgnini.c | 5 |
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 |
50 | ACPI_MODULE_NAME("evmisc") | 50 | ACPI_MODULE_NAME("evmisc") |
51 | 51 | ||
52 | /* Names for Notify() values, used for debug output */ | ||
52 | #ifdef ACPI_DEBUG_OUTPUT | 53 | #ifdef ACPI_DEBUG_OUTPUT |
53 | static const char *acpi_notify_value_names[] = { | 54 | static 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) | |||
193 | acpi_status | 193 | acpi_status |
194 | acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | 194 | acpi_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 |