From nobody Wed Feb 11 02:14:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653730973346331.8025234450745; Sat, 28 May 2022 02:42:53 -0700 (PDT) Received: from localhost ([::1]:49348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nusyB-0007T5-Gt for importer@patchew.org; Sat, 28 May 2022 05:42:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuscX-00063Z-BC for qemu-devel@nongnu.org; Sat, 28 May 2022 05:20:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuscU-00040B-Ek for qemu-devel@nongnu.org; Sat, 28 May 2022 05:20:28 -0400 Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nusbJ-0003JL-Ed; Sat, 28 May 2022 10:19:17 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QVxcsu4wbyacSkDWYBZhMl5mHcSEwBD78RWBoSEqoa0=; b=OovF+FrGo0c9/wZGrZtInz9DgV l1pwxmFcw1u2yThnz6r+TdARgwHBJuDrViXihEv4bNtHxmSTP+23EddN+7Lqv348T/7UKpeYWUH0A /equfXfofIKfymvklGJ9FRt2EINIF369yyODlWkz/CFVM7Ssjf9CP/JL3wmFsM3PbSTh1Wb3MmI6f uE4m3Q0trx+41Xvbm8ohZC0wVEUohrWW0mi/zyY6yceusMwLGdTTq6sJHwFgzDMbrEBLoSx6cWrvb hMeHi09QGRYBD42NKL9pEAp/4a3zC/6MlfrXlqkO80m2D617gq1dwMAUL1OfvKa7yoqWxN4/X876A qdp4XMTCiG05V8IWaYRQPGnvuE0QrJ8KkI45PD6GvaETUzG8Mvmuao7YzYYDwrZdXfhCfJofwcXCC QtCO5lTj5pfX8IY7bwN9tIRV8il/aRBkwlfvZUoHGWh1OeA0mJ6GZIv1/z9sydR/2xvMHevbasIzp 1Bu53ktLr7kYKH0TSsM77gqi+8TFtrmWHC7FfoRyG52uYOeWWkiiWA+iTl/uUkG5K1TyAIBhix4i6 DvcoLD6g5fIwA2OGUj4NzcpY07GWO6JHLbEQNRlxA2pAF10R3Y0IBZNBeuoDlOU+JI3p7aKHEK1EK FIDXp2SnbqnfFUkVh82Q/9sBO4+Y9bE1/NpdRCUWI=; From: Mark Cave-Ayland To: shentey@gmail.com, mst@redhat.com, marcel.apfelbaum@gmail.com, imammedo@redhat.com, ani@anisinha.ca, f4bug@amsat.org, aurelien@aurel32.net, pbonzini@redhat.com, richard.henderson@linaro.org, eduardo@habkost.net, hpoussin@reactos.org, qemu-devel@nongnu.org Date: Sat, 28 May 2022 10:19:33 +0100 Message-Id: <20220528091934.15520-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220528091934.15520-1-mark.cave-ayland@ilande.co.uk> References: <20220528091934.15520-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 11/12] hw/isa/piix4.c: create PIIX4_PM device directly instead of using piix4_pm_initfn() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1653730974490100001 Content-Type: text/plain; charset="utf-8" Now that all external logic has been removed from piix4_pm_initfn() the PII= X4_PM device can be instantiated directly. Signed-off-by: Mark Cave-Ayland --- hw/isa/piix4.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 775e15eb20..9a6d981037 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -34,6 +34,7 @@ #include "hw/timer/i8254.h" #include "hw/rtc/mc146818rtc.h" #include "hw/ide/pci.h" +#include "hw/acpi/piix4.h" #include "migration/vmstate.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" @@ -293,7 +294,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int ir= q_num) DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbu= s) { PIIX4State *s; - PIIX4PMState *pms; PCIDevice *pci; DeviceState *dev; int devfn =3D PCI_DEVFN(10, 0); @@ -311,10 +311,13 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **i= sa_bus, I2CBus **smbus) =20 pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci"); if (smbus) { - pms =3D piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, 0); - qdev_connect_gpio_out(DEVICE(pms), 0, + pci =3D pci_new(devfn + 3, TYPE_PIIX4_PM); + qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100); + qdev_prop_set_bit(DEVICE(pci), "smm-enabled", 0); + pci_realize_and_unref(pci, pci_bus, &error_fatal); + qdev_connect_gpio_out(DEVICE(pci), 0, qdev_get_gpio_in_named(dev, "isa", 9)); - *smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c")); + *smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c")); } =20 pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PI= RQS); --=20 2.20.1