- length_field = ACPI_CAST_PTR(u16, buffer);
- buffer += 2;
-
- /* Set the Resource Type (Memory, Io, bus_number) */
-
- *buffer = (u8) (resource->data.address32.resource_type & 0x03);
- buffer += 1;
-
- /* Set the general flags */
-
- *buffer = acpi_rs_encode_general_flags(&resource->data);
- buffer += 1;
-
- /* Set the type specific flags */
-
- *buffer = acpi_rs_encode_specific_flags(&resource->data);
- buffer += 1;
-
- /* Set the address space granularity */
-
- ACPI_MOVE_32_TO_32(buffer, &resource->data.address32.granularity);
- buffer += 4;
-
- /* Set the address range minimum */
-
- ACPI_MOVE_32_TO_32(buffer, &resource->data.address32.min_address_range);
- buffer += 4;
-
- /* Set the address range maximum */
-
- ACPI_MOVE_32_TO_32(buffer, &resource->data.address32.max_address_range);
- buffer += 4;
-
- /* Set the address translation offset */
-
- ACPI_MOVE_32_TO_32(buffer,
- &resource->data.address32.
- address_translation_offset);
- buffer += 4;
-
- /* Set the address length */
-
- ACPI_MOVE_32_TO_32(buffer, &resource->data.address32.address_length);
- buffer += 4;
+ /*
+ * Set the following contiguous fields in the AML descriptor:
+ * Address Granularity
+ * Address Range Minimum
+ * Address Range Maximum
+ * Address Translation Offset
+ * Address Length
+ */
+ acpi_rs_move_data(&aml->address32.granularity,
+ &resource->data.address32.granularity, 5,
+ ACPI_MOVE_TYPE_32_TO_32);