diff options
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/excreate.c | 95 | ||||
-rw-r--r-- | drivers/acpi/executer/exmutex.c | 16 |
2 files changed, 16 insertions, 95 deletions
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index b3914395851b..0396bd4819f1 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c | |||
@@ -352,101 +352,6 @@ acpi_ex_create_region(u8 * aml_start, | |||
352 | 352 | ||
353 | /******************************************************************************* | 353 | /******************************************************************************* |
354 | * | 354 | * |
355 | * FUNCTION: acpi_ex_create_table_region | ||
356 | * | ||
357 | * PARAMETERS: walk_state - Current state | ||
358 | * | ||
359 | * RETURN: Status | ||
360 | * | ||
361 | * DESCRIPTION: Create a new data_table_region object | ||
362 | * | ||
363 | ******************************************************************************/ | ||
364 | |||
365 | acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state) | ||
366 | { | ||
367 | acpi_status status; | ||
368 | union acpi_operand_object **operand = &walk_state->operands[0]; | ||
369 | union acpi_operand_object *obj_desc; | ||
370 | struct acpi_namespace_node *node; | ||
371 | union acpi_operand_object *region_obj2; | ||
372 | acpi_native_uint table_index; | ||
373 | struct acpi_table_header *table; | ||
374 | |||
375 | ACPI_FUNCTION_TRACE(ex_create_table_region); | ||
376 | |||
377 | /* Get the Node from the object stack */ | ||
378 | |||
379 | node = walk_state->op->common.node; | ||
380 | |||
381 | /* | ||
382 | * If the region object is already attached to this node, | ||
383 | * just return | ||
384 | */ | ||
385 | if (acpi_ns_get_attached_object(node)) { | ||
386 | return_ACPI_STATUS(AE_OK); | ||
387 | } | ||
388 | |||
389 | /* Find the ACPI table */ | ||
390 | |||
391 | status = acpi_tb_find_table(operand[1]->string.pointer, | ||
392 | operand[2]->string.pointer, | ||
393 | operand[3]->string.pointer, &table_index); | ||
394 | if (ACPI_FAILURE(status)) { | ||
395 | return_ACPI_STATUS(status); | ||
396 | } | ||
397 | |||
398 | /* Create the region descriptor */ | ||
399 | |||
400 | obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION); | ||
401 | if (!obj_desc) { | ||
402 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
403 | } | ||
404 | |||
405 | region_obj2 = obj_desc->common.next_object; | ||
406 | region_obj2->extra.region_context = NULL; | ||
407 | |||
408 | status = acpi_get_table_by_index(table_index, &table); | ||
409 | if (ACPI_FAILURE(status)) { | ||
410 | return_ACPI_STATUS(status); | ||
411 | } | ||
412 | |||
413 | /* Init the region from the operands */ | ||
414 | |||
415 | obj_desc->region.space_id = REGION_DATA_TABLE; | ||
416 | obj_desc->region.address = | ||
417 | (acpi_physical_address) ACPI_TO_INTEGER(table); | ||
418 | obj_desc->region.length = table->length; | ||
419 | obj_desc->region.node = node; | ||
420 | obj_desc->region.flags = AOPOBJ_DATA_VALID; | ||
421 | |||
422 | /* Install the new region object in the parent Node */ | ||
423 | |||
424 | status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION); | ||
425 | if (ACPI_FAILURE(status)) { | ||
426 | goto cleanup; | ||
427 | } | ||
428 | |||
429 | status = acpi_ev_initialize_region(obj_desc, FALSE); | ||
430 | if (ACPI_FAILURE(status)) { | ||
431 | if (status == AE_NOT_EXIST) { | ||
432 | status = AE_OK; | ||
433 | } else { | ||
434 | goto cleanup; | ||
435 | } | ||
436 | } | ||
437 | |||
438 | obj_desc->region.flags |= AOPOBJ_SETUP_COMPLETE; | ||
439 | |||
440 | cleanup: | ||
441 | |||
442 | /* Remove local reference to the object */ | ||
443 | |||
444 | acpi_ut_remove_reference(obj_desc); | ||
445 | return_ACPI_STATUS(status); | ||
446 | } | ||
447 | |||
448 | /******************************************************************************* | ||
449 | * | ||
450 | * FUNCTION: acpi_ex_create_processor | 355 | * FUNCTION: acpi_ex_create_processor |
451 | * | 356 | * |
452 | * PARAMETERS: walk_state - Current state | 357 | * PARAMETERS: walk_state - Current state |
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c index b8d035c00b61..7c70938eef89 100644 --- a/drivers/acpi/executer/exmutex.c +++ b/drivers/acpi/executer/exmutex.c | |||
@@ -85,6 +85,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) | |||
85 | } else { | 85 | } else { |
86 | thread->acquired_mutex_list = obj_desc->mutex.next; | 86 | thread->acquired_mutex_list = obj_desc->mutex.next; |
87 | } | 87 | } |
88 | return; | ||
88 | } | 89 | } |
89 | 90 | ||
90 | /******************************************************************************* | 91 | /******************************************************************************* |
@@ -298,6 +299,17 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc) | |||
298 | return (AE_NOT_ACQUIRED); | 299 | return (AE_NOT_ACQUIRED); |
299 | } | 300 | } |
300 | 301 | ||
302 | /* No obj_desc->Mutex.owner_thread for Global Lock */ | ||
303 | |||
304 | /* | ||
305 | * Mutex to be released must be at the head of acquired list to prevent | ||
306 | * deadlock. (The head of the list is the last mutex acquired.) | ||
307 | */ | ||
308 | if (obj_desc->mutex.owner_thread && | ||
309 | (obj_desc != obj_desc->mutex.owner_thread->acquired_mutex_list)) { | ||
310 | return (AE_AML_MUTEX_ORDER); | ||
311 | } | ||
312 | |||
301 | /* Match multiple Acquires with multiple Releases */ | 313 | /* Match multiple Acquires with multiple Releases */ |
302 | 314 | ||
303 | obj_desc->mutex.acquisition_depth--; | 315 | obj_desc->mutex.acquisition_depth--; |
@@ -403,6 +415,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
403 | } | 415 | } |
404 | 416 | ||
405 | status = acpi_ex_release_mutex_object(obj_desc); | 417 | status = acpi_ex_release_mutex_object(obj_desc); |
418 | if (ACPI_FAILURE(status)) { | ||
419 | return_ACPI_STATUS(status); | ||
420 | } | ||
406 | 421 | ||
407 | if (obj_desc->mutex.acquisition_depth == 0) { | 422 | if (obj_desc->mutex.acquisition_depth == 0) { |
408 | 423 | ||
@@ -411,6 +426,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
411 | walk_state->thread->current_sync_level = | 426 | walk_state->thread->current_sync_level = |
412 | obj_desc->mutex.original_sync_level; | 427 | obj_desc->mutex.original_sync_level; |
413 | } | 428 | } |
429 | |||
414 | return_ACPI_STATUS(status); | 430 | return_ACPI_STATUS(status); |
415 | } | 431 | } |
416 | 432 | ||