[ACPI] ACPICA 20051021

Implemented support for the EM64T and other x86_64
processors. This essentially entails recognizing
that these processors support non-aligned memory
transfers. Previously, all 64-bit processors were assumed
to lack hardware support for non-aligned transfers.

Completed conversion of the Resource Manager to nearly
full table-driven operation. Specifically, the resource
conversion code (convert AML to internal format and the
reverse) and the debug code to dump internal resource
descriptors are fully table-driven, reducing code and data
size and improving maintainability.

The OSL interfaces for Acquire and Release Lock now use a
64-bit flag word on 64-bit processors instead of a fixed
32-bit word. (Alexey Starikovskiy)

Implemented support within the resource conversion code
for the Type-Specific byte within the various ACPI 3.0
*WordSpace macros.

Fixed some issues within the resource conversion code for
the type-specific flags for both Memory and I/O address
resource descriptors. For Memory, implemented support
for the MTP and TTP flags. For I/O, split the TRS and TTP
flags into two separate fields.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
index 6f48ebf..4ac942b 100644
--- a/drivers/acpi/resources/rsaddr.c
+++ b/drivers/acpi/resources/rsaddr.c
@@ -47,171 +47,295 @@
 #define _COMPONENT          ACPI_RESOURCES
 ACPI_MODULE_NAME("rsaddr")
 
-/* Local prototypes */
-static void
-acpi_rs_decode_general_flags(union acpi_resource_data *resource, u8 flags);
+/*******************************************************************************
+ *
+ * acpi_rs_convert_address16 - All WORD (16-bit) address resources
+ *
+ ******************************************************************************/
+struct acpi_rsconvert_info acpi_rs_convert_address16[5] = {
+	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS16,
+	 ACPI_RS_SIZE(struct acpi_resource_address16),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address16)},
 
-static u8 acpi_rs_encode_general_flags(union acpi_resource_data *resource);
+	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS16,
+	 sizeof(struct aml_resource_address16),
+	 0},
 
-static void
-acpi_rs_decode_specific_flags(union acpi_resource_data *resource, u8 flags);
+	/* Resource Type, General Flags, and Type-Specific Flags */
 
-static u8 acpi_rs_encode_specific_flags(union acpi_resource_data *resource);
+	{ACPI_RSC_ADDRESS, 0, 0, 0},
 
-static void
-acpi_rs_set_address_common(union aml_resource *aml,
-			   struct acpi_resource *resource);
+	/*
+	 * These fields are contiguous in both the source and destination:
+	 * Address Granularity
+	 * Address Range Minimum
+	 * Address Range Maximum
+	 * Address Translation Offset
+	 * Address Length
+	 */
+	{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.granularity),
+	 AML_OFFSET(address16.granularity),
+	 5},
 
