summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/interpreter/amfield.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/interpreter/amfield.c')
-rw-r--r--drivers/acpi/interpreter/amfield.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/acpi/interpreter/amfield.c b/drivers/acpi/interpreter/amfield.c
index d12770854..356be14c2 100644
--- a/drivers/acpi/interpreter/amfield.c
+++ b/drivers/acpi/interpreter/amfield.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: amfield - ACPI AML (p-code) execution - field manipulation
- * $Revision: 70 $
+ * $Revision: 74 $
*
*****************************************************************************/
@@ -105,7 +105,7 @@ acpi_aml_setup_field (
/*
- * If the address and length have not been previously evaluated,
+ * If the Region Address and Length have not been previously evaluated,
* evaluate them and save the results.
*/
if (!(rgn_desc->region.flags & AOPOBJ_DATA_VALID)) {
@@ -116,6 +116,16 @@ acpi_aml_setup_field (
}
}
+
+ if ((obj_desc->common.type == ACPI_TYPE_FIELD_UNIT) &&
+ (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)))
+ {
+ /*
+ * Field Buffer and Index have not been previously evaluated,
+ */
+ return (AE_AML_INTERNAL);
+ }
+
if (rgn_desc->region.length <
(obj_desc->field.offset & ~((u32) field_byte_width - 1)) +
field_byte_width)
@@ -213,7 +223,16 @@ acpi_aml_access_named_field (
actual_byte_length = buffer_length;
if (buffer_length > byte_field_length) {
actual_byte_length = byte_field_length;
+ }
+
+ /* TBD: should these round down to a power of 2? */
+
+ if (DIV_8(bit_granularity) > byte_field_length) {
+ bit_granularity = MUL_8(byte_field_length);
+ }
+ if (byte_granularity > byte_field_length) {
+ byte_granularity = byte_field_length;
}