aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/dsobject.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-12-30 19:07:18 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:22 -0500
commitef42e53f271b99fe9eb853df5661edeac8a277f6 (patch)
treeaccdeb45436b2278086375374b5d88b529834253 /drivers/acpi/acpica/dsobject.c
parent3e5621a750e2cfb26748c34acbb67c691845494a (diff)
ACPICA: Interpreter: Add warning if 64-bit constant appears in 32-bit table.
Some ASL compilers allow 64-bit constants within a 32-bit table (DSDT version == 1). When encountered, emit a warning that the constant will be truncated to 32 bits. This is potentially a serious problem in the ACPI table(s). 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/acpica/dsobject.c')
-rw-r--r--drivers/acpi/acpica/dsobject.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index 13844a115d97..82050bcd90e7 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -703,7 +703,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
703 /* Truncate value if we are executing from a 32-bit ACPI table */ 703 /* Truncate value if we are executing from a 32-bit ACPI table */
704 704
705#ifndef ACPI_NO_METHOD_EXECUTION 705#ifndef ACPI_NO_METHOD_EXECUTION
706 acpi_ex_truncate_for32bit_table(obj_desc); 706 (void)acpi_ex_truncate_for32bit_table(obj_desc);
707#endif 707#endif
708 break; 708 break;
709 709
@@ -725,8 +725,18 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
725 case AML_TYPE_LITERAL: 725 case AML_TYPE_LITERAL:
726 726
727 obj_desc->integer.value = op->common.value.integer; 727 obj_desc->integer.value = op->common.value.integer;
728
728#ifndef ACPI_NO_METHOD_EXECUTION 729#ifndef ACPI_NO_METHOD_EXECUTION
729 acpi_ex_truncate_for32bit_table(obj_desc); 730 if (acpi_ex_truncate_for32bit_table(obj_desc)) {
731
732 /* Warn if we found a 64-bit constant in a 32-bit table */
733
734 ACPI_WARNING((AE_INFO,
735 "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X",
736 ACPI_FORMAT_UINT64(op->common.
737 value.integer),
738 (u32)obj_desc->integer.value));
739 }
730#endif 740#endif
731 break; 741 break;
732 742