diff mbox

[RFC,9/9] acpi: consume PCIHP IO resource in PNP0C02 device

Message ID 1391777496-3882-10-git-send-email-imammedo@redhat.com
State New
Headers show

Commit Message

Igor Mammedov Feb. 7, 2014, 12:51 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/acpi-build.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5cd0c80..e3d145b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -72,6 +72,8 @@  typedef struct AcpiPmInfo {
     uint32_t io_base;
     uint16_t cpuhp_io_base;
     uint16_t cpuhp_io_len;
+    uint16_t pcihp_io_base;
+    uint16_t pcihp_io_len;
 } AcpiPmInfo;
 
 typedef struct AcpiMiscInfo {
@@ -189,6 +191,19 @@  static void acpi_get_pm_info(AcpiPmInfo *pm)
                                            NULL);
     pm->gpe0_blk_len = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
                                                NULL);
+    {
+        Error  *local_error = NULL;
+        uint16_t val = object_property_get_int(obj, ACPI_PCIHP_IO_ADDR,
+                                               &local_error);
+        if (!local_error) {
+            pm->pcihp_io_base = val;
+        }
+
+        val = object_property_get_int(obj, ACPI_PCIHP_IO_LEN, &local_error);
+        if (!local_error) {
+            pm->pcihp_io_len = val;
+        }
+    }
 }
 
 static void acpi_get_misc_info(AcpiMiscInfo *info)
@@ -1155,6 +1170,13 @@  build_ssdt(GArray *table_data, GArray *linker,
                             pm->cpuhp_io_base, /* _MAX */
                             0x0,               /* _ALN */
                             pm->cpuhp_io_len); /* _LEN */
+                    if (pm->pcihp_io_base) {
+                        ACPI_IO(RESBUF, Decode16,
+                                pm->pcihp_io_base, /* _MIN */
+                                pm->pcihp_io_base, /* _MAX */
+                                0x0,               /* _ALN */
+                                pm->pcihp_io_len); /* _LEN */
+                    }
                 );
             );
         );