ACPICA: Resources: Provide common part for struct acpi_resource_address structures.
authorLv Zheng <lv.zheng@intel.com>
Mon, 26 Jan 2015 08:58:56 +0000 (16:58 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 Jan 2015 15:09:56 +0000 (16:09 +0100)
struct acpi_resource_address and struct acpi_resource_extended_address64 share substracts
just at different offsets. To unify the parsing functions, OSPMs like Linux
need a new ACPI_ADDRESS64_ATTRIBUTE as their substructs, so they can
extract the shared data.

This patch also synchronizes the structure changes to the Linux kernel.
The usages are searched by matching the following keywords:
1. acpi_resource_address
2. acpi_resource_extended_address
3. ACPI_RESOURCE_TYPE_ADDRESS
4. ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS
And we found and fixed the usages in the following files:
 arch/ia64/kernel/acpi-ext.c
 arch/ia64/pci/pci.c
 arch/x86/pci/acpi.c
 arch/x86/pci/mmconfig-shared.c
 drivers/xen/xen-acpi-memhotplug.c
 drivers/acpi/acpi_memhotplug.c
 drivers/acpi/pci_root.c
 drivers/acpi/resource.c
 drivers/char/hpet.c
 drivers/pnp/pnpacpi/rsparser.c
 drivers/hv/vmbus_drv.c

Build tests are passed with defconfig/allnoconfig/allyesconfig and
defconfig+CONFIG_ACPI=n.

Original-by: Thomas Gleixner <tglx@linutronix.de>
Original-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
15 files changed:
arch/ia64/kernel/acpi-ext.c
arch/ia64/pci/pci.c
arch/x86/pci/acpi.c
arch/x86/pci/mmconfig-shared.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/acpica/rsaddr.c
drivers/acpi/acpica/rsdumpinfo.c
drivers/acpi/acpica/rsxface.c
drivers/acpi/pci_root.c
drivers/acpi/resource.c
drivers/char/hpet.c
drivers/hv/vmbus_drv.c
drivers/pnp/pnpacpi/rsparser.c
drivers/xen/xen-acpi-memhotplug.c
include/acpi/acrestyp.h

index 8b9318d311a0b81897d9acc84d1a630494de457d..bd09bf74f187b243de3e3bd6fefa214ff551436c 100644 (file)
@@ -69,10 +69,10 @@ static acpi_status find_csr_space(struct acpi_resource *resource, void *data)
        status = acpi_resource_to_address64(resource, &addr);
        if (ACPI_SUCCESS(status) &&
            addr.resource_type == ACPI_MEMORY_RANGE &&
-           addr.address_length &&
+           addr.address.address_length &&
            addr.producer_consumer == ACPI_CONSUMER) {
-               space->base = addr.minimum;
-               space->length = addr.address_length;
+               space->base = addr.address.minimum;
+               space->length = addr.address.address_length;
                return AE_CTRL_TERMINATE;
        }
        return AE_OK;           /* keep looking */
index 291a582777cf3dd0320f4757ea1f9c1fc39dd17c..46920aaa7e9e8b18060713e4e4c78a56c9d69cc7 100644 (file)
@@ -188,12 +188,12 @@ static u64 add_io_space(struct pci_root_info *info,
 
        name = (char *)(iospace + 1);
 
-       min = addr->minimum;
-       max = min + addr->address_length - 1;
+       min = addr->address.minimum;
+       max = min + addr->address.address_length - 1;
        if (addr->info.io.translation_type == ACPI_SPARSE_TRANSLATION)
                sparse = 1;
 
-       space_nr = new_space(addr->translation_offset, sparse);
+       space_nr = new_space(addr->address.translation_offset, sparse);
        if (space_nr == ~0)
                goto free_resource;
 
@@ -247,7 +247,7 @@ static acpi_status resource_to_window(struct acpi_resource *resource,
        if (ACPI_SUCCESS(status) &&
            (addr->resource_type == ACPI_MEMORY_RANGE ||
             addr->resource_type == ACPI_IO_RANGE) &&
-           addr->address_length &&
+           addr->address.address_length &&
            addr->producer_consumer == ACPI_PRODUCER)
                return AE_OK;
 
@@ -284,7 +284,7 @@ static acpi_status add_window(struct acpi_resource *res, void *data)
        if (addr.resource_type == ACPI_MEMORY_RANGE) {
                flags = IORESOURCE_MEM;
                root = &iomem_resource;
-               offset = addr.translation_offset;
+               offset = addr.address.translation_offset;
        } else if (addr.resource_type == ACPI_IO_RANGE) {
                flags = IORESOURCE_IO;
                root = &ioport_resource;
@@ -297,8 +297,8 @@ static acpi_status add_window(struct acpi_resource *res, void *data)
        resource = &info->res[info->res_num];
        resource->name = info->name;
        resource->flags = flags;
-       resource->start = addr.minimum + offset;
-       resource->end = resource->start + addr.address_length - 1;
+       resource->start = addr.address.minimum + offset;
+       resource->end = resource->start + addr.address.address_length - 1;
        info->res_offset[info->res_num] = offset;
 
        if (insert_resource(root, resource)) {
index cfd1b132b8e3ed4023ceecf12dbb68fc35bb68a3..bb98afd0591e7766cf2729065139f3251a60409a 100644 (file)
@@ -231,23 +231,23 @@ static acpi_status resource_to_addr(struct acpi_resource *resource,
        case ACPI_RESOURCE_TYPE_MEMORY24:
                memory24 = &resource->data.memory24;
                addr->resource_type = ACPI_MEMORY_RANGE;
-               addr->minimum = memory24->minimum;
-               addr->address_length = memory24->address_length;
-               addr->maximum = addr->minimum + addr->address_length - 1;
+               addr->address.minimum = memory24->minimum;
+               addr->address.address_length = memory24->address_length;
+               addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
                return AE_OK;
        case ACPI_RESOURCE_TYPE_MEMORY32:
                memory32 = &resource->data.memory32;
                addr->resource_type = ACPI_MEMORY_RANGE;
-               addr->minimum = memory32->minimum;
-               addr->address_length = memory32->address_length;
-               addr->maximum = addr->minimum + addr->address_length - 1;
+               addr->address.minimum = memory32->minimum;
+               addr->address.address_length = memory32->address_length;
+               addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
                return AE_OK;
        case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
                fixed_memory32 = &resource->data.fixed_memory32;
                addr->resource_type = ACPI_MEMORY_RANGE;
-               addr->minimum = fixed_memory32->address;
-               addr->address_length = fixed_memory32->address_length;
-               addr->maximum = addr->minimum + addr->address_length - 1;
+               addr->address.minimum = fixed_memory32->address;
+               addr->address.address_length = fixed_memory32->address_length;
+               addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
                return AE_OK;
        case ACPI_RESOURCE_TYPE_ADDRESS16:
        case ACPI_RESOURCE_TYPE_ADDRESS32:
@@ -256,7 +256,7 @@ static acpi_status resource_to_addr(struct acpi_resource *resource,
                if (ACPI_SUCCESS(status) &&
                    (addr->resource_type == ACPI_MEMORY_RANGE ||
                    addr->resource_type == ACPI_IO_RANGE) &&
-                   addr->address_length > 0) {
+                   addr->address.address_length > 0) {
                        return AE_OK;
                }
                break;
@@ -298,8 +298,8 @@ static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
        } else
                return AE_OK;
 
-       start = addr.minimum + addr.translation_offset;
-       orig_end = end = addr.maximum + addr.translation_offset;
+       start = addr.address.minimum + addr.address.translation_offset;
+       orig_end = end = addr.address.maximum + addr.address.translation_offset;
 
        /* Exclude non-addressable range or non-addressable portion of range */
        end = min(end, (u64)iomem_resource.end);
@@ -320,7 +320,7 @@ static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
        res->flags = flags;
        res->start = start;
        res->end = end;
-       info->res_offset[info->res_num] = addr.translation_offset;
+       info->res_offset[info->res_num] = addr.address.translation_offset;
        info->res_num++;
 
        if (!pci_use_crs)
index 326198a4434e241cd7b50446586f90653931e7dd..5a8dceac309407f84737a2fe275716bb7107fb87 100644 (file)
@@ -397,12 +397,12 @@ static acpi_status check_mcfg_resource(struct acpi_resource *res, void *data)
 
        status = acpi_resource_to_address64(res, &address);
        if (ACPI_FAILURE(status) ||
-          (address.address_length <= 0) ||
+          (address.address.address_length <= 0) ||
           (address.resource_type != ACPI_MEMORY_RANGE))
                return AE_OK;
 
-       if ((mcfg_res->start >= address.minimum) &&
-           (mcfg_res->end < (address.minimum + address.address_length))) {
+       if ((mcfg_res->start >= address.address.minimum) &&
+           (mcfg_res->end < (address.address.minimum + address.address.address_length))) {
                mcfg_res->flags = 1;
                return AE_CTRL_TERMINATE;
        }
index 23e2319ead41c33402c942646c0ba11e35510d96..ee28f4d15625f433a68f0bcfa3dfc6ff521dd388 100644 (file)
@@ -101,8 +101,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
                /* Can we combine the resource range information? */
                if ((info->caching == address64.info.mem.caching) &&
                    (info->write_protect == address64.info.mem.write_protect) &&
-                   (info->start_addr + info->length == address64.minimum)) {
-                       info->length += address64.address_length;
+                   (info->start_addr + info->length == address64.address.minimum)) {
+                       info->length += address64.address.address_length;
                        return AE_OK;
                }
        }
@@ -114,8 +114,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
        INIT_LIST_HEAD(&new->list);
        new->caching = address64.info.mem.caching;
        new->write_protect = address64.info.mem.write_protect;
-       new->start_addr = address64.minimum;
-       new->length = address64.address_length;
+       new->start_addr = address64.address.minimum;
+       new->length = address64.address.address_length;
        list_add_tail(&new->list, &mem_device->res_list);
 
        return AE_OK;
index 916fd095ff342b53a11b0c57d16110bd5f108889..94a3a057042c009c514df98e98ec49631e85be3d 100644 (file)
@@ -74,7 +74,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address16[5] = {
         * Address Translation Offset
         * Address Length
         */
-       {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.granularity),
+       {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.address.granularity),
         AML_OFFSET(address16.granularity),
         5},
 
@@ -112,7 +112,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address32[5] = {
         * Address Translation Offset
         * Address Length
         */
-       {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.granularity),
+       {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.address.granularity),
         AML_OFFSET(address32.granularity),
         5},
 
@@ -150,7 +150,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address64[5] = {
         * Address Translation Offset
         * Address Length
         */
-       {ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.granularity),
+       {ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.address.granularity),
         AML_OFFSET(address64.granularity),
         5},
 
@@ -194,7 +194,8 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = {
         * Address Length
         * Type-Specific Attribute
         */
-       {ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.ext_address64.granularity),
+       {ACPI_RSC_MOVE64,
+        ACPI_RS_OFFSET(data.ext_address64.address.granularity),
         AML_OFFSET(ext_address64.granularity),
         6}
 };
index 2f9332d5c973047c2e9362bfd921a1d2aafb9514..6ba7ad5faa9cf7f43268f44709875d5472e90b85 100644 (file)
@@ -183,15 +183,15 @@ struct acpi_rsdump_info acpi_rs_dump_address16[8] = {
        {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16),
         "16-Bit WORD Address Space", NULL},
        {ACPI_RSD_ADDRESS, 0, NULL, NULL},
-       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.granularity), "Granularity",
-        NULL},
-       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.minimum), "Address Minimum",
-        NULL},
-       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.maximum), "Address Maximum",
-        NULL},
-       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.translation_offset),
+       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.granularity),
+        "Granularity", NULL},
+       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.minimum),
+        "Address Minimum", NULL},
+       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.maximum),
+        "Address Maximum", NULL},
+       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.translation_offset),
         "Translation Offset", NULL},
