aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/exprep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/exprep.c')
-rw-r--r--drivers/acpi/acpica/exprep.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index 4c2836dc825b..1f111cc94c00 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities 3 * Module Name: exprep - ACPI AML field prep utilities
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -103,8 +103,10 @@ acpi_ex_generate_access(u32 field_bit_offset,
103 /* Round Field start offset and length to "minimal" byte boundaries */ 103 /* Round Field start offset and length to "minimal" byte boundaries */
104 104
105 field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8)); 105 field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8));
106 field_byte_end_offset = ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + 106
107 field_bit_offset, 8)); 107 field_byte_end_offset =
108 ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + field_bit_offset, 8));
109
108 field_byte_length = field_byte_end_offset - field_byte_offset; 110 field_byte_length = field_byte_end_offset - field_byte_offset;
109 111
110 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 112 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -159,7 +161,8 @@ acpi_ex_generate_access(u32 field_bit_offset,
159 161
160 if (accesses <= 1) { 162 if (accesses <= 1) {
161 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 163 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
162 "Entire field can be accessed with one operation of size %u\n", 164 "Entire field can be accessed "
165 "with one operation of size %u\n",
163 access_byte_width)); 166 access_byte_width));
164 return_VALUE(access_byte_width); 167 return_VALUE(access_byte_width);
165 } 168 }
@@ -202,6 +205,7 @@ acpi_ex_generate_access(u32 field_bit_offset,
202 */ 205 */
203 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 206 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
204 "Cannot access field in one operation, using width 8\n")); 207 "Cannot access field in one operation, using width 8\n"));
208
205 return_VALUE(8); 209 return_VALUE(8);
206} 210}
207#endif /* ACPI_UNDER_DEVELOPMENT */ 211#endif /* ACPI_UNDER_DEVELOPMENT */
@@ -281,6 +285,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
281 /* Invalid field access type */ 285 /* Invalid field access type */
282 286
283 ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access)); 287 ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
288
284 return_UINT32(0); 289 return_UINT32(0);
285 } 290 }
286 291
@@ -354,8 +359,8 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
354 * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is 359 * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
355 * the same (equivalent) as the byte_alignment. 360 * the same (equivalent) as the byte_alignment.
356 */ 361 */
357 access_bit_width = acpi_ex_decode_field_access(obj_desc, field_flags, 362 access_bit_width =
358 &byte_alignment); 363 acpi_ex_decode_field_access(obj_desc, field_flags, &byte_alignment);
359 if (!access_bit_width) { 364 if (!access_bit_width) {
360 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 365 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
361 } 366 }
@@ -595,7 +600,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
595 access_byte_width); 600 access_byte_width);
596 601
597 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 602 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
598 "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n", 603 "IndexField: BitOff %X, Off %X, Value %X, "
604 "Gran %X, Index %p, Data %p\n",
599 obj_desc->index_field.start_field_bit_offset, 605 obj_desc->index_field.start_field_bit_offset,
600 obj_desc->index_field.base_byte_offset, 606 obj_desc->index_field.base_byte_offset,
601 obj_desc->index_field.value, 607 obj_desc->index_field.value,
@@ -615,8 +621,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
615 * Store the constructed descriptor (obj_desc) into the parent Node, 621 * Store the constructed descriptor (obj_desc) into the parent Node,
616 * preserving the current type of that named_obj. 622 * preserving the current type of that named_obj.
617 */ 623 */
618 status = acpi_ns_attach_object(info->field_node, obj_desc, 624 status =
619 acpi_ns_get_type(info->field_node)); 625 acpi_ns_attach_object(info->field_node, obj_desc,
626 acpi_ns_get_type(info->field_node));
620 627
621 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 628 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
622 "Set NamedObj %p [%4.4s], ObjDesc %p\n", 629 "Set NamedObj %p [%4.4s], ObjDesc %p\n",