From nobody Tue Feb 10 02:43:18 2026 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=1676205879; cv=none; d=zohomail.com; s=zohoarc; b=UBxkUyEmkPjZ8WNR7Za2xZ6nS4p+Mb0mM6r5asp+uXJUMLh+5qTMg3T1xPKZzRFERhJmVEuZ/WREsuLZn/g99I1cqTLlqtctAPCqWSZHYxmUF7hsjwWnhiaSM6FYAQx27ACFuzf12NL4JpZLN/MK3FDH+A1B44iC/ybvbJiS/pA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676205879; h=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=rKrRsDkllqa1UcMiw+lihF9so7EHz+czokZ7YhrJ3Ps=; b=oEy2MPDg7bzoCmlV8D9Ve50MITNenIWf9Zi+zod6WaNXmnc4aJySBcOuWFG+Whz+RhFpmvkphtLwQX11u3G7uKG3Y+NEs2/XMxOhQD0dQMYjP7unr4Fryfiw2u0ILyzfd9WwF54n33JPk6ue9AT/OnfFTLvBwLqyj72HyDXP4fs= 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 1676205879497505.9506927909107; Sun, 12 Feb 2023 04:44:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRBht-0004KW-JT; Sun, 12 Feb 2023 07:43:49 -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 1pRBdR-0007o1-T9; Sun, 12 Feb 2023 07:39:14 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRBdQ-0001Ip-32; Sun, 12 Feb 2023 07:39:13 -0500 Received: by mail-ej1-x62d.google.com with SMTP id c26so21082592ejz.10; Sun, 12 Feb 2023 04:39:10 -0800 (PST) Received: from localhost.localdomain (dynamic-077-011-172-153.77.11.pool.telefonica.de. [77.11.172.153]) by smtp.gmail.com with ESMTPSA id qw14-20020a170906fcae00b008af1f1bee79sm5233164ejb.9.2023.02.12.04.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 04:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=rKrRsDkllqa1UcMiw+lihF9so7EHz+czokZ7YhrJ3Ps=; b=VW3ylLqkQ8qp117fZlC11EFR01Ro0/zJYKfCHc8uG91/tLRd6qmIWHgiDLGfCWoyD9 etorBujg28+9V/Hv9UbHC7exF9kTVunpuh2yvBgXJjQ8Z7QNkWlZNLh0TflUXjK9+BiW R2dbT3oiZ8DvtDPVwKeLAI7Iwg7/rUKLcpOiAeI1YEjK8NbPFZ/JxlHPa7P08hz9BY7Q XIIn8FcJbY1dkFqGU2yCf+oHWiOIbzEU2Hh08v+ZB90hZ2U86+hsp9gZLZQEfrj1ed02 TzD4M0CGR/sYFKbQvaEyAQSpRfxWzIGMfa6TAga6TUHkmBd2Cp/vEirRlBcpl74ycuYj YYtw== 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=rKrRsDkllqa1UcMiw+lihF9so7EHz+czokZ7YhrJ3Ps=; b=0bs8JwOunSrkWkXCD0cv9sGrJeQk9ALI6imUN6WXlf6AXRKGCZxuqcm36OE/DTigyn OU1oeo70be2RIhMaBp2+UrjleOBGbbPck4C8auXk4eUpi0zsFTuV5hm83t5yskKEree7 Vr55SBus52zE4YwXK0otcV9ms2qKRjun1LojBOdrN3UezCzaG7FjtDn4tB2bTzl7sysK ZoWc398v3nm9D6kdTld4JIsQdQoYaeg8BVy4FFiWjtT6BKsHQnlPNIFK5u8V62xO3QwY Mpn3yVJO2f7FUg38z2EXow2g3ie0mv0usO0Igs/bBc3brjZe1XLyNT9Czws0Lzq0CBEY Lzzg== X-Gm-Message-State: AO0yUKUu1QvHcm8Q33aHi+0b6psVGEXPJeuUJXeMQTB7jknPjIGZzRIX Z4pksZPLH6Kqw8iq2jMW6dsaXRfSPQM= X-Google-Smtp-Source: AK7set9unLP8Z93qzZ+yq9Q3gVR2HvNiC6qw7/9wVD4yaixe0AaM9w9AhZ+g15iUFiGY3YOQx1CMqg== X-Received: by 2002:a17:907:208c:b0:878:8249:bef6 with SMTP id pv12-20020a170907208c00b008788249bef6mr20013277ejb.59.1676205549825; Sun, 12 Feb 2023 04:39:09 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-arm@nongnu.org, Elena Ufimtseva , qemu-block@nongnu.org, Richard Henderson , Jiaxun Yang , Peter Maydell , Gerd Hoffmann , Ani Sinha , John Snow , Marcel Apfelbaum , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Jagannathan Raman , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , John G Johnson , Bernhard Beschow Subject: [PATCH v7 21/23] hw/isa/piix: Rename functions to be shared for interrupt triggering Date: Sun, 12 Feb 2023 13:38:03 +0100 Message-Id: <20230212123805.30799-22-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230212123805.30799-1-shentey@gmail.com> References: <20230212123805.30799-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1676205880281100001 Content-Type: text/plain; charset="utf-8" PIIX4 will get the same optimizations which are already implemented for PIIX3. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20221022150508.26830-40-shentey@gmail.com> --- hw/isa/piix.c | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index 0177be6d6f..b0f0b42dae 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -41,47 +41,47 @@ =20 #define XEN_PIIX_NUM_PIRQS 128ULL =20 -static void piix3_set_irq_pic(PIIXState *piix3, int pic_irq) +static void piix_set_irq_pic(PIIXState *piix, int pic_irq) { - qemu_set_irq(piix3->pic[pic_irq], - !!(piix3->pic_levels & + qemu_set_irq(piix->pic[pic_irq], + !!(piix->pic_levels & (((1ULL << PIIX_NUM_PIRQS) - 1) << (pic_irq * PIIX_NUM_PIRQS)))); } =20 -static void piix3_set_irq_level_internal(PIIXState *piix3, int pirq, int l= evel) +static void piix_set_irq_level_internal(PIIXState *piix, int pirq, int lev= el) { int pic_irq; uint64_t mask; =20 - pic_irq =3D piix3->dev.config[PIIX_PIRQCA + pirq]; + pic_irq =3D piix->dev.config[PIIX_PIRQCA + pirq]; if (pic_irq >=3D ISA_NUM_IRQS) { return; } =20 mask =3D 1ULL << ((pic_irq * PIIX_NUM_PIRQS) + pirq); - piix3->pic_levels &=3D ~mask; - piix3->pic_levels |=3D mask * !!level; + piix->pic_levels &=3D ~mask; + piix->pic_levels |=3D mask * !!level; } =20 -static void piix3_set_irq_level(PIIXState *piix3, int pirq, int level) +static void piix_set_irq_level(PIIXState *piix, int pirq, int level) { int pic_irq; =20 - pic_irq =3D piix3->dev.config[PIIX_PIRQCA + pirq]; + pic_irq =3D piix->dev.config[PIIX_PIRQCA + pirq]; if (pic_irq >=3D ISA_NUM_IRQS) { return; } =20 - piix3_set_irq_level_internal(piix3, pirq, level); + piix_set_irq_level_internal(piix, pirq, level); =20 - piix3_set_irq_pic(piix3, pic_irq); + piix_set_irq_pic(piix, pic_irq); } =20 -static void piix3_set_irq(void *opaque, int pirq, int level) +static void piix_set_irq(void *opaque, int pirq, int level) { - PIIXState *piix3 =3D opaque; - piix3_set_irq_level(piix3, pirq, level); + PIIXState *piix =3D opaque; + piix_set_irq_level(piix, pirq, level); } =20 static void piix4_set_irq(void *opaque, int irq_num, int level) @@ -122,29 +122,29 @@ static PCIINTxRoute piix3_route_intx_pin_to_irq(void = *opaque, int pin) } =20 /* irq routing is changed. so rebuild bitmap */ -static void piix3_update_irq_levels(PIIXState *piix3) +static void piix_update_irq_levels(PIIXState *piix) { - PCIBus *bus =3D pci_get_bus(&piix3->dev); + PCIBus *bus =3D pci_get_bus(&piix->dev); int pirq; =20 - piix3->pic_levels =3D 0; + piix->pic_levels =3D 0; for (pirq =3D 0; pirq < PIIX_NUM_PIRQS; pirq++) { - piix3_set_irq_level(piix3, pirq, pci_bus_get_irq_level(bus, pirq)); + piix_set_irq_level(piix, pirq, pci_bus_get_irq_level(bus, pirq)); } } =20 -static void piix3_write_config(PCIDevice *dev, - uint32_t address, uint32_t val, int len) +static void piix_write_config(PCIDevice *dev, uint32_t address, uint32_t v= al, + int len) { pci_default_write_config(dev, address, val, len); if (ranges_overlap(address, len, PIIX_PIRQCA, 4)) { - PIIXState *piix3 =3D PIIX_PCI_DEVICE(dev); + PIIXState *piix =3D PIIX_PCI_DEVICE(dev); int pic_irq; =20 - pci_bus_fire_intx_routing_notifier(pci_get_bus(&piix3->dev)); - piix3_update_irq_levels(piix3); + pci_bus_fire_intx_routing_notifier(pci_get_bus(&piix->dev)); + piix_update_irq_levels(piix); for (pic_irq =3D 0; pic_irq < ISA_NUM_IRQS; pic_irq++) { - piix3_set_irq_pic(piix3, pic_irq); + piix_set_irq_pic(piix, pic_irq); } } } @@ -166,7 +166,7 @@ static void piix3_write_config_xen(PCIDevice *dev, } } =20 - piix3_write_config(dev, address, val, len); + piix_write_config(dev, address, val, len); } =20 static void piix_reset(DeviceState *dev) @@ -226,7 +226,7 @@ static int piix3_post_load(void *opaque, int version_id) */ piix3->pic_levels =3D 0; for (pirq =3D 0; pirq < PIIX_NUM_PIRQS; pirq++) { - piix3_set_irq_level_internal(piix3, pirq, + piix_set_irq_level_internal(piix3, pirq, pci_bus_get_irq_level(pci_get_bus(&piix3->dev), pirq)); } return 0; @@ -473,7 +473,7 @@ static void piix3_realize(PCIDevice *dev, Error **errp) return; } =20 - pci_bus_irqs(pci_bus, piix3_set_irq, piix3, PIIX_NUM_PIRQS); + pci_bus_irqs(pci_bus, piix_set_irq, piix3, PIIX_NUM_PIRQS); pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq); } =20 @@ -481,7 +481,7 @@ static void piix3_class_init(ObjectClass *klass, void *= data) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 - k->config_write =3D piix3_write_config; + k->config_write =3D piix_write_config; k->realize =3D piix3_realize; } =20 --=20 2.39.1