From patchwork Sat Jan 9 21:41:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 565254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A5EB21401DE for ; Sun, 10 Jan 2016 08:52:45 +1100 (AEDT) Received: from localhost ([::1]:43340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aI1RD-0007d2-Mt for incoming@patchwork.ozlabs.org; Sat, 09 Jan 2016 16:52:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aI1G5-0001Q3-4j for qemu-devel@nongnu.org; Sat, 09 Jan 2016 16:41:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aI1G2-0007IP-Me for qemu-devel@nongnu.org; Sat, 09 Jan 2016 16:41:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aI1G2-0007Hp-H1 for qemu-devel@nongnu.org; Sat, 09 Jan 2016 16:41:10 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 26F468EA37; Sat, 9 Jan 2016 21:41:10 +0000 (UTC) Received: from redhat.com (vpn1-5-155.ams2.redhat.com [10.36.5.155]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u09Lf7uk024395; Sat, 9 Jan 2016 16:41:08 -0500 Date: Sat, 9 Jan 2016 23:41:07 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1452375528-16627-37-git-send-email-mst@redhat.com> References: <1452375528-16627-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1452375528-16627-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Igor Mammedov Subject: [Qemu-devel] [PULL v2 36/59] pc: acpi: piix4: move IQCR() into SSDT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 20 ++++++++++++++++++++ hw/i386/acpi-dsdt.dsl | 11 ----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 799efe5..2f2ff67 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1470,6 +1470,7 @@ static void build_piix4_pci0_int(Aml *table) Aml *dev; Aml *crs; Aml *field; + Aml *if_ctx; Aml *method; uint32_t irqs; Aml *sb_scope = aml_scope("_SB"); @@ -1481,6 +1482,25 @@ static void build_piix4_pci0_int(Aml *table) aml_append(field, aml_named_field("PRQ3", 8)); aml_append(sb_scope, field); + /* _CRS method - get current settings */ + method = aml_method("IQCR", 1, AML_SERIALIZED); + { + crs = aml_resource_template(); + irqs = 0; + aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, + AML_ACTIVE_HIGH, AML_SHARED, &irqs, 1)); + aml_append(method, aml_name_decl("PRR0", crs)); + + aml_append(method, + aml_create_dword_field(aml_name("PRR0"), aml_int(5), "PRRI")); + + if_ctx = aml_if(aml_lless(aml_arg(0), aml_int(0x80))); + aml_append(if_ctx, aml_store(aml_arg(0), aml_name("PRRI"))); + aml_append(method, if_ctx); + aml_append(method, aml_return(aml_name("PRR0"))); + } + aml_append(sb_scope, method); + aml_append(sb_scope, build_link_dev("LNKA", 0, aml_name("PRQ0"))); aml_append(sb_scope, build_link_dev("LNKB", 1, aml_name("PRQ1"))); aml_append(sb_scope, build_link_dev("LNKC", 2, aml_name("PRQ2"))); diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl index b74cffd..1f58ec4 100644 --- a/hw/i386/acpi-dsdt.dsl +++ b/hw/i386/acpi-dsdt.dsl @@ -140,17 +140,6 @@ DefinitionBlock ( } Return (0x0B) } - Method(IQCR, 1, Serialized) { - // _CRS method - get current settings - Name(PRR0, ResourceTemplate() { - Interrupt(, Level, ActiveHigh, Shared) { 0 } - }) - CreateDWordField(PRR0, 0x05, PRRI) - If (LLess(Arg0, 0x80)) { - Store(Arg0, PRRI) - } - Return (PRR0) - } External(LNKA, DeviceObj) External(LNKB, DeviceObj)