patch-2.4.0-prerelease linux/drivers/acpi/interpreter/amprep.c

Next file: linux/drivers/acpi/interpreter/amregion.c
Previous file: linux/drivers/acpi/interpreter/amnames.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test12/linux/drivers/acpi/interpreter/amprep.c linux/drivers/acpi/interpreter/amprep.c
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Module Name: amprep - ACPI AML (p-code) execution - field prep utilities
- *              $Revision: 67 $
+ *              $Revision: 72 $
  *
  *****************************************************************************/
 
@@ -48,15 +48,27 @@
  *
  ******************************************************************************/
 
-u32
+static u32
 acpi_aml_decode_field_access_type (
-	u32                     access)
+	u32                     access,
+	u16                     length)
 {
 
 	switch (access)
 	{
 	case ACCESS_ANY_ACC:
-		return (8);
+		if (length <= 8) {
+			return (8);
+		}
+		else if (length <= 16) {
+			return (16);
+		}
+		else if (length <= 32) {
+			return (32);
+		}
+		else {
+			return (8);
+		}
 		break;
 
 	case ACCESS_BYTE_ACC:
@@ -97,7 +109,7 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+static ACPI_STATUS
 acpi_aml_prep_common_field_object (
 	ACPI_OPERAND_OBJECT     *obj_desc,
 	u8                      field_flags,
@@ -131,7 +143,7 @@
 
 	/* Decode the access type so we can compute offsets */
 
-	granularity = acpi_aml_decode_field_access_type (obj_desc->field.access);
+	granularity = acpi_aml_decode_field_access_type (obj_desc->field.access, obj_desc->field.length);
 	if (!granularity) {
 		return (AE_AML_OPERAND_VALUE);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)