From patchwork Wed Feb 15 16:16:26 2023 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: 653724 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432411wrr; Wed, 15 Feb 2023 08:20:41 -0800 (PST) X-Google-Smtp-Source: AK7set8JPvAAOIT853Wt168xLYoS1NUqBFmqGI13LOeOH+w5VmC+VK/r4XB6Dajf5qwIlhr+LyNF X-Received: by 2002:ac8:5f52:0:b0:3b6:895c:d18d with SMTP id y18-20020ac85f52000000b003b6895cd18dmr4326922qta.15.1676478040914; Wed, 15 Feb 2023 08:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478040; cv=none; d=google.com; s=arc-20160816; b=krbyJz9yiyzQ9vq063RZSfem3qSn2/waqWb/kDutojfYHW/jZXK/RBurz3YutGdsWb ljMTxty61bnqPNNadM4CVhNWOmjchs0ESVQo8wSLUTwj6NgXE6/hlAtE/qbfwApTGa4X /c2XnDB2QLJiPm+ktO8vxvlg9aoRlT+9hQoVDyHREER9V3E/w897gt+ELqCwrVVrt7kl Ni43zbUk7c6CusLfTgJmes+abofTXh+iVYWJcdx4ZxOIYGMS1cickZLOtQmUsuCpS2+j hbNwY0kBQTSig51bc+krrQ+OasrGCNBHUGOXNNeQywGrhIZTTUmga+/MdJuHCfhUBEsl oSeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=v8RtrrvO+M++8XqHDIPlbpLfPRDEsTnCEKMBVdo6hIBwQOrXQsEbZGs1Xr0nGbgI6l nrNi5YC9z52CFA9ZSbaKMcF0u7CR38YJXyVh+SRLSm55DjDDP9pfLiuW7xqGQ5bv/Bzo fkr82+XigER5TkrRreRkYQNmMIcjrRzmMv8mniHsKei1jAfT7eZFx7IhgAuwL5+UpEY3 tezfSeOYxfJL2QCVd3pgGssqoZMg/9r609oVODr4wmqbKYHzfHawpw/zVSpPUXHFmJbr 0GjTJYFvRzEGnz6ql8hkMHkbYGH6/Ok8TdUB5masr2hCH1ure+5H1b3dLmBRKoZka83K e9HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j9C/qfwu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r16-20020ae9d610000000b006f9720b5fcbsi13549555qkk.79.2023.02.15.08.20.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j9C/qfwu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKSv-0006tr-GN; Wed, 15 Feb 2023 11:17:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKSt-0006pO-Mh for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:03 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKSr-0008E9-0g for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:03 -0500 Received: by mail-wr1-x433.google.com with SMTP id bk16so19691585wrb.11 for ; Wed, 15 Feb 2023 08:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=j9C/qfwuaSY84DVpkM/QMdfNL5zMIzi6N5zJ8Sxos3o25H1LunWSHRNvGRwDmrQjh6 bCB8j9TPw/G2mffdiAmUBJZB1D2PdPVg4hPp7qeAD6SGlvhek8ZGUCHfQrV34gNdOfW5 EuqNF2jEeGdmqHx6hoowVD3YndCKMzZpZnDPfdDQGIFxtbZesi/rdk4G+ap0HYGtnUIc SrGxiqhwHzSmiFR6CpoSMKQEiz7JMrB9d/eitQilQiZTAdFHAT25t6C3HJDLVlD/H02S nndMtBpD7nl0qV0QtMpjvutrJ5qKBgPXhDzdlsB6I3MTwxdOZJ7uA7+DxwNnyjxRlM1w yW2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=jg2zbRO0Czd0txkig/TmdWSMNy9VDawpb9JuzEGsAiambFYmgle0CZJBhpgZutizCG vSfTsVXfZK5ohEuEvWqY8CF67/b8Gm7dXmBhYJAREwmuM+C9I6dwDi8mEV3WVK/t88IB jDV1za53kWC1o/PH8wim8dHtjDhWV5acCJI5Fz3BQ4Eh3fItXvsPqZrmht0HWoZwLoZj 3R6O2LI0GiqKZIT7UPCynOJUh4CQqppPMsISQR9RwEdbaaZ2c26pP2ERR+F0BO7MWjXY k81ldHDnA5XnLBM9CTvwujgyKy41Lg9LkJikWJKRW669nZOIRXbSkZZfd0Nb0XM4UwSV v1Jw== X-Gm-Message-State: AO0yUKVpV7l3I+Y8mwaqkggCqUYuFBzVBKcKG7ca5bxgD+rJiWdhfYQw X7pyL/TxrXbpSZRxIcf+hnMx/13tlqV1fYGW X-Received: by 2002:a5d:4101:0:b0:2c5:53e6:9aba with SMTP id l1-20020a5d4101000000b002c553e69abamr1950617wrp.5.1676477819612; Wed, 15 Feb 2023 08:16:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d2-20020adfe2c2000000b002c3f7dfd15csm15957221wrj.32.2023.02.15.08.16.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:16:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 03/18] hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available Date: Wed, 15 Feb 2023 17:16:26 +0100 Message-Id: <20230215161641.32663-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/audio/cs4231a.c | 5 +++-- hw/audio/gus.c | 5 +++-- hw/audio/sb16.c | 7 ++++--- hw/block/fdc-isa.c | 5 +++-- include/hw/timer/i8254.h | 3 ++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index ec066fcd89..5c6d643732 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -668,16 +668,17 @@ static void cs4231a_initfn (Object *obj) static void cs4231a_realizefn (DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE (dev); + ISABus *bus = isa_bus_from_device(d); CSState *s = CS4231A (dev); IsaDmaClass *k; - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->dma); + s->isa_dma = isa_bus_get_dma(bus, s->dma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; } - s->pic = isa_get_irq(d, s->irq); + s->pic = isa_bus_get_irq(bus, s->irq); k = ISADMA_GET_CLASS(s->isa_dma); k->register_channel(s->isa_dma, s->dma, cs_dma_read, s); diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 2a08a0f7d7..787345ce54 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -236,11 +236,12 @@ static const MemoryRegionPortio gus_portio_list2[] = { static void gus_realizefn (DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE(dev); + ISABus *bus = isa_bus_from_device(d); GUSState *s = GUS (dev); IsaDmaClass *k; struct audsettings as; - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->emu.gusdma); + s->isa_dma = isa_bus_get_dma(bus, s->emu.gusdma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; @@ -282,7 +283,7 @@ static void gus_realizefn (DeviceState *dev, Error **errp) s->emu.himemaddr = s->himem; s->emu.gusdatapos = s->emu.himemaddr + 1024 * 1024 + 32; s->emu.opaque = s; - s->pic = isa_get_irq(d, s->emu.gusirq); + s->pic = isa_bus_get_irq(bus, s->emu.gusirq); AUD_set_active_out (s->voice, 1); } diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index ae745c7283..535ccccdc9 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1398,17 +1398,18 @@ static void sb16_initfn (Object *obj) static void sb16_realizefn (DeviceState *dev, Error **errp) { ISADevice *isadev = ISA_DEVICE (dev); + ISABus *bus = isa_bus_from_device(isadev); SB16State *s = SB16 (dev); IsaDmaClass *k; - s->isa_hdma = isa_bus_get_dma(isa_bus_from_device(isadev), s->hdma); - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(isadev), s->dma); + s->isa_hdma = isa_bus_get_dma(bus, s->hdma); + s->isa_dma = isa_bus_get_dma(bus, s->dma); if (!s->isa_dma || !s->isa_hdma) { error_setg(errp, "ISA controller does not support DMA"); return; } - s->pic = isa_get_irq(isadev, s->irq); + s->pic = isa_bus_get_irq(bus, s->irq); s->mixer_regs[0x80] = magic_of_irq (s->irq); s->mixer_regs[0x81] = (1 << s->dma) | (1 << s->hdma); diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index a5f07b668d..7ec075e470 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -86,6 +86,7 @@ static const MemoryRegionPortio fdc_portio_list[] = { static void isabus_fdc_realize(DeviceState *dev, Error **errp) { ISADevice *isadev = ISA_DEVICE(dev); + ISABus *bus = isa_bus_from_device(isadev); FDCtrlISABus *isa = ISA_FDC(dev); FDCtrl *fdctrl = &isa->state; Error *err = NULL; @@ -94,11 +95,11 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) isa->iobase, fdc_portio_list, fdctrl, "fdc"); - fdctrl->irq = isa_get_irq(isadev, isa->irq); + fdctrl->irq = isa_bus_get_irq(bus, isa->irq); fdctrl->dma_chann = isa->dma; if (fdctrl->dma_chann != -1) { IsaDmaClass *k; - fdctrl->dma = isa_bus_get_dma(isa_bus_from_device(isadev), isa->dma); + fdctrl->dma = isa_bus_get_dma(bus, isa->dma); if (!fdctrl->dma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 3e569f42b6..8402caad30 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -56,7 +56,8 @@ static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq, qdev_prop_set_uint32(dev, "iobase", base); isa_realize_and_unref(d, bus, &error_fatal); qdev_connect_gpio_out(dev, 0, - isa_irq >= 0 ? isa_get_irq(d, isa_irq) : alt_irq); + isa_irq >= 0 ? isa_bus_get_irq(bus, isa_irq) + : alt_irq); return d; }