aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-01-26 03:58:56 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-26 10:09:56 -0500
commita45de93eb10ae44446aec2c73d722562ab46092a (patch)
treedf3cdda47c765c1273c5eb4241d8f3c17b4c215b /include/acpi
parente044d8f92f79db167bb7f9dfd0f317e3238d82d1 (diff)
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 'include/acpi')
-rw-r--r--include/acpi/acrestyp.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index eb760ca0b2e0..0b75e01212c7 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -305,43 +305,51 @@ struct acpi_resource_source {
305 u8 max_address_fixed; \ 305 u8 max_address_fixed; \
306 union acpi_resource_attribute info; 306 union acpi_resource_attribute info;
307 307
308struct acpi_resource_address { 308struct acpi_address16_attribute {
309ACPI_RESOURCE_ADDRESS_COMMON}; 309 u16 granularity;
310
311struct acpi_resource_address16 {
312 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
313 u16 minimum; 310 u16 minimum;
314 u16 maximum; 311 u16 maximum;
315 u16 translation_offset; 312 u16 translation_offset;
316 u16 address_length; 313 u16 address_length;
317 struct acpi_resource_source resource_source;
318}; 314};
319 315
320struct acpi_resource_address32 { 316struct acpi_address32_attribute {
321 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 317 u32 granularity;
322 u32 minimum; 318 u32 minimum;
323 u32 maximum; 319 u32 maximum;
324 u32 translation_offset; 320 u32 translation_offset;
325 u32 address_length; 321 u32 address_length;
326 struct acpi_resource_source resource_source;
327}; 322};
328 323
329struct acpi_resource_address64 { 324struct acpi_address64_attribute {
330 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; 325 u64 granularity;
331 u64 minimum; 326 u64 minimum;
332 u64 maximum; 327 u64 maximum;
333 u64 translation_offset; 328 u64 translation_offset;
334 u64 address_length; 329 u64 address_length;
330};
331
332struct acpi_resource_address {
333ACPI_RESOURCE_ADDRESS_COMMON};
334
335struct acpi_resource_address16 {
336 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address;
337 struct acpi_resource_source resource_source;
338};
339
340struct acpi_resource_address32 {
341 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address;
342 struct acpi_resource_source resource_source;
343};
344
345struct acpi_resource_address64 {
346 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address;
335 struct acpi_resource_source resource_source; 347 struct acpi_resource_source resource_source;
336}; 348};
337 349
338struct acpi_resource_extended_address64 { 350struct acpi_resource_extended_address64 {
339 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID; 351 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
340 u64 granularity; 352 struct acpi_address64_attribute address;
341 u64 minimum;
342 u64 maximum;
343 u64 translation_offset;
344 u64 address_length;
345 u64 type_specific; 353 u64 type_specific;
346}; 354};
347 355