51 #define _COMPONENT ACPI_EXECUTER
57 u32 field_datum_byte_offset,
65 u32 field_datum_byte_offset);
85 u32 field_datum_byte_offset)
105 space_id = rgn_desc->
region.space_id;
111 "Invalid/unknown Address Space ID: 0x%2.2X",
145 #ifdef ACPI_UNDER_DEVELOPMENT
162 if (rgn_desc->
region.length <
163 (obj_desc->common_field.base_byte_offset + field_datum_byte_offset +
164 obj_desc->common_field.access_byte_width)) {
172 obj_desc->common_field.
173 access_byte_width) >=
174 ((acpi_size) obj_desc->common_field.
176 obj_desc->common_field.access_byte_width +
177 field_datum_byte_offset)) {
182 if (rgn_desc->
region.length <
183 obj_desc->common_field.access_byte_width) {
190 "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)",
193 obj_desc->common_field.access_byte_width,
196 rgn_desc->
region.length));
204 "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)",
206 obj_desc->common_field.base_byte_offset,
207 field_datum_byte_offset,
208 obj_desc->common_field.access_byte_width,
210 rgn_desc->
region.length));
250 status = acpi_ex_setup_region(obj_desc, field_datum_byte_offset);
264 obj_desc->
common_field.base_byte_offset + field_datum_byte_offset;
273 " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n",
276 rgn_desc->
region.space_id,
288 function, region_offset,
297 "Region %s (ID=%u) not implemented",
300 rgn_desc->
region.space_id));
303 "Region %s (ID=%u) has no handler",
306 rgn_desc->
region.space_id));
349 "Index value 0x%8.8X%8.8X overflows field width 0x%X",
381 u32 field_datum_byte_offset,
u64 *value,
u32 read_write)
393 value = &local_value;
411 switch (obj_desc->
common.type) {
433 field_datum_byte_offset,
443 field_datum_byte_offset, value,
456 if (acpi_ex_register_overflow(obj_desc->
bank_field.bank_obj,
498 if (acpi_ex_register_overflow(obj_desc->
index_field.index_obj,
506 field_datum_byte_offset += obj_desc->
index_field.value;
509 "Write to Index Register: Value %8.8X\n",
510 field_datum_byte_offset));
514 &field_datum_byte_offset,
515 sizeof(field_datum_byte_offset));
525 "Read from Data Register\n"));
535 "Write to Data Register: Value %8.8X%8.8X\n",
556 "Value Read %8.8X%8.8X, Width %u\n",
562 "Value Written %8.8X%8.8X, Width %u\n",
590 u64 field_value,
u32 field_datum_byte_offset)
600 merged_value = field_value;
617 access_byte_width))) != 0) {
623 acpi_ex_field_datum_io(obj_desc,
624 field_datum_byte_offset,
631 merged_value |= (current_value & ~mask);
639 merged_value |= ~mask;
646 merged_value &=
mask;
652 "Unknown UpdateRule value: 0x%X",
655 AML_FIELD_UPDATE_RULE_MASK)));
661 "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
663 field_datum_byte_offset,
670 status = acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,
697 u32 field_offset = 0;
698 u32 buffer_offset = 0;
699 u32 buffer_tail_bits;
701 u32 field_datum_count;
702 u32 access_bit_width;
712 "Field size %u (bits) is too large for buffer (%u)",
723 if ((obj_desc->
common_field.start_field_bit_offset == 0) &&
724 (obj_desc->
common_field.bit_length == access_bit_width)) {
725 status = acpi_ex_field_datum_io(obj_desc, 0, buffer,
ACPI_READ);
735 access_bit_width =
sizeof(
u64) * 8;
746 start_field_bit_offset,
752 acpi_ex_field_datum_io(obj_desc, field_offset, &raw_datum,
758 raw_datum >> obj_desc->
common_field.start_field_bit_offset;
762 for (i = 1; i < field_datum_count; i++) {
766 field_offset += obj_desc->
common_field.access_byte_width;
767 status = acpi_ex_field_datum_io(obj_desc, field_offset,
781 if (access_bit_width -
785 raw_datum << (access_bit_width -
787 start_field_bit_offset);
790 if (i == datum_count) {
796 ACPI_MEMCPY(((
char *)buffer) + buffer_offset, &merged_datum,
798 buffer_length - buffer_offset));
800 buffer_offset += obj_desc->
common_field.access_byte_width;
802 raw_datum >> obj_desc->
common_field.start_field_bit_offset;
807 buffer_tail_bits = obj_desc->
common_field.bit_length % access_bit_width;
808 if (buffer_tail_bits) {
814 ACPI_MEMCPY(((
char *)buffer) + buffer_offset, &merged_datum,
816 buffer_length - buffer_offset));
845 u32 field_offset = 0;
846 u32 buffer_offset = 0;
847 u32 buffer_tail_bits;
849 u32 field_datum_count;
850 u32 access_bit_width;
867 if (buffer_length < required_length) {
881 ACPI_MEMCPY((
char *)new_buffer, (
char *)buffer, buffer_length);
883 buffer_length = required_length;
916 start_field_bit_offset,
923 buffer_length - buffer_offset));
926 raw_datum << obj_desc->
common_field.start_field_bit_offset;
930 for (i = 1; i < field_datum_count; i++) {
934 merged_datum &=
mask;
942 field_offset += obj_desc->
common_field.access_byte_width;
953 if ((access_bit_width -
957 raw_datum >> (access_bit_width -
959 start_field_bit_offset);
966 if (i == datum_count) {
972 buffer_offset += obj_desc->
common_field.access_byte_width;
973 ACPI_MEMCPY(&raw_datum, ((
char *)buffer) + buffer_offset,
975 buffer_length - buffer_offset));
978 raw_datum << obj_desc->
common_field.start_field_bit_offset;
986 if (buffer_tail_bits) {
992 merged_datum &=
mask;