From a45de93eb10ae44446aec2c73d722562ab46092a Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Mon, 26 Jan 2015 16:58:56 +0800 Subject: ACPICA: Resources: Provide common part for struct acpi_resource_address structures. 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 Original-by: Jiang Liu Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/resource.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/acpi/resource.c') diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 782a0d15c25f..d0a4d90c6bcc 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -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: -- cgit v1.2.3