52 #define _COMPONENT ACPI_EXECUTER
58 u8 field_flags,
u32 * return_byte_alignment);
60 #ifdef ACPI_UNDER_DEVELOPMENT
63 acpi_ex_generate_access(
u32 field_bit_offset,
64 u32 field_bit_length,
u32 region_length);
89 acpi_ex_generate_access(
u32 field_bit_offset,
90 u32 field_bit_length,
u32 region_length)
92 u32 field_byte_length;
93 u32 field_byte_offset;
94 u32 field_byte_end_offset;
95 u32 access_byte_width;
96 u32 field_start_offset;
98 u32 minimum_access_width = 0xFFFFFFFF;
99 u32 minimum_accesses = 0xFFFFFFFF;
108 field_bit_offset, 8));
109 field_byte_length = field_byte_end_offset - field_byte_offset;
112 "Bit length %u, Bit offset %u\n",
113 field_bit_length, field_bit_offset));
116 "Byte Length %u, Byte Offset %u, End Offset %u\n",
117 field_byte_length, field_byte_offset,
118 field_byte_end_offset));
126 for (access_byte_width = 1; access_byte_width <= 8;
127 access_byte_width <<= 1) {
135 if (
ACPI_ROUND_UP(field_byte_end_offset, access_byte_width) <=
148 accesses = field_end_offset - field_start_offset;
151 "AccessWidth %u end is within region\n",
155 "Field Start %u, Field End %u -- requires %u accesses\n",
156 field_start_offset, field_end_offset,
163 "Entire field can be accessed with one operation of size %u\n",
172 if (accesses < minimum_accesses) {
173 minimum_accesses = accesses;
174 minimum_access_width = access_byte_width;
178 "AccessWidth %u end is NOT within region\n",
180 if (access_byte_width == 1) {
182 "Field goes beyond end-of-region!\n"));
194 "Backing off to previous optimal access width of %u\n",
195 minimum_access_width));
205 "Cannot access field in one operation, using width 8\n"));
227 u8 field_flags,
u32 * return_byte_alignment)
240 #ifdef ACPI_UNDER_DEVELOPMENT
243 start_field_bit_offset,
248 bit_length = byte_alignment * 8;
292 *return_byte_alignment = byte_alignment;
321 u32 field_bit_position,
u32 field_bit_length)
323 u32 access_bit_width;
325 u32 nearest_byte_address;
353 access_bit_width = acpi_ex_decode_field_access(obj_desc, field_flags,
355 if (!access_bit_width) {
374 nearest_byte_address =
384 (field_bit_position -
408 u32 access_byte_width;
424 "Needed Region, found type 0x%X (%s)", type,
456 obj_desc->
field.region_obj =
474 obj_desc->
field.resource_buffer =
475 second_desc->
buffer.pointer;
476 obj_desc->
field.resource_length =
485 if ((obj_desc->
field.region_obj->region.space_id ==
494 if (access_byte_width < 256) {
496 (
u8)access_byte_width;
504 "RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
505 obj_desc->
field.start_field_bit_offset,
506 obj_desc->
field.base_byte_offset,
507 obj_desc->
field.access_byte_width,
508 obj_desc->
field.region_obj));
525 "Bank Field: BitOff %X, Off %X, Gran %X, Region %p, BankReg %p\n",
528 obj_desc->
field.access_byte_width,
537 second_desc = obj_desc->
common.next_object;
538 second_desc->
extra.aml_start =
541 second_desc->
extra.aml_length =
559 "Null Index Object during field prep"));
592 "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
596 obj_desc->
field.access_byte_width,
614 "Set NamedObj %p [%4.4s], ObjDesc %p\n",