-       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address_length),
+       {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.address_length),
         "Address Length", NULL},
        {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address16.resource_source), NULL, NULL}
 };
@@ -200,15 +200,15 @@ struct acpi_rsdump_info acpi_rs_dump_address32[8] = {
        {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32),
         "32-Bit DWORD Address Space", NULL},
        {ACPI_RSD_ADDRESS, 0, NULL, NULL},
-       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.granularity), "Granularity",
-        NULL},
-       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.minimum), "Address Minimum",
-        NULL},
-       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.maximum), "Address Maximum",
-        NULL},
-       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.translation_offset),
+       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.granularity),
+        "Granularity", NULL},
+       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.minimum),
+        "Address Minimum", NULL},
+       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.maximum),
+        "Address Maximum", NULL},
+       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.translation_offset),
         "Translation Offset", NULL},
-       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address_length),
+       {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.address_length),
         "Address Length", NULL},
        {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address32.resource_source), NULL, NULL}
 };
@@ -217,15 +217,15 @@ struct acpi_rsdump_info acpi_rs_dump_address64[8] = {
        {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64),
         "64-Bit QWORD Address Space", NULL},
        {ACPI_RSD_ADDRESS, 0, NULL, NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.granularity), "Granularity",
-        NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.minimum), "Address Minimum",
-        NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.maximum), "Address Maximum",
-        NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.translation_offset),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.granularity),
+        "Granularity", NULL},
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.minimum),
+        "Address Minimum", NULL},
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.maximum),
+        "Address Maximum", NULL},
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.translation_offset),
         "Translation Offset", NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address_length),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.address_length),
         "Address Length", NULL},
        {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address64.resource_source), NULL, NULL}
 };
