From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646173918919439.19398920601793; Tue, 1 Mar 2022 14:31:58 -0800 (PST) Received: from localhost ([::1]:38870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPB2D-0004Lr-JK for importer@patchew.org; Tue, 01 Mar 2022 17:31:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAY7-00026w-N3 for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:53 -0500 Received: from [2a00:1450:4864:20::62c] (port=35639 helo=mail-ej1-x62c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY4-0005C5-QO for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:50 -0500 Received: by mail-ej1-x62c.google.com with SMTP id qk11so34327614ejb.2 for ; Tue, 01 Mar 2022 14:00:47 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Suz0JdS7tU1ARyZcqsJLrz4VA7zoawrIgt5R/6ni4cc=; b=VyhubykBptkuyk4X/LcR7RL45fDUj+P2mPp5xUz+nowAwmJg9dt3EVhbwDpmmKKt3T 0XJlGug4FRgXlXDn6kkb4+uARKPPX41gYGN5McB8XTg1u/hIFRC3AhiJP4o5gF+u5eUy A7V0YJtAmwwoG6podg1njc+EAO2qqRtmeGG/10SVbo5LD4C6hm5uppuEXtzh3Mi+vPaS h9NvZG099qiOzgvY1KeMvOiUCOUf99j4shNQtp++wuBJ6DdorKolXaPgdvxOVAqHltSt Ha4DxDYC8AlQQfAix5Vgg9gzS903w0yGTwPV+LmY4R5VRrlSitV6niM0eL5QXSMeqrmd ahAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Suz0JdS7tU1ARyZcqsJLrz4VA7zoawrIgt5R/6ni4cc=; b=CBdUH9gaNM8CbQlxt9Zx0yBzlrxFtGEZaghh9LEzEGL0SSt3YIl2VMgQERMnOSBw5L 9WV3pnd3Jnx4nCexfJ70QxZ+M9TTtEY71hQOpwaJ4F8Xr/WcYRkmQ9DpQs1CR5zzCQi1 RVBXIFHQAzJHW2slZyIO2jWpLmyP3v/aF3LQju5Stav72NpPa5OCu5RjWD08yPy1vsd/ rwoQYMFmu6hQurnjFuGVojrup3Xt+/efar4Ny0PcuXvXiBZp8ztiwy/lvBESmWOVuT2p GEshIgeCRb9E0qcT6ekyhN1S4QfcgzGuMwnuy50uHMilNsph4a9Rk6G+gkq8MN+XHB4Y kRjQ== X-Gm-Message-State: AOAM530OSKhdmNYCSgV82mte0q7Y+yCwQJMkBvSlqDbB2je1nLeeJChf su8h33NLCEfA+8SYLn91eD6yZnBv5Rs= X-Google-Smtp-Source: ABdhPJyaP2v1dAVCdI0lk6PdglQS4o4NDHu7ztxtCGZd8Hlb5aanVHZhe6BL6Z7XZYtNY2eCFcJsEA== X-Received: by 2002:a17:907:7704:b0:6cf:48ac:b4a8 with SMTP id kw4-20020a170907770400b006cf48acb4a8mr20017743ejc.305.1646172046632; Tue, 01 Mar 2022 14:00:46 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 1/7] hw/rtc/mc146818rtc: QOM'ify IRQ number Date: Tue, 1 Mar 2022 23:00:31 +0100 Message-Id: <20220301220037.76555-2-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62c (failed) 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=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini , Bernhard Beschow , Aurelien Jarno 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: 1646173920142100001 Exposing the IRQ number as a QOM property not only allows it to be configurable but also to be displayed in HMP: Before: (qemu) info qtree ... dev: mc146818rtc, id "" gpio-out "" 1 base_year =3D 0 (0x0) lost_tick_policy =3D "discard" After: dev: mc146818rtc, id "" gpio-out "" 1 base_year =3D 0 (0x0) irq =3D 8 (0x8) lost_tick_policy =3D "discard" The reason the IRQ number didn's show up before is that this device does not call isa_init_irq(). Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/piix4.c | 2 +- hw/rtc/mc146818rtc.c | 13 +++++++++++-- include/hw/rtc/mc146818rtc.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 0fe7b69bc4..cb291d121c 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -197,7 +197,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) if (!qdev_realize(DEVICE(&s->rtc), BUS(isa_bus), errp)) { return; } - isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, RTC_ISA_IRQ); + isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, s->rtc.isairq); =20 piix4_dev =3D dev; } diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ac9a60c90e..f235c2ddbe 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -912,6 +912,11 @@ static void rtc_realizefn(DeviceState *dev, Error **er= rp) s->base_year =3D 0; } =20 + if (s->isairq >=3D ISA_NUM_IRQS) { + error_setg(errp, "Maximum value for \"irq\" is: %u", ISA_NUM_IRQS = - 1); + return; + } + rtc_set_date_from_host(isadev); =20 switch (s->lost_tick_policy) { @@ -957,15 +962,17 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_ye= ar, qemu_irq intercept_irq) { DeviceState *dev; ISADevice *isadev; + RTCState *s; =20 isadev =3D isa_new(TYPE_MC146818_RTC); dev =3D DEVICE(isadev); + s =3D MC146818_RTC(isadev); qdev_prop_set_int32(dev, "base_year", base_year); isa_realize_and_unref(isadev, bus, &error_fatal); if (intercept_irq) { qdev_connect_gpio_out(dev, 0, intercept_irq); } else { - isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); + isa_connect_gpio_out(isadev, 0, s->isairq); } =20 object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isade= v), @@ -976,6 +983,7 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year= , qemu_irq intercept_irq) =20 static Property mc146818rtc_properties[] =3D { DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980), + DEFINE_PROP_UINT8("irq", RTCState, isairq, RTC_ISA_IRQ), DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState, lost_tick_policy, LOST_TICK_POLICY_DISCARD), DEFINE_PROP_END_OF_LIST(), @@ -1011,6 +1019,7 @@ static void rtc_reset_hold(Object *obj) =20 static void rtc_build_aml(ISADevice *isadev, Aml *scope) { + RTCState *s =3D MC146818_RTC(isadev); Aml *dev; Aml *crs; =20 @@ -1021,7 +1030,7 @@ static void rtc_build_aml(ISADevice *isadev, Aml *sco= pe) crs =3D aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, RTC_ISA_BASE, RTC_ISA_BASE, 0x01, 0x08)); - aml_append(crs, aml_irq_no_flags(RTC_ISA_IRQ)); + aml_append(crs, aml_irq_no_flags(s->isairq)); =20 dev =3D aml_device("RTC"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00"))); diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 5b45b22924..deef93f89a 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -25,6 +25,7 @@ struct RTCState { MemoryRegion coalesced_io; uint8_t cmos_data[128]; uint8_t cmos_index; + uint8_t isairq; int32_t base_year; uint64_t base_rtc; uint64_t last_update; --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646173277078119.24623645096074; Tue, 1 Mar 2022 14:21:17 -0800 (PST) Received: from localhost ([::1]:48908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPArr-0000Ef-Ru for importer@patchew.org; Tue, 01 Mar 2022 17:21:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAY9-00027n-IJ; Tue, 01 Mar 2022 17:00:53 -0500 Received: from [2a00:1450:4864:20::632] (port=36783 helo=mail-ej1-x632.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY7-0005CE-Bb; Tue, 01 Mar 2022 17:00:52 -0500 Received: by mail-ej1-x632.google.com with SMTP id a23so34254503eju.3; Tue, 01 Mar 2022 14:00:48 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BaGIu9qoSGH/+tDdpQADcIHfyD6Ow0XS1W32KV8bHt0=; b=EvPCgnaS86NdueklKLGsDNgcp1TA0dDt/I8TTC8xIZ7nO9908jaqAThrv48jx0lvvu Ms2KZXtHPyHnqE0S8IWGwutSobzQmcWe8ZESiuoDwjguwljiRF+rTwrDZSkuyxcgai9h O1DppZ/qQlvngZIHbIQDzAG1aDsWtSCCoezMZ8/SXU48xfjIMbmWG4XPtDevQRhSliBm LiuJmdi0JZeg88lBRx1/ThfI6z6o0TmPvLBWewXIr/CC5TiJe2fNI3CxnTBQwdejrqQ4 cu1tAS+Ytf7txClzwbesEErICgBs98T61jxjRyYvZIkSgi6NTkuDZLzit0KJJXqtGiaD tG3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BaGIu9qoSGH/+tDdpQADcIHfyD6Ow0XS1W32KV8bHt0=; b=eoIk+V9xLlX0b3TkFxy/QXiIMLSYkDU3f9inaQ4eaA4n7st/GhbJZueG8zZ6oligjY zidQuincf449k03E3YcvXZWIiImat66lcLVlTAnCAT1AsGXJo2Kby2saXSRbwDWuK/yA 9PlVb17nHlUgJayN16hgi/CHwXh2q1qEQZ1+oQCHxoaSmCRVIQ5QDP9DCfm8UpLfyaAO w4tCDwKKQeG2LNYroCKszhNY2q1MYw2LKxp31SWXRMreJQFWopJ3JlQkosP8+xKoN0ln YptM+M0k7p0Qs8kqkbBj/aa0o7O5y3/SQ+D+6H35QifBHVciKlfcJLuTitXcfcapLRu4 ngFw== X-Gm-Message-State: AOAM533Tm29oMn4E3l9LIrj+r5XHLFA2w3KJ29V/vP+8mNMF0WTwgj3E /jYfGp3CAUc8m/4w60amZvIkA2GSwiI= X-Google-Smtp-Source: ABdhPJxFT68lAu7sKXvdcWljJZ08sFx/T2JUs2vj+PbusRzHQLhyEUThaW3aag7WgZ+y07Hkxeflhg== X-Received: by 2002:a17:907:7845:b0:6cd:f2f4:cf00 with SMTP id lb5-20020a170907784500b006cdf2f4cf00mr20353620ejc.388.1646172047699; Tue, 01 Mar 2022 14:00:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 2/7] hw/rtc/m48t59-isa: QOM'ify IRQ number Date: Tue, 1 Mar 2022 23:00:32 +0100 Message-Id: <20220301220037.76555-3-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::632 (failed) 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=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: "open list:PReP" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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: 1646173278357100001 Exposing the IRQ number as a QOM property not only allows it to be configurable but also to be printed by standard QOM mechanisms. This allows isabus_dev_print() to be retired eventually. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/rtc/m48t59-isa.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index dc21fb10a5..e9086eada4 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -42,6 +42,7 @@ struct M48txxISAState { ISADevice parent_obj; M48t59State state; uint32_t io_base; + uint8_t isairq; MemoryRegion io; }; =20 @@ -79,6 +80,7 @@ static void m48txx_isa_toggle_lock(Nvram *obj, int lock) static Property m48t59_isa_properties[] =3D { DEFINE_PROP_INT32("base-year", M48txxISAState, state.base_year, 0), DEFINE_PROP_UINT32("iobase", M48txxISAState, io_base, 0x74), + DEFINE_PROP_UINT8("irq", M48txxISAState, isairq, 8), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -97,9 +99,14 @@ static void m48t59_isa_realize(DeviceState *dev, Error *= *errp) M48txxISAState *d =3D M48TXX_ISA(dev); M48t59State *s =3D &d->state; =20 + if (d->isairq >=3D ISA_NUM_IRQS) { + error_setg(errp, "Maximum value for \"irq\" is: %u", ISA_NUM_IRQS = - 1); + return; + } + s->model =3D u->info.model; s->size =3D u->info.size; - isa_init_irq(isadev, &s->IRQ, 8); + isa_init_irq(isadev, &s->IRQ, d->isairq); m48t59_realize_common(s, errp); memory_region_init_io(&d->io, OBJECT(dev), &m48t59_io_ops, s, "m48t59"= , 4); if (d->io_base !=3D 0) { --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164617366566183.01188487204331; Tue, 1 Mar 2022 14:27:45 -0800 (PST) Received: from localhost ([::1]:57580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPAy8-0006Ny-Ed for importer@patchew.org; Tue, 01 Mar 2022 17:27:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAY9-00027p-JR for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:53 -0500 Received: from [2a00:1450:4864:20::62a] (port=40701 helo=mail-ej1-x62a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY7-0005CN-CO for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:52 -0500 Received: by mail-ej1-x62a.google.com with SMTP id p15so34261776ejc.7 for ; Tue, 01 Mar 2022 14:00:49 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6MRmq/cx0dEgNoBOUQNwTLmtO70h12HaU/bX/Su1iA=; b=E802O9IU9LCmGQ/lk59dp5MN5R0g3qfqW055Qrzh7IxWl2JVeRTpiChp6yeBUWCsfe jE5CckJVQpuzU7qfvi/2ylJO1pSv17tQt9XdwMi0gYG0mFqjqB9SdkvTZCHSJg/N2ns0 vryoFudOY7nDMUPx4pP59Lt/rs1PrvgIeZKAr3VZ0E6YWPA0nk2n1ZFkugs3f468KWQm ppUdZ5eXlwrQOePW6685qx+LVTEdjyx+SjEIt5+9fPkom6I4wqF29Lk4A9vmnQLEAoax X4UJhChnBevUBp1WP34qVwLRoyKSLibNd5Z08y1KKqMOjh3Lacms3Kd957MRonVRTLQT H7Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s6MRmq/cx0dEgNoBOUQNwTLmtO70h12HaU/bX/Su1iA=; b=MZZex330EWuJrGEXILt2/3NKuKOvvA60kLtEtVBJ8X/MCi05HAoYNULjGhtt0/XMQ9 PYxE+xXmP1H4b0kruTGfliPAMVPM/sYhuqHfOd6gLr4iA6MpfgB7TwWb92OE6LH1ggm4 vYUrNOCZUlUSfWP4LZY+6NNlyood11tClDAMu+RsOxAdRXuVe3j1JGC/wPs/6UFAHmzT nNJwnsmFEcpHjoM/yqm/3AhDr4s/61MoRnkqf4zUeyULUdCAd1bjoTZ5+SeX3LXcFkbc e1YUvX78ZhtETs9v8asomyHkMCojv1dfSV2Ax5TkWkdVj8DnbX5XVaWty1HuoIgV8wrr o3ig== X-Gm-Message-State: AOAM530dRFxKxqIKJOU7TWS9/BgDen+bnYPY0wUjfJdOrsh3IapaEx2h sls2w2ZEDVbGajHahii5zRpdtFg7EQU= X-Google-Smtp-Source: ABdhPJxsxWeeNfOSj7aPI0hV0XsKF95FT0HObf3UFxdMbVBOyc7CFHfDqFnqww0T59QLnA231JiFng== X-Received: by 2002:a17:906:5a6e:b0:6d0:afaa:6ce9 with SMTP id my46-20020a1709065a6e00b006d0afaa6ce9mr20729014ejc.72.1646172048608; Tue, 01 Mar 2022 14:00:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 3/7] hw/input/pckbd: QOM'ify IRQ numbers Date: Tue, 1 Mar 2022 23:00:33 +0100 Message-Id: <20220301220037.76555-4-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62a (failed) 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=2a00:1450:4864:20::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Paolo Bonzini , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" 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: 1646173667672100003 Exposing the IRQ numbers as QOM properties not only allows them to be configurable but also to be printed by standard QOM mechanisms. This allows isabus_dev_print() to be retired eventually. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pckbd.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index baba62f357..eb77e12f6f 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -26,6 +26,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/timer.h" +#include "qapi/error.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" #include "hw/acpi/aml-build.h" @@ -671,6 +672,8 @@ struct ISAKBDState { KBDState kbd; bool kbd_throttle; MemoryRegion io[2]; + uint8_t kbd_irq; + uint8_t mouse_irq; }; =20 void i8042_isa_mouse_fake_event(ISAKBDState *isa) @@ -734,8 +737,20 @@ static void i8042_realizefn(DeviceState *dev, Error **= errp) ISAKBDState *isa_s =3D I8042(dev); KBDState *s =3D &isa_s->kbd; =20 - isa_init_irq(isadev, &s->irq_kbd, 1); - isa_init_irq(isadev, &s->irq_mouse, 12); + if (isa_s->kbd_irq >=3D ISA_NUM_IRQS) { + error_setg(errp, "Maximum value for \"kbd-irq\" is: %u", + ISA_NUM_IRQS - 1); + return; + } + + if (isa_s->mouse_irq >=3D ISA_NUM_IRQS) { + error_setg(errp, "Maximum value for \"mouse-irq\" is: %u", + ISA_NUM_IRQS - 1); + return; + } + + isa_init_irq(isadev, &s->irq_kbd, isa_s->kbd_irq); + isa_init_irq(isadev, &s->irq_mouse, isa_s->mouse_irq); =20 isa_register_ioport(isadev, isa_s->io + 0, 0x60); isa_register_ioport(isadev, isa_s->io + 1, 0x64); @@ -754,6 +769,7 @@ static void i8042_realizefn(DeviceState *dev, Error **e= rrp) =20 static void i8042_build_aml(ISADevice *isadev, Aml *scope) { + ISAKBDState *isa_s =3D I8042(isadev); Aml *kbd; Aml *mou; Aml *crs; @@ -761,7 +777,7 @@ static void i8042_build_aml(ISADevice *isadev, Aml *sco= pe) crs =3D aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01)); - aml_append(crs, aml_irq_no_flags(1)); + aml_append(crs, aml_irq_no_flags(isa_s->kbd_irq)); =20 kbd =3D aml_device("KBD"); aml_append(kbd, aml_name_decl("_HID", aml_eisaid("PNP0303"))); @@ -769,7 +785,7 @@ static void i8042_build_aml(ISADevice *isadev, Aml *sco= pe) aml_append(kbd, aml_name_decl("_CRS", crs)); =20 crs =3D aml_resource_template(); - aml_append(crs, aml_irq_no_flags(12)); + aml_append(crs, aml_irq_no_flags(isa_s->mouse_irq)); =20 mou =3D aml_device("MOU"); aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); @@ -783,6 +799,8 @@ static void i8042_build_aml(ISADevice *isadev, Aml *sco= pe) static Property i8042_properties[] =3D { DEFINE_PROP_BOOL("extended-state", ISAKBDState, kbd.extended_state, tr= ue), DEFINE_PROP_BOOL("kbd-throttle", ISAKBDState, kbd_throttle, false), + DEFINE_PROP_UINT8("kbd-irq", ISAKBDState, kbd_irq, 1), + DEFINE_PROP_UINT8("mouse-irq", ISAKBDState, mouse_irq, 12), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16461741112361019.7718616015921; Tue, 1 Mar 2022 14:35:11 -0800 (PST) Received: from localhost ([::1]:46676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPB5J-0001DB-RK for importer@patchew.org; Tue, 01 Mar 2022 17:35:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAYB-000295-LS; Tue, 01 Mar 2022 17:00:58 -0500 Received: from [2a00:1450:4864:20::52a] (port=42706 helo=mail-ed1-x52a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY7-0005Cb-PN; Tue, 01 Mar 2022 17:00:54 -0500 Received: by mail-ed1-x52a.google.com with SMTP id i11so23807470eda.9; Tue, 01 Mar 2022 14:00:50 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rl+3TnhKi4ZXtD1JrJvIiuKq1Wcy8l+vwUoCOGjVIZY=; b=KSqtJkOHPG2okE+xkHo1JL2ZMdSQHggIkMXKRb94aH+sn4nW5ceGdiEL8fLgKiDYdQ A00ZBHmi3r4rdumol0eqh3NJNg4Y0lpsGLfhopcYVrFi696y+kEiR2sO9l6o+92cjK8J Ff9hh3UmgnBZIel4g5PvFtU9DOR47Hi2/dmMqDpsb5E8hgNWofaxYmQTyjY7TcVbs03Q e3ALmGg8G6rck9MEAH2DV8J7QVm2VjYr8ZVLUUNhgpjq5sGSaF8bjiXvGDuPSIsKN1ZW RLhfTLSp5REAGuCWoK57Q60MDm3lhO5RgFc+XbcPw+/5FY0CQuWshIgUpm1FXu8Lifs/ YYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rl+3TnhKi4ZXtD1JrJvIiuKq1Wcy8l+vwUoCOGjVIZY=; b=y3g9AmYbkFPfC3eBCZFhymlUS42odukkxQoMCrurHU/TIAfCqIuu9xGiyBPCzLlny8 wWz+tsOrcQu0mOxhCLdfbTBWu4W9DYCVzyVqO35+TsiR95/gW6AUtKDVnzGRIc4Fu+aK K12DkhYGw/M9G/RUwE1e+BwoQmxnGYFsaxTRHKJJmQS1nb0DZlmM7ykjCQgXDjJZLf3V HVCCnM+sCColh19rG684nMO6Ep1m87g0kaV9wCzX18J5BUVqszPAZAXM5sA9SFUehAT8 Ony9M7jDokVvg9txtlr64zt7u5rdtWyYgkz9b7p5UXeXUFPu1Jy+d6Ec44Q/e9KAK1cj hLfA== X-Gm-Message-State: AOAM532OxdF1ShTPpIcPS9AFv+2SIUH1CukR2aBjVDOb8cxh3qW+J/SP BzVREVrF2uWtQPbUDEdW6FQYPgYO+ls= X-Google-Smtp-Source: ABdhPJzzqCbvQhToar/8jluEhHehqXnhejD9g7llYJ95THBqq05gGqKQpccBdFTR3ROqUGt5r5lSUA== X-Received: by 2002:a05:6402:d0d:b0:412:d49c:74d3 with SMTP id eb13-20020a0564020d0d00b00412d49c74d3mr26552118edb.207.1646172049459; Tue, 01 Mar 2022 14:00:49 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 4/7] hw/isa/isa-bus: Remove isabus_dev_print() Date: Tue, 1 Mar 2022 23:00:34 +0100 Message-Id: <20220301220037.76555-5-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52a (failed) 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=2a00:1450:4864:20::52a; envelope-from=shentey@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Kevin Wolf , Hanna Reitz , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "open list:Block layer core" 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: 1646174112997100001 All isabus_dev_print() did was to print up to two IRQ numbers per device. This is redundant if the IRQ numbers are present as QOM properties (see e.g. the modified tests/qemu-iotests/172.out). Now that the last devices relying on isabus_dev_print() had their IRQ numbers QOM'ified, the contribution of this function ultimately became redundant. Remove it. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/isa-bus.c | 16 ---------------- tests/qemu-iotests/172.out | 26 -------------------------- 2 files changed, 42 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 6c31398dda..af5add6a26 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -21,21 +21,18 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" -#include "monitor/monitor.h" #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" =20 static ISABus *isabus; =20 -static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *isabus_get_fw_dev_path(DeviceState *dev); =20 static void isa_bus_class_init(ObjectClass *klass, void *data) { BusClass *k =3D BUS_CLASS(klass); =20 - k->print_dev =3D isabus_dev_print; k->get_fw_dev_path =3D isabus_get_fw_dev_path; } =20 @@ -222,19 +219,6 @@ void isa_build_aml(ISABus *bus, Aml *scope) } } =20 -static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent) -{ - ISADevice *d =3D ISA_DEVICE(dev); - - if (d->isairq[1] !=3D -1) { - monitor_printf(mon, "%*sisa irqs %d,%d\n", indent, "", - d->isairq[0], d->isairq[1]); - } else if (d->isairq[0] !=3D -1) { - monitor_printf(mon, "%*sisa irq %d\n", indent, "", - d->isairq[0]); - } -} - static void isabus_bridge_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out index 4cf4d536b4..9479b92185 100644 --- a/tests/qemu-iotests/172.out +++ b/tests/qemu-iotests/172.out @@ -15,7 +15,6 @@ Testing: fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -43,7 +42,6 @@ Testing: -fda TEST_DIR/t.qcow2 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -81,7 +79,6 @@ Testing: -fdb TEST_DIR/t.qcow2 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -135,7 +132,6 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -190,7 +186,6 @@ Testing: -fdb fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -230,7 +225,6 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -268,7 +262,6 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2,ind= ex=3D1 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -322,7 +315,6 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dfloppy,file=3DTEST_DIR/t fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -380,7 +372,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -devi= ce floppy,drive=3Dnone0 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -418,7 +409,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -devi= ce floppy,drive=3Dnone0,unit=3D1 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -456,7 +446,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -driv= e if=3Dnone,file=3DTEST_DIR/t.qco fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -520,7 +509,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -575,7 +563,6 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -630,7 +617,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -685,7 +671,6 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -749,7 +734,6 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -804,7 +788,6 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -865,7 +848,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -glob= al floppy.drive=3Dnone0 -device fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -933,7 +915,6 @@ Testing: -device floppy fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -958,7 +939,6 @@ Testing: -device floppy,drive-type=3D120 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -983,7 +963,6 @@ Testing: -device floppy,drive-type=3D144 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -1008,7 +987,6 @@ Testing: -device floppy,drive-type=3D288 fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -1036,7 +1014,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,drive-t fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -1074,7 +1051,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,drive-t fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -1115,7 +1091,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,logical fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" @@ -1153,7 +1128,6 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,physica fdtypeA =3D "auto" fdtypeB =3D "auto" fallback =3D "288" - isa irq 6 bus: floppy-bus.0 type floppy-bus dev: floppy, id "" --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646173068302791.4880318188153; Tue, 1 Mar 2022 14:17:48 -0800 (PST) Received: from localhost ([::1]:41304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPAoV-0003SO-9O for importer@patchew.org; Tue, 01 Mar 2022 17:17:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAYA-00028k-88; Tue, 01 Mar 2022 17:00:55 -0500 Received: from [2a00:1450:4864:20::62e] (port=41709 helo=mail-ej1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY8-0005Cg-1N; Tue, 01 Mar 2022 17:00:53 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a8so34276639ejc.8; Tue, 01 Mar 2022 14:00:51 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=avhaKv0OePo1BmfKI7VpTNy8hAfHuZrWFlrW2+mi2p0=; b=E5rqKahHI03rGYMPsXPex5WGFHLy3rmIxI0KE7RioNRvORijHchcN8FwxaPmvEB0jU zZE+nimiyeSxgxsM+l1ZnK6J8dz0B3b98sdhvnXj8K8k+aaDN+hZvSJsqRFNKNAHT1uD jim/yO6eP49lMynfTPECKXNZ2zpGUBDD5yf1oDE7ocqv9DqCFWzxPK6+J1HEn8aLJvZu gcT+VatQMhQDnJGd1mRWVGnr5+ODY1ya4gleUiXwgRLmZpW/3xKuOU3nC/uNaSkwQh+R 135k+jAHN3jFlz8tbgi0MmhHRit3fZp3kkHvYNrNAGUGOS2DzS4lAaIGMGo+ef75zJ12 FUSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=avhaKv0OePo1BmfKI7VpTNy8hAfHuZrWFlrW2+mi2p0=; b=4ALHJeaVDUVFtRVLqB+wlI86loz9n9/dJfVQLr7pvo8ptZyRArWwAWSbAb/OhsTjR0 21V87rhcaHkxat1TxbRUQ/kjE3qQEOexcPI6lscqGQvsRpJldEUt9upICi7kY15vA9kI sS+3riYUYkigFUgNx2yQRubEjFz0lGP7EEWLADR3g2dI9Bpy6YTdinFlKBt43VErEVRp XStY3bAy3bWFU/r6LIenLlgLq4HFvXAaAZq765KlMr4uOp63Bc0nL9CXAOc+MjhzUOLD 7PG4AjZHxDU1DO+x15oIQse7l7y+FixTH8YE5ghH9a+7de5BHKU3vnmOeeOD/DIytzUk 3/JA== X-Gm-Message-State: AOAM530PqS1WOCBbNpnf+FGXWNY3E1uIGa1aQNYdtXOZzOYtPsTs5ErG 9QjkykytI4oM7EBmi0tAxyaxNTFuBAc= X-Google-Smtp-Source: ABdhPJzBP/vmW+a2unZGRDVKBc5JF+8WS8KA6HgA6XPqXJyrdBY1tBuTtdmnO+8E8hWVn4f/Kf7+3g== X-Received: by 2002:a17:906:3a4f:b0:6cf:86e0:586c with SMTP id a15-20020a1709063a4f00b006cf86e0586cmr20577932ejf.626.1646172050340; Tue, 01 Mar 2022 14:00:50 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 5/7] hw/ppc/pnv: Determine ns16550's IRQ number from QOM property Date: Tue, 1 Mar 2022 23:00:35 +0100 Message-Id: <20220301220037.76555-6-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62e (failed) 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=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: "open list:PowerNV Non-Virt..." , Bernhard Beschow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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: 1646173070542100001 Determine the IRQ number in the same way as for pnv_dt_ipmi_bt(). This resolves one usage of ISADevice::isairq[] which allows it to be removed eventually. Signed-off-by: Bernhard Beschow Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/pnv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 837146a2fb..441bf958ca 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -380,9 +380,12 @@ static void pnv_dt_serial(ISADevice *d, void *fdt, int= lpc_off) cpu_to_be32(io_base), cpu_to_be32(8) }; + uint32_t irq; char *name; int node; =20 + irq =3D object_property_get_uint(OBJECT(d), "irq", &error_fatal); + name =3D g_strdup_printf("%s@i%x", qdev_fw_name(DEVICE(d)), io_base); node =3D fdt_add_subnode(fdt, lpc_off, name); _FDT(node); @@ -394,7 +397,7 @@ static void pnv_dt_serial(ISADevice *d, void *fdt, int = lpc_off) =20 _FDT((fdt_setprop_cell(fdt, node, "clock-frequency", 1843200))); _FDT((fdt_setprop_cell(fdt, node, "current-speed", 115200))); - _FDT((fdt_setprop_cell(fdt, node, "interrupts", d->isairq[0]))); + _FDT((fdt_setprop_cell(fdt, node, "interrupts", irq))); _FDT((fdt_setprop_cell(fdt, node, "interrupt-parent", fdt_get_phandle(fdt, lpc_off)))); =20 --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1646174249; cv=none; d=zohomail.com; s=zohoarc; b=E+LihSlNkAh30z+/Mvy7LLgcoVVW0j0FeZOOZsPz0HOBAva3iwqDci17kSDwOUVWs4LncSOZVIi+36u48lx1HYgJL4d4FIeMyIdcfIv2dFA6/iTWtJLvlXT5gd5DBqtDRFJBkopHBiKhddY2rwbvj/62Mecsh4ealM2E6wOFCOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646174249; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zlP9T1mK2I5fRBtiH7xTlDH5I9+xSh3L2bt71qh1bZc=; b=kn3KvHJYH+IWwzjqP5Vd9yvtJEiVfkWhlqkqTiXOC3dx4x+G9hgG7wQ6bxHWiQWr9G53ZtxHx8JBOKpmS2Lx3tiKZ2qOcVenZDcyBKo1VyQ9oePfB1vGHF9cN6JvGis5cBkJuqHbdURwr82PR0U/Tm+jIHsTypfN0mlhb9ZO8zY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16461742490594.769800713803988; Tue, 1 Mar 2022 14:37:29 -0800 (PST) Received: from localhost ([::1]:50972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPB7Y-0004Ci-9M for importer@patchew.org; Tue, 01 Mar 2022 17:37:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAYB-000296-Le for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:59 -0500 Received: from [2a00:1450:4864:20::634] (port=46606 helo=mail-ej1-x634.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAY9-0005D2-AX for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:54 -0500 Received: by mail-ej1-x634.google.com with SMTP id qx21so34212798ejb.13 for ; Tue, 01 Mar 2022 14:00:52 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zlP9T1mK2I5fRBtiH7xTlDH5I9+xSh3L2bt71qh1bZc=; b=gdf+hU/VKOg6C8KHn9/6sIZSWMbNWFthg6hnhYiAZsq8ykdEnSvwmtObrwf3A7mosV RwtmXgX+KfIZT3lRpKv1pOZlGAEDKFNHvVELCYp03IcVozPl+U9pO2ulwVbyWO2zZYAw gjJ9JAFnof/1a75DMOecO8bDeact2MdikXctvjkIDogLJf0vkYFrmVqUF0CLfpi5/9IC UXPGaH7N+05HSknwTL1AXalWUp0e4BBICLho6QWIgotruJ514XLfQxXPAg6BS/WZUVU9 YkdwXBR50g4gb90BmVKQzWYOBakQv20viE4Pjg9oYQ265g3+RvSJu6Hg01F/hXuNqa7s VVcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zlP9T1mK2I5fRBtiH7xTlDH5I9+xSh3L2bt71qh1bZc=; b=TTDtEfH7ghl3SkX286jvOJjV8eH9Eh0UcjWPSgiaWQJ/uw+45+ng7U8nyhsekFJ7af v8+HmorEBudcm3rEgpPphs8yOnX/cAqbR70bvvAg5PxXHfYkKYcmCmOGe9M93IV465Ig eogSSW2xBe2EWBErKDXSW/s1HuGEc/VLfck/IYwunHTGbUym2Z2/LfNFl7CLTq/mMFIQ XkNBozHeMBtbXqTHZPlXIwNnxKq+eBKUj7sf9jL+JMEdu+gKKUdWaTQ9sp+JDcXDk3zD L5pvUvhRUYxA0hioKykuEtvaIyxPiAX22fhOFWhkL2V41C/XYdsRFZFQ39TExw0ttX5k nmeQ== X-Gm-Message-State: AOAM531SSueC5/9mgQceSNcoU64wEXMgkKP1u9i8PIue6O/26C+RkvQ3 JByVxFcCe4yC1A5XMX3kKfNqUOm9/Jk= X-Google-Smtp-Source: ABdhPJyXDFZ25MQuZoDbmUcyczes+LnLr4acQIVIJwoIMwtm7GcEN7WFO8fm+xfrcWvsD8RT1v05Mw== X-Received: by 2002:a17:907:9719:b0:6d1:8c46:678d with SMTP id jg25-20020a170907971900b006d18c46678dmr20560611ejc.168.1646172051244; Tue, 01 Mar 2022 14:00:51 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 6/7] isa: Drop unused attributes from ISADevice Date: Tue, 1 Mar 2022 23:00:36 +0100 Message-Id: <20220301220037.76555-7-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::634 (failed) 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=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1646174250252100001 Now that the last users of ISADevice::isairq[] have been resolved during the previous commits, it can be removed for good. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/isa-bus.c | 13 ------------- include/hw/isa/isa.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index af5add6a26..c64a14120b 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -87,11 +87,7 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) =20 void isa_init_irq(ISADevice *dev, qemu_irq *p, unsigned isairq) { - assert(dev->nirqs < ARRAY_SIZE(dev->isairq)); - assert(isairq < ISA_NUM_IRQS); - dev->isairq[dev->nirqs] =3D isairq; *p =3D isa_get_irq(dev, isairq); - dev->nirqs++; } =20 void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) @@ -150,14 +146,6 @@ int isa_register_portio_list(ISADevice *dev, return 0; } =20 -static void isa_device_init(Object *obj) -{ - ISADevice *dev =3D ISA_DEVICE(obj); - - dev->isairq[0] =3D -1; - dev->isairq[1] =3D -1; -} - ISADevice *isa_new(const char *name) { return ISA_DEVICE(qdev_new(name)); @@ -244,7 +232,6 @@ static const TypeInfo isa_device_type_info =3D { .name =3D TYPE_ISA_DEVICE, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(ISADevice), - .instance_init =3D isa_device_init, .abstract =3D true, .class_size =3D sizeof(ISADeviceClass), .class_init =3D isa_device_class_init, diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index d4417b34b6..d80cab5b79 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -83,8 +83,6 @@ struct ISADevice { DeviceState parent_obj; /*< public >*/ =20 - int8_t isairq[2]; /* -1 =3D unassigned */ - int nirqs; int ioport_id; }; =20 --=20 2.35.1 From nobody Wed May 15 03:38:23 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646174103779526.8607144623177; Tue, 1 Mar 2022 14:35:03 -0800 (PST) Received: from localhost ([::1]:46368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPB5C-00010j-IN for importer@patchew.org; Tue, 01 Mar 2022 17:35:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAYE-00029H-JE; Tue, 01 Mar 2022 17:00:58 -0500 Received: from [2a00:1450:4864:20::534] (port=45821 helo=mail-ed1-x534.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAYC-0005DQ-3v; Tue, 01 Mar 2022 17:00:58 -0500 Received: by mail-ed1-x534.google.com with SMTP id g23so2876216edy.12; Tue, 01 Mar 2022 14:00:54 -0800 (PST) Received: from Provence.localdomain (dynamic-078-055-004-046.78.55.pool.telefonica.de. [78.55.4.46]) by smtp.gmail.com with ESMTPSA id v7-20020a056402348700b00415b38e920bsm182731edc.95.2022.03.01.14.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MFJZxqGtEKsVyYEyQja8UwrJm7SlWSmwFoQ8cAEjeqE=; b=Hh9IhrliRMJ257bBrFS7YdJndMgPHo5DIPoAWoDyeBgP+T5qI9tkd5BeNhNxIwU8Vm h+KgOxe8+l21djnC0iRc2leoGNpb00Df4sN/4FWohkK7uHCBWvjBik8Vd4ZiVquk38YT 6WW9QoZeUMohaa9TNlHviOb2JS7TSBsLfOQbjhNNI7ChqcsYv1o8ydIFpF3BjDgry99M Nhswxlstk2cWhnsNzaOhBwRVa8wIpU6u6nuqxjj7WSs/TPsB4mPDpRfBM9efwGnzRFeB x9iNSVAOf2Hch5updtIm8IYEHSJzp+P8p5Zy9/ZTtiUK+DLd0QWFUokZAWvAlcWL4GMS ZoMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MFJZxqGtEKsVyYEyQja8UwrJm7SlWSmwFoQ8cAEjeqE=; b=W4WtWI7ZPv9gOAvIjuAoMgKwG3IMMfwfCCSXkaTH718XZe+tA7KIOWgeWHKyb8KDJ1 JjC8c3DvzL3tfhIdPcuafxDaAJ6l4zXlQJ7Jjl0IlHUrl+O643qk0xPwzsT9JbWArwq5 gK1rdezGB6sQCnxe+d3IO4zmtlp0KiWG+816rebNyQBzufkpSOlL3jPEiYmA1P+hvIP/ tmF5QUd1nGOoYWwZrsCly0pWu4+umORn0xpHyJ4GItTI2Lm+7SPI/fyLdW26FbyBcDm9 zIuohhm7YzSzfhBqE6Q1EPEwu2b5aL1HzsVAs61RH/bbGTcngcHBmW8AFEINU3Cv85Mv 1Y5A== X-Gm-Message-State: AOAM533lVoE6KXfzFyBLargx6tuXA6uQz2vQEJeoXAAOKn3acRS9wdyD 6nKtCyoFc3moHv3M0pFJMZog3uu1HFM= X-Google-Smtp-Source: ABdhPJwo3EHuiKvSIQ2kQBWpthdsPa18xY7gFDJmYwLgWXwZ6nq0uB8o1RGKb97kbXQUlXYmQsh4gw== X-Received: by 2002:a05:6402:b62:b0:3e2:a75f:b949 with SMTP id cb2-20020a0564020b6200b003e2a75fb949mr26309288edb.62.1646172053465; Tue, 01 Mar 2022 14:00:53 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Subject: [PATCH v3 7/7] isa: Inline and remove one-line isa_init_irq() Date: Tue, 1 Mar 2022 23:00:37 +0100 Message-Id: <20220301220037.76555-8-shentey@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301220037.76555-1-shentey@gmail.com> References: <20220301220037.76555-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::534 (failed) 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=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Kevin Wolf , Corey Minyard , "open list:Floppy" , Corey Minyard , "Michael S. Tsirkin" , "open list:PReP" , Bernhard Beschow , Jason Wang , Stefan Berger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Hanna Reitz , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , John Snow , Aurelien Jarno , Stefan Berger 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: 1646174104938100001 isa_init_irq() has become a trivial one-line wrapper for isa_get_irq(). It can therefore be removed. Signed-off-by: Bernhard Beschow Reviewed-by: Stefan Berger (tpm_tis_isa) Acked-by: Corey Minyard (isa_ipmi_bt, isa_ipmi_kcs) Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Gerd Hoffmann --- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/sb16.c | 2 +- hw/block/fdc-isa.c | 2 +- hw/char/parallel.c | 2 +- hw/char/serial-isa.c | 2 +- hw/ide/isa.c | 2 +- hw/input/pckbd.c | 4 ++-- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/isa/isa-bus.c | 8 +------- hw/isa/piix4.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/rtc/m48t59-isa.c | 2 +- hw/tpm/tpm_tis_isa.c | 2 +- include/hw/isa/isa.h | 1 - 16 files changed, 16 insertions(+), 23 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 7d60ce6f0e..0723e39430 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -677,7 +677,7 @@ static void cs4231a_realizefn (DeviceState *dev, Error = **errp) return; } =20 - isa_init_irq(d, &s->pic, s->irq); + s->pic =3D isa_get_irq(d, s->irq); k =3D ISADMA_GET_CLASS(s->isa_dma); k->register_channel(s->isa_dma, s->dma, cs_dma_read, s); =20 diff --git a/hw/audio/gus.c b/hw/audio/gus.c index e8719ee117..42f010b671 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -282,7 +282,7 @@ static void gus_realizefn (DeviceState *dev, Error **er= rp) s->emu.himemaddr =3D s->himem; s->emu.gusdatapos =3D s->emu.himemaddr + 1024 * 1024 + 32; s->emu.opaque =3D s; - isa_init_irq (d, &s->pic, s->emu.gusirq); + s->pic =3D isa_get_irq(d, s->emu.gusirq); =20 AUD_set_active_out (s->voice, 1); } diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 60f1f75e3a..2215386ddb 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1408,7 +1408,7 @@ static void sb16_realizefn (DeviceState *dev, Error *= *errp) return; } =20 - isa_init_irq (isadev, &s->pic, s->irq); + s->pic =3D isa_get_irq(isadev, s->irq); =20 s->mixer_regs[0x80] =3D magic_of_irq (s->irq); s->mixer_regs[0x81] =3D (1 << s->dma) | (1 << s->hdma); diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index ab663dce93..fa20450747 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -94,7 +94,7 @@ static void isabus_fdc_realize(DeviceState *dev, Error **= errp) isa->iobase, fdc_portio_list, fdctrl, "fdc"); =20 - isa_init_irq(isadev, &fdctrl->irq, isa->irq); + fdctrl->irq =3D isa_get_irq(isadev, isa->irq); fdctrl->dma_chann =3D isa->dma; if (fdctrl->dma_chann !=3D -1) { IsaDmaClass *k; diff --git a/hw/char/parallel.c b/hw/char/parallel.c index b45e67bfbb..adb9bd9be3 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -553,7 +553,7 @@ static void parallel_isa_realizefn(DeviceState *dev, Er= ror **errp) index++; =20 base =3D isa->iobase; - isa_init_irq(isadev, &s->irq, isa->isairq); + s->irq =3D isa_get_irq(isadev, isa->isairq); qemu_register_reset(parallel_reset, s); =20 qemu_chr_fe_set_handlers(&s->chr, parallel_can_receive, NULL, diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 1b8b303079..7a7ed239cd 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -75,7 +75,7 @@ static void serial_isa_realizefn(DeviceState *dev, Error = **errp) } index++; =20 - isa_init_irq(isadev, &s->irq, isa->isairq); + s->irq =3D isa_get_irq(isadev, isa->isairq); qdev_realize(DEVICE(s), NULL, errp); qdev_set_legacy_instance_id(dev, isa->iobase, 3); =20 diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 24bbde24c2..8bedbd13f1 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -75,7 +75,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **e= rrp) =20 ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2); ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2); - isa_init_irq(isadev, &s->irq, s->isairq); + s->irq =3D isa_get_irq(isadev, s->isairq); ide_init2(&s->bus, s->irq); vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s); ide_register_restart_cb(&s->bus); diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index eb77e12f6f..1773db0d25 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -749,8 +749,8 @@ static void i8042_realizefn(DeviceState *dev, Error **e= rrp) return; } =20 - isa_init_irq(isadev, &s->irq_kbd, isa_s->kbd_irq); - isa_init_irq(isadev, &s->irq_mouse, isa_s->mouse_irq); + s->irq_kbd =3D isa_get_irq(isadev, isa_s->kbd_irq); + s->irq_mouse =3D isa_get_irq(isadev, isa_s->mouse_irq); =20 isa_register_ioport(isadev, isa_s->io + 0, 0x60); isa_register_ioport(isadev, isa_s->io + 1, 0x64); diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index 02625eb94e..88aa734e9e 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -92,7 +92,7 @@ static void isa_ipmi_bt_realize(DeviceState *dev, Error *= *errp) } =20 if (iib->isairq > 0) { - isa_init_irq(isadev, &iib->irq, iib->isairq); + iib->irq =3D isa_get_irq(isadev, iib->isairq); iib->bt.use_irq =3D 1; iib->bt.raise_irq =3D isa_ipmi_bt_raise_irq; iib->bt.lower_irq =3D isa_ipmi_bt_lower_irq; diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index 3b23ad08b3..afabb95ebe 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -91,7 +91,7 @@ static void ipmi_isa_realize(DeviceState *dev, Error **er= rp) } =20 if (iik->isairq > 0) { - isa_init_irq(isadev, &iik->irq, iik->isairq); + iik->irq =3D isa_get_irq(isadev, iik->isairq); iik->kcs.use_irq =3D 1; iik->kcs.raise_irq =3D isa_ipmi_kcs_raise_irq; iik->kcs.lower_irq =3D isa_ipmi_kcs_lower_irq; diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index c64a14120b..0ad1c5fd65 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -85,15 +85,9 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) return isabus->irqs[isairq]; } =20 -void isa_init_irq(ISADevice *dev, qemu_irq *p, unsigned isairq) -{ - *p =3D isa_get_irq(dev, isairq); -} - void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) { - qemu_irq irq; - isa_init_irq(isadev, &irq, isairq); + qemu_irq irq =3D isa_get_irq(isadev, isairq); qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq); } =20 diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index cb291d121c..0fd6756dcf 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -197,7 +197,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) if (!qdev_realize(DEVICE(&s->rtc), BUS(isa_bus), errp)) { return; } - isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, s->rtc.isairq); + s->rtc.irq =3D isa_get_irq(ISA_DEVICE(&s->rtc), s->rtc.isairq); =20 piix4_dev =3D dev; } diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index dd6f6e34d3..6ced6775ff 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -68,7 +68,7 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error = **errp) ne2000_setup_io(s, DEVICE(isadev), 0x20); isa_register_ioport(isadev, &s->io, isa->iobase); =20 - isa_init_irq(isadev, &s->irq, isa->isairq); + s->irq =3D isa_get_irq(isadev, isa->isairq); =20 qemu_macaddr_default_if_unset(&s->c.macaddr); ne2000_reset(s); diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index e9086eada4..e61f7ec370 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -106,7 +106,7 @@ static void m48t59_isa_realize(DeviceState *dev, Error = **errp) =20 s->model =3D u->info.model; s->size =3D u->info.size; - isa_init_irq(isadev, &s->IRQ, d->isairq); + s->IRQ =3D isa_get_irq(isadev, d->isairq); m48t59_realize_common(s, errp); memory_region_init_io(&d->io, OBJECT(dev), &m48t59_io_ops, s, "m48t59"= , 4); if (d->io_base !=3D 0) { diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index 10d8a14f19..3477afd735 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -127,7 +127,7 @@ static void tpm_tis_isa_realizefn(DeviceState *dev, Err= or **errp) return; } =20 - isa_init_irq(ISA_DEVICE(dev), &s->irq, s->irq_num); + s->irq =3D isa_get_irq(ISA_DEVICE(dev), s->irq_num); =20 memory_region_add_subregion(isa_address_space(ISA_DEVICE(dev)), TPM_TIS_ADDR_BASE, &s->mmio); diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index d80cab5b79..034d706ba1 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -90,7 +90,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *addre= ss_space, MemoryRegion *address_space_io, Error **errp); void isa_bus_irqs(ISABus *bus, qemu_irq *irqs); qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); -void isa_init_irq(ISADevice *dev, qemu_irq *p, unsigned isairq); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_get_dma(ISABus *bus, int nchan); --=20 2.35.1