From nobody Tue Oct 28 12:16:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15153805891001013.5280565802628; Sun, 7 Jan 2018 19:03:09 -0800 (PST) Received: from localhost ([::1]:59495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNiO-00048M-Ad for importer@patchew.org; Sun, 07 Jan 2018 22:03:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNTT-0007kl-TE for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNTT-0003N9-4T for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:35539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNTT-0003Lf-0F for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:47:43 -0500 Received: by mail-qk0-x242.google.com with SMTP id w184so4360291qka.2 for ; Sun, 07 Jan 2018 18:47:42 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ssaMPAWNZUZH4tlMuDLWk1JF9IbM8J/Wy10NLAuPKcI=; b=MwCIUs9zRaJ8Wgc7EV2qnz8Hk0oEFyedZXrnn6y81po3/tOZPYFhHcvtGjQHmzVF5l 5pPr/9OqpTaQhAARSndMdiUeRDp6BtzDWql+8Q/Z7omywIMnTJkK0kvtFusnQKgGhm1J SAI3l282gvCKJ7GbAe4sAsa7w3JSl2bxZZilgNF/j5r5HXnpsavd4OOJ/ew8wNRgcDD5 gUAg0HH/g/eIYRcqp4HkyPW/0C8cmUeHUOm9j1NMxMfJl3FfDmzWPLQn9skYM8C5Bk6u m0NwLHthe9wpBpPPIFnD+vM6DNdTez8Lys9YXGyXNuEglUlQrlWsqNgkfLiyGInwarym 3mDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ssaMPAWNZUZH4tlMuDLWk1JF9IbM8J/Wy10NLAuPKcI=; b=oaP2+4Hwx8UjkAIA2pNKj1PH+BZEIYLTu59+CVAq8iaDXwCu+cH94We4cDziDu+h38 Nl83XHRhZqZ3bLNz9gfBXMYEQLQesZaa7/9TjU7Sb5Z7lGh2VaRpiLNy5PCQsrUTE81w ToGMa9Iudhv75fc82I/xZNGq6Z8oXsobgUtv40+Dk7vb2w9ApAgk68DOuPIOuYY0FgXR YbfpEJxZMCecaq5eMeMcMS2/5XeGUOYRTt+X0fSTabnypYG7L+84W9A6l1Kds6EpLu5q hgE3eUaANilO5SridAWj2HwHf+rU0WdDRE8lYvYC9uGah4kbDJj0eux139/Dd3VBarXM y85w== X-Gm-Message-State: AKGB3mLA6RfmJ3KoUAu/k5frzoR0uy0rmSCfePghfun+vgsSg7e/Q29V sGsw1z7CmOlGHguNpSH94BI= X-Google-Smtp-Source: ACJfBos8ycOhHUpMy+rebSoZ2PPYm0vSalT/poeElePpCx4X9fvGrn0GFkF+hVuofHlOUWKMJq07SQ== X-Received: by 10.55.195.69 with SMTP id a66mr13423851qkj.83.1515379662476; Sun, 07 Jan 2018 18:47:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:56 -0300 Message-Id: <20180108024558.17983-28-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 27/29] piix3: convert reset function to QOM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/southbridge/piix.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/southbridge/piix.c b/hw/southbridge/piix.c index df08d94a59..2d429d6b29 100644 --- a/hw/southbridge/piix.c +++ b/hw/southbridge/piix.c @@ -203,10 +203,10 @@ static void piix3_write_config_xen(PCIDevice *dev, piix3_write_config(dev, address, val, len); } =20 -static void piix3_reset(void *opaque) +static void piix3_reset(DeviceState *dev) { - PIIX3State *d =3D opaque; - uint8_t *pci_conf =3D d->dev.config; + PIIX3State *s =3D PIIX3_PCI_DEVICE(dev); + uint8_t *pci_conf =3D s->dev.config; =20 pci_conf[0x04] =3D 0x07; /* master, memory and I/O */ pci_conf[0x05] =3D 0x00; @@ -240,8 +240,8 @@ static void piix3_reset(void *opaque) pci_conf[0xac] =3D 0x00; pci_conf[0xae] =3D 0x00; =20 - d->pic_levels =3D 0; - d->rcr =3D 0; + s->pic_levels =3D 0; + s->rcr =3D 0; } =20 static int piix3_post_load(void *opaque, int version_id) @@ -352,8 +352,6 @@ static void piix3_realize(PCIDevice *dev, Error **errp) "piix3-reset-control", 1); memory_region_add_subregion_overlap(pci_address_space_io(dev), RCR_IOP= ORT, &d->rcr_mem, 1); - - qemu_register_reset(piix3_reset, d); } =20 static void pci_piix3_class_init(ObjectClass *klass, void *data) @@ -364,6 +362,7 @@ static void pci_piix3_class_init(ObjectClass *klass, vo= id *data) dc->desc =3D "ISA bridge"; dc->vmsd =3D &vmstate_piix3; dc->hotpluggable =3D false; + dc->reset =3D piix3_reset; k->realize =3D piix3_realize; k->vendor_id =3D PCI_VENDOR_ID_INTEL; /* 82371SB PIIX3 PCI-to-ISA bridge (Step A1) */ --=20 2.15.1