@@ -234,15 +234,16 @@ struct acpi_rsdump_info acpi_rs_dump_ext_address64[8] = {
        {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64),
         "64-Bit Extended Address Space", NULL},
        {ACPI_RSD_ADDRESS, 0, NULL, NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.granularity),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.granularity),
         "Granularity", NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.minimum),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.minimum),
         "Address Minimum", NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.maximum),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.maximum),
         "Address Maximum", NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.translation_offset),
+       {ACPI_RSD_UINT64,
+        ACPI_RSD_OFFSET(ext_address64.address.translation_offset),
         "Translation Offset", NULL},
-       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address_length),
+       {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.address_length),
         "Address Length", NULL},
        {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.type_specific),
         "Type-Specific Attribute", NULL}
index 877ab9202133fd76c65a003daf7592e2486cfb38..29528789117474142c4a4ba23fc40435c91f6984 100644 (file)
@@ -60,11 +60,11 @@ ACPI_MODULE_NAME("rsxface")
        ACPI_COPY_FIELD(out, in, min_address_fixed);         \
        ACPI_COPY_FIELD(out, in, max_address_fixed);         \
        ACPI_COPY_FIELD(out, in, info);                      \
-       ACPI_COPY_FIELD(out, in, granularity);               \
-       ACPI_COPY_FIELD(out, in, minimum);                   \
-       ACPI_COPY_FIELD(out, in, maximum);                   \
-       ACPI_COPY_FIELD(out, in, translation_offset);        \
-       ACPI_COPY_FIELD(out, in, address_length);            \
+       ACPI_COPY_FIELD(out, in, address.granularity);       \
+       ACPI_COPY_FIELD(out, in, address.minimum);           \
+       ACPI_COPY_FIELD(out, in, address.maximum);           \
+       ACPI_COPY_FIELD(out, in, address.translation_offset); \
+       ACPI_COPY_FIELD(out, in, address.address_length);    \
        ACPI_COPY_FIELD(out, in, resource_source);
 /* Local prototypes */
 static acpi_status
