diff options
author | Bob Moore <robert.moore@intel.com> | 2012-12-30 19:11:45 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-10 06:36:22 -0500 |
commit | 3f654bad3257427bea7ba1c4d43a23d99a03622b (patch) | |
tree | 97231cf216c1c2cab48bd9ffcc768b6226fbf978 /drivers/acpi | |
parent | 9cea6249c9154a7d0b322a226261697f947692ad (diff) |
ACPICA: Interpreter: Fix Store() when implicit conversion is not possible.
For the cases such as a store of a string to an existing package
object, implement the store as a CopyObject().
This is a small departure from the ACPI specification which states
that the control method should be aborted in this case. However,
ASLTS suite depends on this behavior.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/exstore.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c index 90431f12f831..4ff37e8e0018 100644 --- a/drivers/acpi/acpica/exstore.c +++ b/drivers/acpi/acpica/exstore.c | |||
@@ -487,14 +487,33 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, | |||
487 | default: | 487 | default: |
488 | 488 | ||
489 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 489 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
490 | "Storing %s (%p) directly into node (%p) with no implicit conversion\n", | 490 | "Storing [%s] (%p) directly into node [%s] (%p)" |
491 | " with no implicit conversion\n", | ||
491 | acpi_ut_get_object_type_name(source_desc), | 492 | acpi_ut_get_object_type_name(source_desc), |
492 | source_desc, node)); | 493 | source_desc, |
494 | acpi_ut_get_object_type_name(target_desc), | ||
495 | node)); | ||
493 | 496 | ||
494 | /* No conversions for all other types. Just attach the source object */ | 497 | /* |
498 | * No conversions for all other types. Directly store a copy of | ||
499 | * the source object. NOTE: This is a departure from the ACPI | ||
500 | * spec, which states "If conversion is impossible, abort the | ||
501 | * running control method". | ||
502 | * | ||
503 | * This code implements "If conversion is impossible, treat the | ||
504 | * Store operation as a CopyObject". | ||
505 | */ | ||
506 | status = | ||
507 | acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc, | ||
508 | walk_state); | ||
509 | if (ACPI_FAILURE(status)) { | ||
510 | return_ACPI_STATUS(status); | ||
511 | } | ||
495 | 512 | ||
496 | status = acpi_ns_attach_object(node, source_desc, | 513 | status = |
497 | source_desc->common.type); | 514 | acpi_ns_attach_object(node, new_desc, |
515 | new_desc->common.type); | ||
516 | acpi_ut_remove_reference(new_desc); | ||
498 | break; | 517 | break; |
499 | } | 518 | } |
500 | 519 | ||