From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBl0C-0006s3-6U for qemu-devel@nongnu.org; Fri, 07 Feb 2014 07:57:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBl05-0003Ax-EO for qemu-devel@nongnu.org; Fri, 07 Feb 2014 07:57:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBl05-0003At-5U for qemu-devel@nongnu.org; Fri, 07 Feb 2014 07:57:45 -0500 From: Igor Mammedov Date: Fri, 7 Feb 2014 13:51:36 +0100 Message-Id: <1391777496-3882-10-git-send-email-imammedo@redhat.com> In-Reply-To: <1391777496-3882-1-git-send-email-imammedo@redhat.com> References: <1391777496-3882-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [RFC 9/9] acpi: consume PCIHP IO resource in PNP0C02 device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, anthony@codemonkey.ws, mst@redhat.com Signed-off-by: Igor Mammedov --- hw/i386/acpi-build.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) 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 */ + } ); ); ); -- 1.7.1