index c6bcb8c719d83ab463fa114b9712cd9d9a456fe2..e53e0f6592045516b8af9165f238986772e3bc96 100644 (file)
@@ -112,10 +112,10 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
        if (ACPI_FAILURE(status))
                return AE_OK;
 
-       if ((address.address_length > 0) &&
+       if ((address.address.address_length > 0) &&
            (address.resource_type == ACPI_BUS_NUMBER_RANGE)) {
-               res->start = address.minimum;
-               res->end = address.minimum + address.address_length - 1;
+               res->start = address.address.minimum;
+               res->end = address.address.minimum + address.address.address_length - 1;
        }
 
        return AE_OK;
index 782a0d15c25fa7b89900a06a3bb8eb194ddcd032..d0a4d90c6bcc2c7f8841c022d677af56fa933a9a 100644 (file)
@@ -202,22 +202,22 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
        if (ACPI_FAILURE(status))
                return false;
 
-       res->start = addr.minimum;
-       res->end = addr.maximum;
+       res->start = addr.address.minimum;
+       res->end = addr.address.maximum;
        window = addr.producer_consumer == ACPI_PRODUCER;
 
        switch(addr.resource_type) {
        case ACPI_MEMORY_RANGE:
-               len = addr.maximum - addr.minimum + 1;
+               len = addr.address.maximum - addr.address.minimum + 1;
                res->flags = acpi_dev_memresource_flags(len,
                                                addr.info.mem.write_protect,
                                                window);
                break;
        case ACPI_IO_RANGE:
-               io_decode = addr.granularity == 0xfff ?
+               io_decode = addr.address.granularity == 0xfff ?
                                ACPI_DECODE_10 : ACPI_DECODE_16;
-               res->flags = acpi_dev_ioresource_flags(addr.minimum,
-                                                      addr.maximum,
+               res->flags = acpi_dev_ioresource_flags(addr.address.minimum,
+                                                      addr.address.maximum,
                                                       io_decode, window);
                break;
        case ACPI_BUS_NUMBER_RANGE:
@@ -253,22 +253,22 @@ bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares,
 
        ext_addr = &ares->data.ext_address64;
 
-       res->start = ext_addr->minimum;
-       res->end = ext_addr->maximum;
+       res->start = ext_addr->address.minimum;
+       res->end = ext_addr->address.maximum;
        window = ext_addr->producer_consumer == ACPI_PRODUCER;
 
        switch(ext_addr->resource_type) {
        case ACPI_MEMORY_RANGE:
-               len = ext_addr->maximum - ext_addr->minimum + 1;
+               len = ext_addr->address.maximum - ext_addr->address.minimum + 1;
                res->flags = acpi_dev_memresource_flags(len,
                                        ext_addr->info.mem.write_protect,
                                        window);
                break;
        case ACPI_IO_RANGE:
-               io_decode = ext_addr->granularity == 0xfff ?
+               io_decode = ext_addr->address.granularity == 0xfff ?
                                ACPI_DECODE_10 : ACPI_DECODE_16;
-               res->flags = acpi_dev_ioresource_flags(ext_addr->minimum,
-                                                      ext_addr->maximum,
+               res->flags = acpi_dev_ioresource_flags(ext_addr->address.minimum,
+                                                      ext_addr->address.maximum,
                                                       io_decode, window);
                break;
        case ACPI_BUS_NUMBER_RANGE:
index d5d4cd82b9f7dac435af267806ff541777f3ebdb..5c0baa9ffc64f0b3fe4f55663fe473ba6c66d99c 100644 (file)
@@ -976,8 +976,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
        status = acpi_resource_to_address64(res, &addr);
 
        if (ACPI_SUCCESS(status)) {
-               hdp->hd_phys_address = addr.minimum;
-               hdp->hd_address = ioremap(addr.minimum, addr.address_length);
+               hdp->hd_phys_address = addr.address.minimum;
+               hdp->hd_address = ioremap(addr.address.minimum, addr.address.address_length);
 
                if (hpet_is_known(hdp)) {
                        iounmap(hdp->hd_address);
index 4d6b26979fbd54e457dfbcea4bfc9a6a26ec846c..bb3725b672cf0d58d4eb9d58efca7f85d8b32ef7 100644 (file)
@@ -861,8 +861,8 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
                break;
 
        case ACPI_RESOURCE_TYPE_ADDRESS64:
-               hyperv_mmio.start = res->data.address64.minimum;
-               hyperv_mmio.end = res->data.address64.maximum;
+               hyperv_mmio.start = res->data.address64.address.minimum;
+               hyperv_mmio.end = res->data.address64.address.maximum;
                break;
        }
 
index 66977ebf13b30cba09b6bb1b7c06eeb07e2e5bd0..2d9bc789af0f8dc1d5f2bf7961f8760800f36f78 100644 (file)
@@ -410,12 +410,12 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
        if (p->resource_type == ACPI_MEMORY_RANGE) {
                if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
                        flags = IORESOURCE_MEM_WRITEABLE;
-               pnp_register_mem_resource(dev, option_flags, p->minimum,
-                                         p->minimum, 0, p->address_length,
+               pnp_register_mem_resource(dev, option_flags, p->address.minimum,
+                                         p->address.minimum, 0, p->address.address_length,
                                          flags);
        } else if (p->resource_type == ACPI_IO_RANGE)
-               pnp_register_port_resource(dev, option_flags, p->minimum,
-                                          p->minimum, 0, p->address_length,
+               pnp_register_port_resource(dev, option_flags, p->address.minimum,
+                                          p->address.minimum, 0, p->address.address_length,
                                           IORESOURCE_IO_FIXED);
 }
 
@@ -429,12 +429,12 @@ static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev,
        if (p->resource_type == ACPI_MEMORY_RANGE) {
                if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
                        flags = IORESOURCE_MEM_WRITEABLE;
-               pnp_register_mem_resource(dev, option_flags, p->minimum,
-                                         p->minimum, 0, p->address_length,
+               pnp_register_mem_resource(dev, option_flags, p->address.minimum,
+                                         p->address.minimum, 0, p->address.address_length,
                                          flags);
        } else if (p->resource_type == ACPI_IO_RANGE)
-               pnp_register_port_resource(dev, option_flags, p->minimum,
-                                          p->minimum, 0, p->address_length,
+               pnp_register_port_resource(dev, option_flags, p->address.minimum,
+                                          p->address.minimum, 0, p->address.address_length,
                                           IORESOURCE_IO_FIXED);
 }
 
index 34e40b733f9a8f27cdfb142f8ce67f081188d63b..4fc886cd5586728629058b6e3b8d7fd611c78b94 100644 (file)
@@ -117,8 +117,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
        list_for_each_entry(info, &mem_device->res_list, list) {
                if ((info->caching == address64.info.mem.caching) &&
                    (info->write_protect == address64.info.mem.write_protect) &&
-                   (info->start_addr + info->length == address64.minimum)) {
-                       info->length += address64.address_length;
+                   (info->start_addr + info->length == address64.address.minimum)) {
+                       info->length += address64.address.address_length;
                        return AE_OK;
                }
        }
@@ -130,8 +130,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
        INIT_LIST_HEAD(&new->list);
        new->caching = address64.info.mem.caching;
        new->write_protect = address64.info.mem.write_protect;
-       new->start_addr = address64.minimum;
-       new->length = address64.address_length;
+       new->start_addr = address64.address.minimum;
+       new->length = address64.address.address_length;
        list_add_tail(&new->list, &mem_device->res_list);
 
        return AE_OK;
index eb760ca0b2e05884745e02e09aec222744829c25..0b75e01212c72fa9da4f4f824f191fb34e4707b3 100644 (file)
@@ -305,43 +305,51 @@ struct acpi_resource_source {
        u8                                      max_address_fixed; \
        union acpi_resource_attribute           info;
 
-struct acpi_resource_address {
-ACPI_RESOURCE_ADDRESS_COMMON};
-
-struct acpi_resource_address16 {
-       ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
+struct acpi_address16_attribute {
+       u16 granularity;
        u16 minimum;
        u16 maximum;
        u16 translation_offset;
        u16 address_length;
-       struct acpi_resource_source resource_source;
 };
 
-struct acpi_resource_address32 {
-       ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
+struct acpi_address32_attribute {
+       u32 granularity;
        u32 minimum;
        u32 maximum;
        u32 translation_offset;
        u32 address_length;
-       struct acpi_resource_source resource_source;
 };
 
-struct acpi_resource_address64 {
-       ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
+struct acpi_address64_attribute {
+       u64 granularity;
        u64 minimum;
        u64 maximum;
        u64 translation_offset;
        u64 address_length;
+};
+
+struct acpi_resource_address {
+ACPI_RESOURCE_ADDRESS_COMMON};
+
+struct acpi_resource_address16 {
+       ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address;
+       struct acpi_resource_source resource_source;
+};
+
+struct acpi_resource_address32 {
+       ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address;
+       struct acpi_resource_source resource_source;
+};
+
+struct acpi_resource_address64 {
+       ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address;
        struct acpi_resource_source resource_source;
 };
 
 struct acpi_resource_extended_address64 {
        ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
-       u64 granularity;
-       u64 minimum;
-       u64 maximum;
-       u64 translation_offset;
-       u64 address_length;
+       struct acpi_address64_attribute address;
        u64 type_specific;
 };