diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-01-26 16:58:56 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-26 16:09:56 +0100 |
commit | a45de93eb10ae44446aec2c73d722562ab46092a (patch) | |
tree | df3cdda47c765c1273c5eb4241d8f3c17b4c215b /arch/x86/pci | |
parent | e044d8f92f79db167bb7f9dfd0f317e3238d82d1 (diff) | |
download | linux-a45de93eb10ae44446aec2c73d722562ab46092a.tar.gz linux-a45de93eb10ae44446aec2c73d722562ab46092a.tar.bz2 linux-a45de93eb10ae44446aec2c73d722562ab46092a.zip |
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 <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>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/acpi.c | 26 | ||||
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index cfd1b132b8e3..bb98afd0591e 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -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) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 326198a4434e..5a8dceac3094 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -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; } |