-static u8
+	/* Optional resource_source (Index and String) */
+
+	{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address16.resource_source),
+	 0,
+	 sizeof(struct aml_resource_address16)}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_address32 - All DWORD (32-bit) address resources
+ *
+ ******************************************************************************/
+
+struct acpi_rsconvert_info acpi_rs_convert_address32[5] = {
+	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS32,
+	 ACPI_RS_SIZE(struct acpi_resource_address32),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address32)},
+
+	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS32,
+	 sizeof(struct aml_resource_address32),
+	 0},
+
+	/* Resource Type, General Flags, and Type-Specific Flags */
+
+	{ACPI_RSC_ADDRESS, 0, 0, 0},
+
+	/*
+	 * These fields are contiguous in both the source and destination:
+	 * Address Granularity
+	 * Address Range Minimum
+	 * Address Range Maximum
+	 * Address Translation Offset
+	 * Address Length
+	 */
+	{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.granularity),
+	 AML_OFFSET(address32.granularity),
+	 5},
+
+	/* Optional resource_source (Index and String) */
+
+	{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address32.resource_source),
+	 0,
+	 sizeof(struct aml_resource_address32)}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_address64 - All QWORD (64-bit) address resources
+ *
+ ******************************************************************************/
+
+struct acpi_rsconvert_info acpi_rs_convert_address64[5] = {
+	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS64,
+	 ACPI_RS_SIZE(struct acpi_resource_address64),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address64)},
+
+	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS64,
+	 sizeof(struct aml_resource_address64),
+	 0},
+
+	/* Resource Type, General Flags, and Type-Specific Flags */
+
+	{ACPI_RSC_ADDRESS, 0, 0, 0},
+
+	/*
+	 * These fields are contiguous in both the source and destination:
+	 * Address Granularity
+	 * Address Range Minimum
+	 * Address Range Maximum
+	 * Address Translation Offset
+	 * Address Length
+	 */
+	{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.granularity),
+	 AML_OFFSET(address64.granularity),
+	 5},
+
+	/* Optional resource_source (Index and String) */
+
+	{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address64.resource_source),
+	 0,
+	 sizeof(struct aml_resource_address64)}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_ext_address64 - All Extended (64-bit) address resources
+ *
+ ******************************************************************************/
+
+struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = {
+	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64,
+	 ACPI_RS_SIZE(struct acpi_resource_extended_address64),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_address64)},
+
+	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64,
+	 sizeof(struct aml_resource_extended_address64),
+	 0},
+
+	/* Resource Type, General Flags, and Type-Specific Flags */
+
+	{ACPI_RSC_ADDRESS, 0, 0, 0},
+
+	/* Revision ID */
+
+	{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_iD),
+	 AML_OFFSET(ext_address64.revision_iD),
+	 1},
+	/*
+	 * These fields are contiguous in both the source and destination:
+	 * Address Granularity
+	 * Address Range Minimum
+	 * Address Range Maximum
+	 * Address Translation Offset
+	 * Address Length
+	 * Type-Specific Attribute
+	 */
+	{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.ext_address64.granularity),
+	 AML_OFFSET(ext_address64.granularity),
+	 6}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_general_flags - Flags common to all address descriptors
+ *
+ ******************************************************************************/
+
+static struct acpi_rsconvert_info acpi_rs_convert_general_flags[6] = {
+	{ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.flags),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_general_flags)},
+
+	/* Resource Type (Memory, Io, bus_number, etc.) */
+
+	{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.address.resource_type),
+	 AML_OFFSET(address.resource_type),
+	 1},
+
+	/* General Flags - Consume, Decode, min_fixed, max_fixed */
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer),
+	 AML_OFFSET(address.flags),
+	 0},
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.decode),
+	 AML_OFFSET(address.flags),
+	 1},
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.min_address_fixed),
+	 AML_OFFSET(address.flags),
+	 2},
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.max_address_fixed),
+	 AML_OFFSET(address.flags),
+	 3}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_mem_flags - Flags common to Memory address descriptors
+ *
+ ******************************************************************************/
+
+static struct acpi_rsconvert_info acpi_rs_convert_mem_flags[5] = {
+	{ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.specific_flags),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_mem_flags)},
+
+	/* Memory-specific flags */
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.write_protect),
+	 AML_OFFSET(address.specific_flags),
+	 0},
+
+	{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.caching),
+	 AML_OFFSET(address.specific_flags),
+	 1},
+
+	{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.range_type),
+	 AML_OFFSET(address.specific_flags),
+	 3},
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.translation),
+	 AML_OFFSET(address.specific_flags),
+	 5}
+};
+
+/*******************************************************************************
+ *
+ * acpi_rs_convert_io_flags - Flags common to I/O address descriptors
+ *
+ ******************************************************************************/
+
+static struct acpi_rsconvert_info acpi_rs_convert_io_flags[4] = {
+	{ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.specific_flags),
+	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_io_flags)},
+
+	/* I/O-specific flags */
+
+	{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.io.range_type),
+	 AML_OFFSET(address.specific_flags),
+	 0},
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.io.translation),
+	 AML_OFFSET(address.specific_flags),
+	 4},
+
+	{ACPI_RSC_1BITFLAG,
+	 ACPI_RS_OFFSET(data.address.info.io.translation_type),
+	 AML_OFFSET(address.specific_flags),
+	 5}
+};
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_rs_get_address_common
+ *
+ * PARAMETERS:  Resource            - Pointer to the internal resource struct
+ *              Aml                 - Pointer to the AML resource descriptor
+ *
+ * RETURN:      TRUE if the resource_type field is OK, FALSE otherwise
+ *
+ * DESCRIPTION: Convert common flag fields from a raw AML resource descriptor
+ *              to an internal resource descriptor
+ *
+ ******************************************************************************/
+
+u8
 acpi_rs_get_address_common(struct acpi_resource *resource,
-			   union aml_resource *aml);
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_decode_general_flags
- *
- * PARAMETERS:  Resource            - Address resource data struct
- *              Flags               - Raw AML flag byte
- *
- * RETURN:      Decoded flag bits in resource struct
- *
- * DESCRIPTION: Decode a general flag byte to an address resource struct
- *
- ******************************************************************************/
-
-static void
-acpi_rs_decode_general_flags(union acpi_resource_data *resource, u8 flags)
+			   union aml_resource *aml)
 {
 	ACPI_FUNCTION_ENTRY();
 
-	/* Producer / Consumer - flag bit[0] */
+	/* Validate the Resource Type */
 
-	resource->address.producer_consumer = (u32) (flags & 0x01);
-
-	/* Decode (_DEC) - flag bit[1] */
-
-	resource->address.decode = (u32) ((flags >> 1) & 0x01);
-
-	/* Min Address Fixed (_MIF) - flag bit[2] */
-
-	resource->address.min_address_fixed = (u32) ((flags >> 2) & 0x01);
-
-	/* Max Address Fixed (_MAF) - flag bit[3] */
-
-	resource->address.max_address_fixed = (u32) ((flags >> 3) & 0x01);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_encode_general_flags
- *
- * PARAMETERS:  Resource            - Address resource data struct
- *
- * RETURN:      Encoded general flag byte
- *
- * DESCRIPTION: Construct a general flag byte from an address resource struct
- *
- ******************************************************************************/
-
-static u8 acpi_rs_encode_general_flags(union acpi_resource_data *resource)
-{
-	ACPI_FUNCTION_ENTRY();
-
-	return ((u8)
-
-		/* Producer / Consumer - flag bit[0] */
-		((resource->address.producer_consumer & 0x01) |
-		 /* Decode (_DEC) - flag bit[1] */
-		 ((resource->address.decode & 0x01) << 1) |
-		 /* Min Address Fixed (_MIF) - flag bit[2] */
-		 ((resource->address.min_address_fixed & 0x01) << 2) |
-		 /* Max Address Fixed (_MAF) - flag bit[3] */
-		 ((resource->address.max_address_fixed & 0x01) << 3))
-	    );
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_decode_specific_flags
- *
- * PARAMETERS:  Resource            - Address resource data struct
- *              Flags               - Raw AML flag byte
- *
- * RETURN:      Decoded flag bits in attribute struct
- *
- * DESCRIPTION: Decode a type-specific flag byte to an attribute struct.
- *              Type-specific flags are only defined for the Memory and IO
- *              resource types.
- *
- ******************************************************************************/
-
-static void
-acpi_rs_decode_specific_flags(union acpi_resource_data *resource, u8 flags)
-{
-	ACPI_FUNCTION_ENTRY();
-
-	if (resource->address.resource_type == ACPI_MEMORY_RANGE) {
-		/* Write Status (_RW) - flag bit[0] */
-
-		resource->address.attribute.memory.read_write_attribute =
-		    (u16) (flags & 0x01);
-
-		/* Memory Attributes (_MEM) - flag bits[2:1] */
-
-		resource->address.attribute.memory.cache_attribute =
-		    (u16) ((flags >> 1) & 0x03);
-	} else if (resource->address.resource_type == ACPI_IO_RANGE) {
-		/* Ranges (_RNG) - flag bits[1:0] */
-
-		resource->address.attribute.io.range_attribute =
-		    (u16) (flags & 0x03);
-
-		/* Translations (_TTP and _TRS) - flag bits[5:4] */
-
-		resource->address.attribute.io.translation_attribute =
-		    (u16) ((flags >> 4) & 0x03);
-	}
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_encode_specific_flags
- *
- * PARAMETERS:  Resource            - Address resource data struct
- *
- * RETURN:      Encoded type-specific flag byte
- *
- * DESCRIPTION: Construct a type-specific flag byte from an attribute struct.
- *              Type-specific flags are only defined for the Memory and IO
- *              resource types.
- *
- ******************************************************************************/
-
-static u8 acpi_rs_encode_specific_flags(union acpi_resource_data *resource)
-{
-	ACPI_FUNCTION_ENTRY();
-
-	if (resource->address.resource_type == ACPI_MEMORY_RANGE) {
-		return ((u8)
-
-			/* Write Status (_RW) - flag bit[0] */
-			((resource->address.attribute.memory.
-			  read_write_attribute & 0x01) |
-			 /* Memory Attributes (_MEM) - flag bits[2:1] */
-			 ((resource->address.attribute.memory.
-			   cache_attribute & 0x03) << 1)));
-	} else if (resource->address.resource_type == ACPI_IO_RANGE) {
-		return ((u8)
-
-			/* Ranges (_RNG) - flag bits[1:0] */
-			((resource->address.attribute.io.
-			  range_attribute & 0x03) |
-			 /* Translations (_TTP and _TRS) - flag bits[5:4] */
-			 ((resource->address.attribute.io.
-			   translation_attribute & 0x03) << 4)));
+	if ((aml->address.resource_type > 2)
+	    && (aml->address.resource_type < 0xC0)) {
+		return (FALSE);
 	}
 
-	return (0);
+	/* Get the Resource Type and General Flags */
+
+	(void)acpi_rs_convert_aml_to_resource(resource, aml,
+					      acpi_rs_convert_general_flags);
+
+	/* Get the Type-Specific Flags (Memory and I/O descriptors only) */
+
+	if (resource->data.address.resource_type == ACPI_MEMORY_RANGE) {
+		(void)acpi_rs_convert_aml_to_resource(resource, aml,
+						      acpi_rs_convert_mem_flags);
+	} else if (resource->data.address.resource_type == ACPI_IO_RANGE) {
+		(void)acpi_rs_convert_aml_to_resource(resource, aml,
+						      acpi_rs_convert_io_flags);
+	} else {
+		/* Generic resource type, just grab the type_specific byte */
+
+		resource->data.address.info.type_specific =
+		    aml->address.specific_flags;
+	}
+
+	return (TRUE);
 }
 
 /*******************************************************************************
@@ -228,502 +352,29 @@
  *
  ******************************************************************************/
 
-static void
+void
 acpi_rs_set_address_common(union aml_resource *aml,
 			   struct acpi_resource *resource)
 {
 	ACPI_FUNCTION_ENTRY();
 
-	/* Set the Resource Type (Memory, Io, bus_number, etc.) */
+	/* Set the Resource Type and General Flags */
 
-	aml->address.resource_type = (u8) resource->data.address.resource_type;
+	(void)acpi_rs_convert_resource_to_aml(resource, aml,
+					      acpi_rs_convert_general_flags);
 
-	/* Set the general flags */
+	/* Set the Type-Specific Flags (Memory and I/O descriptors only) */
 
-	aml->address.flags = acpi_rs_encode_general_flags(&resource->data);
+	if (resource->data.address.resource_type == ACPI_MEMORY_RANGE) {
+		(void)acpi_rs_convert_resource_to_aml(resource, aml,
+						      acpi_rs_convert_mem_flags);
+	} else if (resource->data.address.resource_type == ACPI_IO_RANGE) {
+		(void)acpi_rs_convert_resource_to_aml(resource, aml,
+						      acpi_rs_convert_io_flags);
+	} else {
+		/* Generic resource type, just copy the type_specific byte */
 
-	/* Set the type-specific flags */
-
-	aml->address.specific_flags =
-	    acpi_rs_encode_specific_flags(&resource->data);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_get_address_common
- *
- * PARAMETERS:  Resource            - Pointer to the internal resource struct
- *              Aml                 - Pointer to the AML resource descriptor
- *
- * RETURN:      TRUE if the resource_type field is OK, FALSE otherwise
- *
- * DESCRIPTION: Convert common flag fields from a raw AML resource descriptor
- *              to an internal resource descriptor
- *
- ******************************************************************************/
-
-static u8
-acpi_rs_get_address_common(struct acpi_resource *resource,
-			   union aml_resource *aml)
-{
-	ACPI_FUNCTION_ENTRY();
-
-	/* Validate resource type */
-
-	if ((aml->address.resource_type > 2)
-	    && (aml->address.resource_type < 0xC0)) {
-		return (FALSE);
+		aml->address.specific_flags =
+		    resource->data.address.info.type_specific;
 	}
-
-	/* Get the Resource Type (Memory, Io, bus_number, etc.) */
-
-	resource->data.address.resource_type = aml->address.resource_type;
-
-	/* Get the General Flags */
-
-	acpi_rs_decode_general_flags(&resource->data, aml->address.flags);
-
-	/* Get the Type-Specific Flags */
-
-	acpi_rs_decode_specific_flags(&resource->data,
-				      aml->address.specific_flags);
-	return (TRUE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_get_address16
- *
- * PARAMETERS:  Aml                 - Pointer to the AML resource descriptor
- *              aml_resource_length - Length of the resource from the AML header
- *              Resource            - Where the internal resource is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
- *              internal resource descriptor, simplifying bitflags and handling
- *              alignment and endian issues if necessary.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_get_address16(union aml_resource * aml,
-		      u16 aml_resource_length, struct acpi_resource * resource)
-{
-	ACPI_FUNCTION_TRACE("rs_get_address16");
-
-	/* Get the Resource Type, general flags, and type-specific flags */
-
-	if (!acpi_rs_get_address_common(resource, aml)) {
-		return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
-	}
-
-	/*
-	 * Get the following contiguous fields from the AML descriptor:
-	 * Address Granularity
-	 * Address Range Minimum
-	 * Address Range Maximum
-	 * Address Translation Offset
-	 * Address Length
-	 */
-	acpi_rs_move_data(&resource->data.address16.granularity,
-			  &aml->address16.granularity, 5,
-			  ACPI_MOVE_TYPE_16_TO_32);
-
-	/* Get the optional resource_source (index and string) */
-
-	resource->length =
-	    ACPI_SIZEOF_RESOURCE(struct acpi_resource_address16) +
-	    acpi_rs_get_resource_source(aml_resource_length,
-					sizeof(struct aml_resource_address16),
-					&resource->data.address16.
-					resource_source, aml, NULL);
-
-	/* Complete the resource header */
-
-	resource->type = ACPI_RESOURCE_TYPE_ADDRESS16;
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_set_address16
- *
- * PARAMETERS:  Resource            - Pointer to the resource descriptor
- *              Aml                 - Where the AML descriptor is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert an internal resource descriptor to the corresponding
- *              external AML resource descriptor.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml)
-{
-	acpi_size descriptor_length;
-
-	ACPI_FUNCTION_TRACE("rs_set_address16");
-
-	/* Set the Resource Type, General Flags, and Type-Specific Flags */
-
-	acpi_rs_set_address_common(aml, resource);
-
-	/*
-	 * 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->address16.granularity,
-			  &resource->data.address16.granularity, 5,
-			  ACPI_MOVE_TYPE_32_TO_16);
-
-	/* Resource Source Index and Resource Source are optional */
-
-	descriptor_length = acpi_rs_set_resource_source(aml,
-							sizeof(struct
-							       aml_resource_address16),
-							&resource->data.
-							address16.
-							resource_source);
-
-	/* Complete the AML descriptor header */
-
-	acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS16,
-				    descriptor_length, aml);
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_get_address32
- *
- * PARAMETERS:  Aml                 - Pointer to the AML resource descriptor
- *              aml_resource_length - Length of the resource from the AML header
- *              Resource            - Where the internal resource is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
- *              internal resource descriptor, simplifying bitflags and handling
- *              alignment and endian issues if necessary.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_get_address32(union aml_resource *aml,
-		      u16 aml_resource_length, struct acpi_resource *resource)
-{
-
-	ACPI_FUNCTION_TRACE("rs_get_address32");
-
-	/* Get the Resource Type, general flags, and type-specific flags */
-
-	if (!acpi_rs_get_address_common(resource, (void *)aml)) {
-		return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
-	}
-
-	/*
-	 * Get the following contiguous fields from the AML descriptor:
-	 * Address Granularity
-	 * Address Range Minimum
-	 * Address Range Maximum
-	 * Address Translation Offset
-	 * Address Length
-	 */
-	acpi_rs_move_data(&resource->data.address32.granularity,
-			  &aml->address32.granularity, 5,
-			  ACPI_MOVE_TYPE_32_TO_32);
-
-	/* Get the optional resource_source (index and string) */
-
-	resource->length =
-	    ACPI_SIZEOF_RESOURCE(struct acpi_resource_address32) +
-	    acpi_rs_get_resource_source(aml_resource_length,
-					sizeof(struct aml_resource_address32),
-					&resource->data.address32.
-					resource_source, aml, NULL);
-
-	/* Complete the resource header */
-
-	resource->type = ACPI_RESOURCE_TYPE_ADDRESS32;
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_set_address32
- *
- * PARAMETERS:  Resource            - Pointer to the resource descriptor
- *              Aml                 - Where the AML descriptor is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert an internal resource descriptor to the corresponding
- *              external AML resource descriptor.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml)
-{
-	acpi_size descriptor_length;
-
-	ACPI_FUNCTION_TRACE("rs_set_address32");
-
-	/* Set the Resource Type, General Flags, and Type-Specific Flags */
-
-	acpi_rs_set_address_common(aml, resource);
-
-	/*
-	 * 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);
-
-	/* Resource Source Index and Resource Source are optional */
-
-	descriptor_length = acpi_rs_set_resource_source(aml,
-							sizeof(struct
-							       aml_resource_address32),
-							&resource->data.
-							address32.
-							resource_source);
-
-	/* Complete the AML descriptor header */
-
-	acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS32,
-				    descriptor_length, aml);
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_get_address64
- *
- * PARAMETERS:  Aml                 - Pointer to the AML resource descriptor
- *              aml_resource_length - Length of the resource from the AML header
- *              Resource            - Where the internal resource is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
- *              internal resource descriptor, simplifying bitflags and handling
- *              alignment and endian issues if necessary.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_get_address64(union aml_resource *aml,
-		      u16 aml_resource_length, struct acpi_resource *resource)
-{
-	ACPI_FUNCTION_TRACE("rs_get_address64");
-
-	/* Get the Resource Type, general Flags, and type-specific Flags */
-
-	if (!acpi_rs_get_address_common(resource, aml)) {
-		return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
-	}
-
-	/*
-	 * Get the following contiguous fields from the AML descriptor:
-	 * Address Granularity
-	 * Address Range Minimum
-	 * Address Range Maximum
-	 * Address Translation Offset
-	 * Address Length
-	 */
-	acpi_rs_move_data(&resource->data.address64.granularity,
-			  &aml->address64.granularity, 5,
-			  ACPI_MOVE_TYPE_64_TO_64);
-
-	/* Get the optional resource_source (index and string) */
-
-	resource->length =
-	    ACPI_SIZEOF_RESOURCE(struct acpi_resource_address64) +
-	    acpi_rs_get_resource_source(aml_resource_length,
-					sizeof(struct aml_resource_address64),
-					&resource->data.address64.
-					resource_source, aml, NULL);
-
-	/* Complete the resource header */
-
-	resource->type = ACPI_RESOURCE_TYPE_ADDRESS64;
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_set_address64
- *
- * PARAMETERS:  Resource            - Pointer to the resource descriptor
- *              Aml                 - Where the AML descriptor is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert an internal resource descriptor to the corresponding
- *              external AML resource descriptor.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml)
-{
-	acpi_size descriptor_length;
-
-	ACPI_FUNCTION_TRACE("rs_set_address64");
-
-	/* Set the Resource Type, General Flags, and Type-Specific Flags */
-
-	acpi_rs_set_address_common(aml, resource);
-
-	/*
-	 * 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->address64.granularity,
-			  &resource->data.address64.granularity, 5,
-			  ACPI_MOVE_TYPE_64_TO_64);
-
-	/* Resource Source Index and Resource Source are optional */
-
-	descriptor_length = acpi_rs_set_resource_source(aml,
-							sizeof(struct
-							       aml_resource_address64),
-							&resource->data.
-							address64.
-							resource_source);
-
-	/* Complete the AML descriptor header */
-
-	acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS64,
-				    descriptor_length, aml);
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_get_ext_address64
- *
- * PARAMETERS:  Aml                 - Pointer to the AML resource descriptor
- *              aml_resource_length - Length of the resource from the AML header
- *              Resource            - Where the internal resource is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding
- *              internal resource descriptor, simplifying bitflags and handling
- *              alignment and endian issues if necessary.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_get_ext_address64(union aml_resource *aml,
-			  u16 aml_resource_length,
-			  struct acpi_resource *resource)
-{
-
-	ACPI_FUNCTION_TRACE("rs_get_ext_address64");
-
-	/* Get the Resource Type, general flags, and type-specific flags */
-
-	if (!acpi_rs_get_address_common(resource, aml)) {
-		return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
-	}
-
-	/*
-	 * Get and validate the Revision ID
-	 * Note: Only one revision ID is currently supported
-	 */
-	resource->data.ext_address64.revision_iD =
-	    aml->ext_address64.revision_iD;
-	if (aml->ext_address64.revision_iD !=
-	    AML_RESOURCE_EXTENDED_ADDRESS_REVISION) {
-		return_ACPI_STATUS(AE_SUPPORT);
-	}
-
-	/*
-	 * Get the following contiguous fields from the AML descriptor:
-	 * Address Granularity
-	 * Address Range Minimum
-	 * Address Range Maximum
-	 * Address Translation Offset
-	 * Address Length
-	 * Type-Specific Attribute
-	 */
-	acpi_rs_move_data(&resource->data.ext_address64.granularity,
-			  &aml->ext_address64.granularity, 6,
-			  ACPI_MOVE_TYPE_64_TO_64);
-
-	/* Complete the resource header */
-
-	resource->type = ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64;
-	resource->length =
-	    ACPI_SIZEOF_RESOURCE(struct acpi_resource_extended_address64);
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_rs_set_ext_address64
- *
- * PARAMETERS:  Resource            - Pointer to the resource descriptor
- *              Aml                 - Where the AML descriptor is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert an internal resource descriptor to the corresponding
- *              external AML resource descriptor.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_rs_set_ext_address64(struct acpi_resource *resource,
-			  union aml_resource *aml)
-{
-	ACPI_FUNCTION_TRACE("rs_set_ext_address64");
-
-	/* Set the Resource Type, General Flags, and Type-Specific Flags */
-
-	acpi_rs_set_address_common(aml, resource);
-
-	/* Only one Revision ID is currently supported */
-
-	aml->ext_address64.revision_iD = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
-	aml->ext_address64.reserved = 0;
-
-	/*
-	 * Set the following contiguous fields in the AML descriptor:
-	 * Address Granularity
-	 * Address Range Minimum
-	 * Address Range Maximum
-	 * Address Translation Offset
-	 * Address Length
-	 * Type-Specific Attribute
-	 */
-	acpi_rs_move_data(&aml->ext_address64.granularity,
-			  &resource->data.address64.granularity, 6,
-			  ACPI_MOVE_TYPE_64_TO_64);
-
-	/* Complete the AML descriptor header */
-
-	acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64,
-				    sizeof(struct
-					   aml_resource_extended_address64),
-				    aml);
-	return_ACPI_STATUS(AE_OK);
 }