From patchwork Tue Oct 15 16:26:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11191009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B3AF14E5 for ; Tue, 15 Oct 2019 16:30:57 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0186D2086A for ; Tue, 15 Oct 2019 16:30:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0186D2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iKPhl-0003pZ-JU; Tue, 15 Oct 2019 16:29:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iKPhl-0003p2-2S for xen-devel@lists.xenproject.org; Tue, 15 Oct 2019 16:29:49 +0000 X-Inumbo-ID: 012eb1f8-ef69-11e9-bbab-bc764e2007e4 Received: from mx1.redhat.com (unknown [209.132.183.28]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 012eb1f8-ef69-11e9-bbab-bc764e2007e4; Tue, 15 Oct 2019 16:29:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E85F880167A; Tue, 15 Oct 2019 16:29:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-35.brq.redhat.com [10.40.204.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C046B19C58; Tue, 15 Oct 2019 16:29:39 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 15 Oct 2019 18:26:46 +0200 Message-Id: <20191015162705.28087-14-philmd@redhat.com> In-Reply-To: <20191015162705.28087-1-philmd@redhat.com> References: <20191015162705.28087-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 15 Oct 2019 16:29:48 +0000 (UTC) Subject: [Xen-devel] [PATCH 13/32] piix4: convert reset function to QOM X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Stefano Stabellini , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , =?utf-8?q?Herv=C3=A9_Poussineau?= , Aleksandar Markovic , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Hervé Poussineau Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau Message-Id: <20180106153730.30313-15-hpoussin@reactos.org> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- hw/isa/piix4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index c3a2bd0d70..8998b0ca47 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -48,10 +48,10 @@ typedef struct PIIX4State { #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) -static void piix4_reset(void *opaque) +static void piix4_reset(DeviceState *dev) { - PIIX4State *d = opaque; - uint8_t *pci_conf = d->dev.config; + PIIX4State *s = PIIX4_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; pci_conf[0x04] = 0x07; // master, memory and I/O pci_conf[0x05] = 0x00; @@ -165,7 +165,6 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) isa_bus_irqs(isa_bus, s->isa); piix4_dev = pci_dev; - qemu_register_reset(piix4_reset, s); } static void piix4_class_init(ObjectClass *klass, void *data) @@ -177,6 +176,7 @@ static void piix4_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; k->class_id = PCI_CLASS_BRIDGE_ISA; + dc->reset = piix4_reset; dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix4; /*