From patchwork Fri Feb 10 16:37:34 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: 652341 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059514wrr; Fri, 10 Feb 2023 08:38:53 -0800 (PST) X-Google-Smtp-Source: AK7set8s4UWlJ2WFiwIPLvg/8eYRCWWDg40ASTzlRT2hJSMXb4QrdugaRyh2MEPAbOpLPGqGdTEz X-Received: by 2002:a05:6214:f6e:b0:537:e563:c33 with SMTP id iy14-20020a0562140f6e00b00537e5630c33mr28552972qvb.14.1676047133098; Fri, 10 Feb 2023 08:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047133; cv=none; d=google.com; s=arc-20160816; b=qQJtuiGVHu9MdQOdXDZNUo6Oltt0IXzz2EVYLaHwujz5aJl2Fpi2efgbJFS9iwXJ2x MrgKV96k8rWTPGMrnjbh7a0yqbnGIsgJN/m7sRdQ0m2823MKVND5WRdoHfhUiWA26x2X hZ7miFifIlgaTuvJDvs/L88lDhl2LF+ovnQdEekRMIPrBdu5ce0sNcZi9JI33sV2YFL/ 9/AOew9qHWcZM3Wg/7EOTaH8EpO/Uaxf/z+HVqtryxXXJCMskJKCx8f9Q2glTWBtX1G5 1G0ExPzipaZRFDwmHdt2CO271rI1wI+ieVCK7fp4yra4h0Yy1yeEtBs3fI6VF6XkXTl6 OCpg== 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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=OnX/rgko73J0yvFprX3Sy9JhyFc2AzVVo4zy1NyWuiIN5C9qJWjCpW4lEcqc6yjoRD ORarcSBhjui73VUr9FUWsp+7/u0FFoVRYOo29MAAkoboqDB+GEqMn/DeYMLv8BFD1f3S 1CHWDDpOJBiousmWDhIdVwZoVTqemtgvEgptbbPV4zOIvZIl1cduc1T1OvQec4xbrkFn gh4IEflbIMq5uxuvHT1GBGQuR4X09LrgpomT6BzpSa9Z0GJTUOmm2CjeOq/5FQyBRLIw bMIOZyHEiylkNQGfIbRipj9jGpdj/El6W71YVQWDvtj+mjte0AeuCWYi+wMr1iRauG33 c5Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iNaBr1Jt; 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 z16-20020a0ca950000000b0056e9812162dsi851377qva.531.2023.02.10.08.38.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:38:53 -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=iNaBr1Jt; 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 1pQWPS-0000Oi-5C; Fri, 10 Feb 2023 11:38:02 -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 1pQWPK-0000OO-9E for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:37:54 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPI-00008K-G7 for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:37:53 -0500 Received: by mail-wm1-x335.google.com with SMTP id o36so4249824wms.1 for ; Fri, 10 Feb 2023 08:37:52 -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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=iNaBr1JtiKBuEPP9K33XyQEly/Bh6gg3B0lqoU27fmR9rHb2x0926RKsHnI8dWPFRY ZsySQhqZraW52yu7HCr2uDMeC4vHD+sMEH4cFtDR2qCf1mwAwHhwHPAj9meLzqiMdOdo 4nUDdwxyUWmZS0JWMDCP5C0It0PT+xtxH5gtGnvCMzgVS4T6oWafkIY0xx2CGEo9j9pW E5NgLOGLFMe//W5kyfIWifdk5JI112fqJPmiMBMAFBDQSbA+dK7NFHIf8l8WRKGU9Mdb L/T6TGGNLND0T8koDv1Z0TSHcoEIpWgjOJ+0HgV4BkmWe4lek/6dTS5oC81c12zoE/fH bhbA== 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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=7i8JoKZN08w51AcFGfBnofrskCHeoAjD+Tcqx+s8aRB8DnZRGkHndPEG/mIjnZYF3R INphokFIz1Kj24y9W4jwNTitWKDTK7LNv+wjHgGcQnct8bfU7kiuwrHf1r7MGqdUyR2O wHEHTujwvsWOtalkQ3yJpud/DC7A2r6lFxxN2n58wAAnJFczveBLmZAgf/P5+z7ZzTMd 6ULNHa3CGiXkvvz9RRUAvm6PNfb9X/2TZa6bWG+WHhSO8wYYTKgZjlmSKALwKTBZlaRx SxTsUXxIVnd0Kq+s9imOC3rLyOFkKmcppFMDIQ4p5hGFrX0nx/m1hN8P4yrvPvemy/DD HlCQ== X-Gm-Message-State: AO0yUKWhot7TGKOkwwLsAqFMJMGMoxXes096kqBwmDNff/pICC6AuF4H 11253h9WvdwOTeoRRhJa6/sa9VD/JI+7DvIJ X-Received: by 2002:a05:600c:3420:b0:3dc:4548:abe6 with SMTP id y32-20020a05600c342000b003dc4548abe6mr13354159wmp.12.1676047071696; Fri, 10 Feb 2023 08:37:51 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n19-20020a05600c3b9300b003daf7721bb3sm9399325wms.12.2023.02.10.08.37.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:37:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini Subject: [PATCH 01/11] hw/intc/i8259: Document i8259_init() Date: Fri, 10 Feb 2023 17:37:34 +0100 Message-Id: <20230210163744.32182-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org i8259_init() helper creates a i8259 device on an ISA bus, connects its IRQ output to the parent's input IRQ, and returns an array of 16 ISA input IRQs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/intc/i8259.c | 4 ++-- include/hw/intc/i8259.h | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 0261f087b2..17910f3bcb 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -406,7 +406,7 @@ static void pic_realize(DeviceState *dev, Error **errp) pc->parent_realize(dev, errp); } -qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq) +qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq_in) { qemu_irq *irq_set; DeviceState *dev; @@ -418,7 +418,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq) isadev = i8259_init_chip(TYPE_I8259, bus, true); dev = DEVICE(isadev); - qdev_connect_gpio_out(dev, 0, parent_irq); + qdev_connect_gpio_out(dev, 0, parent_irq_in); for (i = 0 ; i < 8; i++) { irq_set[i] = qdev_get_gpio_in(dev, i); } diff --git a/include/hw/intc/i8259.h b/include/hw/intc/i8259.h index a0e34dd990..c412575775 100644 --- a/include/hw/intc/i8259.h +++ b/include/hw/intc/i8259.h @@ -4,7 +4,15 @@ /* i8259.c */ extern PICCommonState *isa_pic; -qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq); + +/* + * i8259_init() + * + * Create a i8259 device on an ISA @bus, + * connect its output to @parent_irq_in, + * return an (allocated) array of 16 input IRQs. + */ +qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq_in); qemu_irq *kvm_i8259_init(ISABus *bus); int pic_get_output(PICCommonState *s); int pic_read_irq(PICCommonState *s); From patchwork Fri Feb 10 16:37:35 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: 652338 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059331wrr; Fri, 10 Feb 2023 08:38:28 -0800 (PST) X-Google-Smtp-Source: AK7set87SfESBQVDg96ojmuLtTu6kZy8lY9ExZwxnwGOsKQEAZzDuCLywpUjigi+C7rDHC7mK7DF X-Received: by 2002:a05:622a:1a03:b0:3b8:2dac:b5e1 with SMTP id f3-20020a05622a1a0300b003b82dacb5e1mr24285434qtb.37.1676047107879; Fri, 10 Feb 2023 08:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047107; cv=none; d=google.com; s=arc-20160816; b=t4MhiYGWwlKjm2yq8dZPF2VnbuemL6xtm9zl/+xN1Suq6TOZOFY57cc1hPoeya6wut erMG8jDZvF8IkNc26eGVjLg+lJ449GyTXFd2WBic3W6uDm+We0aRZKCVtHjjvr659FIc nPpJGT21zquMZCZsXZTaWCuiquWqEx2MvlbcgUG/Qx92eQdaWiUg2RxBbI6ePaOI/EUb Cd4eJyFb7iv7adJKph/JA9eA/B63UDHLlyhGz8TU0YcIYrbI/gIzSutq5CRcBn1lWEOw t4F/7ZDFH6xgviWqLWn84EArT9y3UV8cbCCpkuoRs+ir61VORHxkuIBA3RmUCnR1+53k umqQ== 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=xNlUpknHvw0osLPPGBJk+hOEoEjuFtxnaLdXgn2w/R4=; b=OKDIENzny1zAT8EGL5hNohIPanSsytSRWqg5VGqs44bsN09W+Ez3gx9KZCFe06gc6a uNvvhRHZ6gI3EoRuQZ1dxdKF1yOBZfA7HdFa5qHZIy2lslZdQYMZPie4irj/DxFZj2az AQYa19ALGknzSKLslEilFcwp7v5O1gc+DDopSGXmCYRMwDfrCIMhcG51dsKcEaoMyI9P /O4YpngHKNJJ89CginFVLGSUMiwUWzGQxkIw1P4A6PkspkkjWuRrU2SLa6yqGiEqzDec cMnB/3EDByT6e5rxCsHaOjA9kJj4Ihr7Y1+S6M9febj+UrSPxOaBgFaENx/4vSyS6Fag njqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vX/w/p/6"; 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 w15-20020ac857cf000000b003baf6a2b233si4042802qta.550.2023.02.10.08.38.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:38:27 -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="vX/w/p/6"; 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 1pQWPU-0000Re-85; Fri, 10 Feb 2023 11:38:04 -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 1pQWPR-0000Ow-Sb for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:02 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPP-0000BB-At for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:01 -0500 Received: by mail-wm1-x330.google.com with SMTP id r18so4223142wmq.5 for ; Fri, 10 Feb 2023 08:37:58 -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=xNlUpknHvw0osLPPGBJk+hOEoEjuFtxnaLdXgn2w/R4=; b=vX/w/p/6O5JBsyxWOZmL3GOzN+zJsYokWdjeQFcq+omHmB+nnO2CwOcPe/lnzLf5JR jh4cKYI4EMe0vp0LPii0th6alavptAn/nmxKFOsVJJDNN2/WMMrgkYocsKOrutLv+lS5 OgxvCVUBm/gLccdHwl/ZGMwePW8+kmXI+GgQ11eK3bTLa7799y4Qc2dP4FP1dnKGfaYN lwbFiW8tllrc1Dnz7Z2wBJxLqR02Ag/F7DZKOc2xk/ta7gKdgul5FwutsbLMgGIEg5jr Of2E8Mqc8bIGyXJzwaRojEK4kw9fOj1Gc//2gDz8XjV4B20TiOmS6wJgexPnC3SAsrQQ 3mzQ== 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=xNlUpknHvw0osLPPGBJk+hOEoEjuFtxnaLdXgn2w/R4=; b=7R/CBAnT3V1dMe2lJ96aP71zB0JOLB2dB+5kRVJ0P74bTfi+rzRHbiCQwYDd2TVBGh nWVS6mZJvw6+MmrkD8a96VyMujh7GKT8EDscMjsH7vJczwiaEqlpTMEA55z7drGHnSdX 72g+y2IrHfDH8GUm5s7OGmONHxdNatSdi9IdRIXArxRHCbuDQpi7e61MCsdOExujmgyr kHKl8mHX77zWacOxzkNZIpMAefIm8I0eyJO+9EUZPWE/W0Snv9WVmL21E4Us7QDtQp/j VEMygzTJ1+jm8WJsFRR5gmciNzScZQu09Mwq6rZ/KeZWgzfm22t6fyb+C8h6eO7qcu8D 4dFQ== X-Gm-Message-State: AO0yUKV32YhKLkqHqZOEYmK4TW+DlSmYGeJCcfTeUZlrzztgJg4L5Oct OE1IxEypR+21ekOtg6sL1gspXclEjBhlHUdr X-Received: by 2002:a05:600c:81b:b0:3c6:e63e:23e9 with SMTP id k27-20020a05600c081b00b003c6e63e23e9mr16782869wmp.24.1676047076763; Fri, 10 Feb 2023 08:37:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e19-20020a05600c439300b003dd7edcc960sm5239763wmn.45.2023.02.10.08.37.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:37:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv?= =?utf-8?q?=C3=A9_Poussineau?= Subject: [PATCH 02/11] hw/isa/i82378: Rename output IRQ as 'cpu_intr' Date: Fri, 10 Feb 2023 17:37:35 +0100 Message-Id: <20230210163744.32182-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Commit a04ff94097 ("prep: Add i82378 PCI-to-ISA bridge emulation") aimed to model the 2 output IRQs: CPU intr and NMI. Commit 5039d6e235 ("i8257: remove cpu_request_exit irq") removed the NMI IRQ. Since this model only use the CPU interrupt, replace the 'out[2]' array by a single 'cpu_intr'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/i82378.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index e3322e03bf..84ce761f5f 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -32,7 +32,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(I82378State, I82378) struct I82378State { PCIDevice parent_obj; - qemu_irq out[2]; + qemu_irq cpu_intr; qemu_irq *i8259; MemoryRegion io; }; @@ -50,7 +50,7 @@ static const VMStateDescription vmstate_i82378 = { static void i82378_request_out0_irq(void *opaque, int irq, int level) { I82378State *s = opaque; - qemu_set_irq(s->out[0], level); + qemu_set_irq(s->cpu_intr, level); } static void i82378_request_pic_irq(void *opaque, int irq, int level) @@ -113,7 +113,7 @@ static void i82378_init(Object *obj) DeviceState *dev = DEVICE(obj); I82378State *s = I82378(obj); - qdev_init_gpio_out(dev, s->out, 1); + qdev_init_gpio_out(dev, &s->cpu_intr, 1); qdev_init_gpio_in(dev, i82378_request_pic_irq, 16); } From patchwork Fri Feb 10 16:37:36 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: 652347 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1060001wrr; Fri, 10 Feb 2023 08:39:47 -0800 (PST) X-Google-Smtp-Source: AK7set8fXhFGzNVNS/9A9jtzQlQqd1BkXuaHhbOEVcYWi7DAJLaQkioJ8UJF0AML9PpIdGx542v1 X-Received: by 2002:a05:6214:411a:b0:56a:bccd:3703 with SMTP id kc26-20020a056214411a00b0056abccd3703mr26870467qvb.16.1676047187118; Fri, 10 Feb 2023 08:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047187; cv=none; d=google.com; s=arc-20160816; b=INTAjnYznkHDhxetFHvXpmb8K1mpPi0N8/WvkrZ6pBpGZY/sKNhAxxO0C2i3vrmhB0 s5JdaMYdIf+xtfRha+8jEj5QgaMBnWVilEZBZj9D66Bnl1aYjs7HJyyJ63da6bXczlRT JrIsW4q+CSIiqTvEPKRmnEOcT11/D+GLsyobdV5KK6gg0CFnKt2LKO9K38WEWljt6v3f 8aNkBhuFEeIx5pyOxyONy6BHvRU+JgBbjolW4OlgMhdHrJo3t/GVn33K8R6XRm3ROw6R eV8VvGLjRADAhK1xIvau/8DT6aUWrYfKvxhKGfvyoXnvzvi+B4i73WI9Z0EFSZ73yqJs 6vxA== 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=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=KIuZ6maoVTPcpUl/mP1BEi9SCotsHciyQe/SX5YJH/CA/zf8cHlQXjYEo7QRoSryVf 2dG0jLMIeqrJJ/oWjxWyE6cIkRTVf2i7M0PHxlV7Ur8voE5QkdkHbKsBDRxW7IK8rKQD xepCyjRR+/q0LNfNOi8YC8jpa3nagd3lxHDRuDmQwmEg4cXN86IZxTOV3Wg8qDHVqpsN pRkgGMrxbFgvp2ybAqDqyuBaBn2tpFgRTz/63xYTzsgo5XbCkn3GzBKX8IzN6ar1jmFk k/lQU7UtHl3ODf8J+dd68Q/91/EfXkzwJBijNLY8qlTGNT9EJ3ULbW/FiIqsHySmGTpp kbYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u9nXTa6m; 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 h20-20020a0cf414000000b0053c64c47019si4012701qvl.55.2023.02.10.08.39.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:47 -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=u9nXTa6m; 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 1pQWPY-0000TE-6I; Fri, 10 Feb 2023 11:38:08 -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 1pQWPV-0000Ss-Qw for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:06 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPT-0000Em-Ht for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:05 -0500 Received: by mail-wm1-x32b.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so5666027wmp.1 for ; Fri, 10 Feb 2023 08:38:03 -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=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=u9nXTa6mcNBWa1ZNMJ3Io03hGIfjuQdBPU/OS7at8pCfnBCn03BYXbv+fvkwtFEgpi TQIkVF3rwcyU3FCDBB301p5z16i/W6wQ5bWCLTO8K0UBulc/jjZK8kTTC8qOuPHFUON5 OObA+gqBzNWmykBvIGywMWRv1Xvicvl/U+iV6yVwmP9zTej6hnZ+q4nQ/3dEGrPosEFm Olu8jI8zND7DaSB+ddvjINv8nWMm34H7yHGFhVgsGERj+XbpKEDPEycPiZ5J1vTnJHCT Od2xGw+nx9lF0W1Mx29MkOdBsMrurxWC7N4xO5slwujcFfZN/kr4S++HU++ElcQOdfKt IxWg== 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=a2K/4sNW5W4Rl4jasLMZHv15T8ERXUsmy69mOw2i5LA=; b=shuBDieX3VLlXTTn8d0PtcipAxCv+JkyCave5i4Vi6uMIPE8xD5U5P3uVZ7IG+/MEz C5qxXtpsdkBIRag+2uucoCUrYcSrAbqJdNIuuIr/xL8l368ghSOyFvgLh4Rg4V9s7jjh P6sYVGygQmK8KHutduBjJ8+ilmhpzMc+sWvi3lB+BGOGFk1h2QV0LOllIrTgxFNV5oyr YJsTIX51QUelKn/+iAGxzjRu3biGtRN+asWhZrBbSmj6e5o/giQMYsm73xvOsCQn59dW ciHErHIsM28JsLehNKQooxjE/YQVh8PGSFa2CRjbUCdVIst3Pz5rJxZdsqNH6cj49aRW 4paw== X-Gm-Message-State: AO0yUKUp7MKYQusynrMGcLgXYzayvqUOCRwyR3u4FbwlNejFd/fbCZCT bUi96I/0c+thTI5K5FPUZTGuSF2IKm7/6dRE X-Received: by 2002:a05:600c:4910:b0:3dc:440f:8e9d with SMTP id f16-20020a05600c491000b003dc440f8e9dmr13754005wmp.0.1676047082115; Fri, 10 Feb 2023 08:38:02 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l4-20020a7bc444000000b003d9fba3c7a4sm8034390wmi.16.2023.02.10.08.38.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv=C3=A9?= =?utf-8?q?_Poussineau?= Subject: [PATCH 03/11] hw/isa/i82378: Remove intermediate IRQ forwarder Date: Fri, 10 Feb 2023 17:37:36 +0100 Message-Id: <20230210163744.32182-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 From: Philippe Mathieu-Daudé When the i82378 model was added in commit a04ff940974 ("prep: Add i82378 PCI-to-ISA bridge emulation") the i8259 model was not yet QOM'ified. This happened later in commit 747c70af78f ("i8259: Convert to qdev"). Directly dispatch ISA IRQs to 'cpu_intr' output IRQ by removing the intermediate i82378_request_out0_irq() handler. Rename ISA IRQs array as 'isa_irqs_in' to emphasize these are input IRQs. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/i82378.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 84ce761f5f..d32653369d 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -33,7 +33,7 @@ struct I82378State { PCIDevice parent_obj; qemu_irq cpu_intr; - qemu_irq *i8259; + qemu_irq *isa_irqs_in; MemoryRegion io; }; @@ -47,18 +47,12 @@ static const VMStateDescription vmstate_i82378 = { }, }; -static void i82378_request_out0_irq(void *opaque, int irq, int level) -{ - I82378State *s = opaque; - qemu_set_irq(s->cpu_intr, level); -} - static void i82378_request_pic_irq(void *opaque, int irq, int level) { DeviceState *dev = opaque; I82378State *s = I82378(dev); - qemu_set_irq(s->i8259[irq], level); + qemu_set_irq(s->isa_irqs_in[irq], level); } static void i82378_realize(PCIDevice *pci, Error **errp) @@ -94,9 +88,8 @@ static void i82378_realize(PCIDevice *pci, Error **errp) */ /* 2 82C59 (irq) */ - s->i8259 = i8259_init(isabus, - qemu_allocate_irq(i82378_request_out0_irq, s, 0)); - isa_bus_irqs(isabus, s->i8259); + s->isa_irqs_in = i8259_init(isabus, s->cpu_intr); + isa_bus_irqs(isabus, s->isa_irqs_in); /* 1 82C54 (pit) */ pit = i8254_pit_init(isabus, 0x40, 0, NULL); From patchwork Fri Feb 10 16:37:37 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: 652344 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059792wrr; Fri, 10 Feb 2023 08:39:27 -0800 (PST) X-Google-Smtp-Source: AK7set82igmHEmFvNm4GWqa+oTa/zWJ5gqJfj6k0izDZiT9C3RehkVVZTsy6zIcJipk/KOc0IXkd X-Received: by 2002:a05:6214:c2b:b0:535:1d24:2c5a with SMTP id a11-20020a0562140c2b00b005351d242c5amr27758115qvd.31.1676047167098; Fri, 10 Feb 2023 08:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047167; cv=none; d=google.com; s=arc-20160816; b=JM5r7yopx/+x90gu/81uAKXyWpZbHrw/DkxprL0SOQ0IHWoszjPdJCN8I2+O4qdoNO Md1GiC1lrnWL6SxOTAZoF6H3nx9mGcJ2D4HPVg4dttqihhOt+Jg/4wSIKQeLgaqdK0HD R5feh6p0kWkzNIKgtTXsEF94ZQ0dX5ErBr3gw8T/IjvjtP/mARSFvXF8n0wEot4Ubh1N PngjnEa4SODYWMcbdI95CKjw7dBZwxTg/iL584Siqum7OoNsHPdDHqFg2MJ5hnqNaLlT oti7VAKzEdZ9JEYMdXwfcYRjgYdrKP2EyHstbJxP9801NzYYMzEfdvsfZPU6xOGvFBpJ /cgg== 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=tAEskSQoIREJd0prgZX4+7TZ4EJFCBxdpEPk1pPdPMY=; b=NIQVRMhMRv4VH6gmfnUU8lc3t6CRDv7ZUU/LYNZJbrczNbH/lqIKYmnk6pG00gUQud zjKTtKfJ3XhfL5ctAMyMKm9PBQ/nhZq/IT0y1ZTBec6qXkXz21NcH/FvO9gqvH2fzuCq 18tN7pio3gMHpGoyZHhnqMcyzI0hXSX6bVHxMpemgaf+QHo0Y/4CgvES0EkSN5pvvE5o N1qpkDswV6CP/t1LwoVccJ7LKibL1PHX9QtNirRz7KOmLomeYVfgDTtZwTFzFNsMF2Bt 7Nw/soMNRb55CEjxcelRhK2NeoS8+x41Rkck9y5acMzQAfKD9HKyRfIuxQ8IsxhlFLJC R0bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hEiJbTLU; 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 u11-20020a05620a430b00b006fef612fcfesi4308494qko.23.2023.02.10.08.39.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:27 -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=hEiJbTLU; 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 1pQWPj-0000gt-Hn; Fri, 10 Feb 2023 11:38:19 -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 1pQWPa-0000Y5-KK for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:12 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPY-0000G2-RK for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:10 -0500 Received: by mail-wr1-x436.google.com with SMTP id bu23so5612599wrb.8 for ; Fri, 10 Feb 2023 08:38:08 -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=tAEskSQoIREJd0prgZX4+7TZ4EJFCBxdpEPk1pPdPMY=; b=hEiJbTLU1hRmpzn+EbxZxEEocXV6+FKcv+TMay1NE4ZVuwqoQ4JuIHzBg6nNdts845 idca82N3dnJBIPw6L+sfz4QMPH3IutaKYx7mjgaf9UcFKT9tZ6IHmAiG0rpviHdNGpAT bJwk+0OCayOw7wzOVPrFwWWHMYu/3QkOdg5Ewfnp7I4pQ1WghSTkqYm5nifUokAfgJh7 EnV/RiCW2ivAJihRBEErWG1xV3+pQSSvhaig3Nn4M7dDDBmcGZWa9Y7nGDP1hek3rCz+ H0qJK7IGzX2eke4V6zjKUMXXHCWDppu3x3X+8X0hkgeTt7PSbur0kCNYxulJX8ffglxg q5Zw== 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=tAEskSQoIREJd0prgZX4+7TZ4EJFCBxdpEPk1pPdPMY=; b=y+it0DJYtRa4zcRKWIyxg+lCuB7wneD/AcNCIqbBkGqbqHMI9FhQYJ+IAfS2Wx7Ryj +uynyO//UgTC6rNTJC99N5+yx68ahQEHYlnX9v7Aj1ovbeaHapPVV3TV7KHd/ufyGgGa Q/VipfeXySmxGpkCy9sUQK+Rol4zpkIeN3TcG0vkxK1WVKLedJmRhSQhFw8NLipOLfnw bX0SoiZoJTe7WQQtTOwRFwynxc7nGUjmScCpWLJrh5KEOFdq9QhOJZVFcZmGJJzOkVJz mXb1XZ6mZJkDqPqlAPIjgH0lz0UGspF9KhiesAbb5CfrHWgYDYTcYs9mEXYJH7KtowGB wVMQ== X-Gm-Message-State: AO0yUKV1d2ey1pJ5P6CQdcQW+jJCFQXXIsA2zudLYR57qvMo6i1aVrtu VfUcCKJRz69lmg5f4RIRARA7hu3btRfIqm1G X-Received: by 2002:a5d:6110:0:b0:2c3:dfcb:afc4 with SMTP id v16-20020a5d6110000000b002c3dfcbafc4mr13268708wrt.27.1676047087087; Fri, 10 Feb 2023 08:38:07 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p3-20020adff203000000b002c3f6d7d5fesm4086640wro.44.2023.02.10.08.38.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 04/11] hw/isa/vt82c686: Remove intermediate IRQ forwarder Date: Fri, 10 Feb 2023 17:37:37 +0100 Message-Id: <20230210163744.32182-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 From: Philippe Mathieu-Daudé Directly dispatch ISA IRQs to 'cpu_intr' output IRQ by removing the intermediate via_isa_request_i8259_irq() handler. Rename ISA IRQs array as 'isa_irqs_in' to emphasize these are input IRQs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 3f9bd0c04d..a913a509f7 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -548,7 +548,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ViaISAState, VIA_ISA) struct ViaISAState { PCIDevice dev; qemu_irq cpu_intr; - qemu_irq *isa_irqs; + qemu_irq *isa_irqs_in; ViaSuperIOState via_sio; RTCState rtc; PCIIDEState ide; @@ -595,13 +595,7 @@ static const TypeInfo via_isa_info = { void via_isa_set_irq(PCIDevice *d, int n, int level) { ViaISAState *s = VIA_ISA(d); - qemu_set_irq(s->isa_irqs[n], level); -} - -static void via_isa_request_i8259_irq(void *opaque, int irq, int level) -{ - ViaISAState *s = opaque; - qemu_set_irq(s->cpu_intr, level); + qemu_set_irq(s->isa_irqs_in[n], level); } static void via_isa_realize(PCIDevice *d, Error **errp) @@ -609,12 +603,10 @@ static void via_isa_realize(PCIDevice *d, Error **errp) ViaISAState *s = VIA_ISA(d); DeviceState *dev = DEVICE(d); PCIBus *pci_bus = pci_get_bus(d); - qemu_irq *isa_irq; ISABus *isa_bus; int i; qdev_init_gpio_out(dev, &s->cpu_intr, 1); - isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d), errp); @@ -622,8 +614,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp) return; } - s->isa_irqs = i8259_init(isa_bus, *isa_irq); - isa_bus_irqs(isa_bus, s->isa_irqs); + s->isa_irqs_in = i8259_init(isa_bus, s->cpu_intr); + isa_bus_irqs(isa_bus, s->isa_irqs_in); i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); From patchwork Fri Feb 10 16:37:38 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: 652346 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059956wrr; Fri, 10 Feb 2023 08:39:44 -0800 (PST) X-Google-Smtp-Source: AK7set96WDzqNyyIIApQz0hlaIg5bNoqFg0cAlYRausnzjPlej8pEXPPQN/7QNT6S/5lGnzZQBP4 X-Received: by 2002:ac8:5948:0:b0:3b9:bf7f:66ff with SMTP id 8-20020ac85948000000b003b9bf7f66ffmr24639845qtz.67.1676047183823; Fri, 10 Feb 2023 08:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047183; cv=none; d=google.com; s=arc-20160816; b=bdBzHv8G2EU74V7YA8NY7IYNiV/dw9Mtf/0YbjloGyKJyRAmPsUTkCYr2UBvwg24/T x4p4BIAoze7u5Uk7+y1uI7b3FUMRO55dPvl9rSVW1OwIJfG0NO+t8sKLMWYO++SZOHOC li6FOOS76s2sTLhFvU6Qm95HTIuUo9k/xXinRow71AaajSCCR6HdO8zdAwTr4d2ab7HJ HvSVTSKHMU/601I/QSgwgwK9phfogN1S7QltFP/JayYlxkIWZKfZaG9vMpK/hCki8xGL X155DLF3tvBQcSTwalQy808weqdosq4lQ+cb9f9O5Fpgs8nHt+rlewkGaiO5M4MrhoCs l6kA== 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=AoAgqkkVaW/90nUxacTI0iLIaEIQyrnwnsSs7qVHgZI=; b=qBiraGZ+0GyQ7jnK9G3A3tnIivsSwkvWFCi+BJx5zIdAmHMhz/gOO+zqoWN+o3nRIW BmS5MaJmx95nSlpI+GNd9/jpQV1gF5nIU6Mg04sTUT+YgpU/ZVM7uaB5dc3VZtJyPq7C lJNEz/BPM2MzDqjoVX30qx/+YYhWqeAUur6HMcLOoQpWJK263xVVllJfS5wHzxAQXs64 B4h0k+CIaD7ydMhzp/2cpb1BEcSwqW5Ic9TwIFZa7o/nn+HMYBr7uc1UmXEVbPtUzE1H J8EjMIAyu2I6jg3pHpJsgBcnZFWL4Lsi8oHBs70/tK5f1DnGuQXeQlHKGmIDiQ/X0Faj YOLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="h/VgQ1mx"; 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 s2-20020a05620a0bc200b0071c4505e1dasi4370516qki.555.2023.02.10.08.39.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:43 -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="h/VgQ1mx"; 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 1pQWPl-0000yP-Cx; Fri, 10 Feb 2023 11:38:21 -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 1pQWPh-0000gz-Vk for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:19 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPg-00008w-Cu for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:17 -0500 Received: by mail-wm1-x32d.google.com with SMTP id bg26so4278105wmb.0 for ; Fri, 10 Feb 2023 08:38:12 -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=AoAgqkkVaW/90nUxacTI0iLIaEIQyrnwnsSs7qVHgZI=; b=h/VgQ1mxtjpmlfyI6vqQAuS3QYkgq5B2uf+HVCT2KccHs39TESlkSOCk1euN7ognzZ yUFx2OAm8Bh4Qe/tWSPrq+TloufGjebkKamwLDGcw7UThdB/KlZCYKZ42WqggndsIt1o Tvu/IyTNVYqQWFzUZULT2Z0RGeAa3CSF4Zo6pYqYVaQKYD42vwC7ssK8n7gH6fOM1Yb8 VjTaNIOO++IDPZT7cSIBPmQMIbg34yIzw8Jmc6Siyd2Ny402Ef11MDqRV91xNa98+Pod t1+oTAxnA4ODOZ8WCY/gfqa0N1K5mqhWOG4f4UHtDOkzSVUwx6C0jvQRmgcZeYRqvAIa dA0A== 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=AoAgqkkVaW/90nUxacTI0iLIaEIQyrnwnsSs7qVHgZI=; b=Rt4EasstF3VkZNoI9rmSk5IvSbBD5+PY1R3FY/8PF/Qw4E5fpAE0tSFmVXdIziy27x qZbxijQFm5d7HPFf+GASjILhCstTqpXjALCVVHnx//ZKl1+hLS78afhx2kM0TcgA0iC4 UDzDFUk1+7t+A7EXl+SqJA9y8E2Lhi4Mlsec96llyTT47hf+A85GQaCCNZPP3fp6Apfe or9nvmc4Pa1rwvNi2t8qwSlOO9iNIe25TjakuO104KhsQXTm2m5Ru9xcI1d4Xnedg6ed ILR79ABlfj40FtBYA5wjSICZPkSBaBMLkDQt3XiCeebC5/sYjJEcaLovXrPF0BqIDRjO qz8Q== X-Gm-Message-State: AO0yUKWl6c28xHRm9n00ETExSFMZ79zqoH3l7lrSLl4btrF+vJW8Kw55 j8TM/adjYK8PeZ7e+JtwMTj7QsbC7sqdFQar X-Received: by 2002:a05:600c:308a:b0:3dc:43a0:83bb with SMTP id g10-20020a05600c308a00b003dc43a083bbmr13562208wmn.3.1676047092078; Fri, 10 Feb 2023 08:38:12 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p1-20020a1c7401000000b003cfa622a18asm8969649wmc.3.2023.02.10.08.38.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv?= =?utf-8?q?=C3=A9_Poussineau?= , Aleksandar Rikalo , Jiaxun Yang Subject: [PATCH 05/11] hw/mips/jazz: Rename ISA input IRQs as 'isa_irqs_in' Date: Fri, 10 Feb 2023 17:37:38 +0100 Message-Id: <20230210163744.32182-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The following code: /* ISA devices */ i8259 = i8259_init(isa_bus, ...); gives the false idea that the function is creating a i8259 device. Instead this function returns an array of input IRQs. Rename the variable to clarify: /* ISA devices */ isa_irqs_in = i8259_init(isa_bus, ...); Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/jazz.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 6aefe9a61b..fc7898006c 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -130,7 +130,7 @@ static void mips_jazz_init(MachineState *machine, MIPSCPU *cpu; MIPSCPUClass *mcc; CPUMIPSState *env; - qemu_irq *i8259; + qemu_irq *isa_irqs_in; rc4030_dma *dmas; IOMMUMemoryRegion *rc4030_dma_mr; MemoryRegion *isa_mem = g_new(MemoryRegion, 1); @@ -248,8 +248,8 @@ static void mips_jazz_init(MachineState *machine, isa_bus = isa_bus_new(NULL, isa_mem, isa_io, &error_abort); /* ISA devices */ - i8259 = i8259_init(isa_bus, env->irq[4]); - isa_bus_irqs(isa_bus, i8259); + isa_irqs_in = i8259_init(isa_bus, env->irq[4]); + isa_bus_irqs(isa_bus, isa_irqs_in); i8257_dma_init(isa_bus, 0); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk_init(isa_new(TYPE_PC_SPEAKER), isa_bus, pit); From patchwork Fri Feb 10 16:37:39 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: 652345 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059775wrr; Fri, 10 Feb 2023 08:39:24 -0800 (PST) X-Google-Smtp-Source: AK7set+JkJ/6ib4qVjoB7BiJdHi5Ng5L+U5x8p8hpNPQLT4t5Edu0rboeNpN3Y2+QfOX5AwTpJC8 X-Received: by 2002:a05:622a:1346:b0:3b8:6ae9:b104 with SMTP id w6-20020a05622a134600b003b86ae9b104mr26815748qtk.17.1676047164122; Fri, 10 Feb 2023 08:39:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047164; cv=none; d=google.com; s=arc-20160816; b=mkrQuaeRvV5nhkCMR7vV8wlmXw46jCVbJp6Vzlt2WEKzwAcPFf3Yh8emptXewLDutg aqvReq7cJMWMbMRsWWGlycfjTfDYR2B4Gz0akM9czIaDxPFp3+04yLZWgsp+umxetJ5o USPY7/dSeD7MeLJdekjZG0aM7a5X+EHOS5muWGFRUD+aYErrUF8tIqd7KlkcQluN3PL7 znd/LeqhyAs1A6/WaRwm0THjWiQfBk8iovr5mGdmSXC11UZonVeIzQ7dRqXalG+aFMLS zkOmEKr8pca7xGlGesm20+wvxZX2scrkpxz9PuxhA7dQYZUrkJVNXqom37JPtEU+61AG F2UQ== 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=PEO0iz2+8eqHQfeG9sdi6MqymoLkqqNq3DUXOt6Jl6Y=; b=ChbDue8MWLt1jeKnRk+Kw7Z0kqhIcH00PwbPux6bBrlb7w1gqaXZzVMcj6iJuX5Yzm ByznSrbdcQjj9eD54PxRa20zY/06s9c0k98buHeUuHut3VvOnnD6nNYmZxBU1GDJ6rU/ bxuKCWirkTd0G2iEuyw5kphjfZAY2GoW6Z08b/X5EFaylLIplLEqM+YASRaXGU8JWMLs Oa/RT9CCsVmsNLh4W0gWaSo1N8zodsGxB8LjxiAc9CZqXHXQuFr4lXSYttIfinIUla+t KIiYfD3aYPesn5AWyqKPBMJOChYCx/pG0xC/9ZgcyrR6yZI3onLe+RIO2E05+n2g7Rrk HDnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j1qSxQ+k; 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 u12-20020a05622a14cc00b003b82e92b364si4557538qtx.503.2023.02.10.08.39.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:24 -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=j1qSxQ+k; 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 1pQWPl-00010E-IJ; Fri, 10 Feb 2023 11:38:21 -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 1pQWPj-0000k8-Bc for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:19 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPh-0000B9-Ot for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:19 -0500 Received: by mail-wm1-x32f.google.com with SMTP id u10so4231028wmj.3 for ; Fri, 10 Feb 2023 08:38:17 -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=PEO0iz2+8eqHQfeG9sdi6MqymoLkqqNq3DUXOt6Jl6Y=; b=j1qSxQ+kCoZA57myLtiQ65H3pOAdWI9GlycxEiDAF+nhOm/SYM0ZRGe3/UQp+I/O7w vXDxg/eJ+zoyjiSZibgc8Yi2pDhjZL35gyU5Qfl53udVtiqDweOTRStbbq+YxMfj3Hhi KHipVrLA+H2LxsjLGHXtqnpIikYOMs3U8kRjuuQShMZk9W+Td2fE5crNiNSojjSuCGqy OPadiwder4UxG+E1mhI/0mmvnJjISQgSi13LIqzWHSELQJf7RVE65WfXUhlTQoMWhCLl +nNWzVTUOgAe6y5Za8aKuUgIxRLHn5w/BX6xXLbgo8rtnTBVf2D0QObvPI6y49wkL8K7 kMSw== 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=PEO0iz2+8eqHQfeG9sdi6MqymoLkqqNq3DUXOt6Jl6Y=; b=w6UscxnDvBVaYuUhjahmQ0zNAVb4+IhKf2S3GIIe69ncTNJAyPpeJG2+5EPm418irv R0GEOljfuZDdIKk3KsZc+2a55af8n29M1a/CYYQjPsT/7GKxBYATuL2HzjYi7Hawjw4Y LUNaqEsWmBzddFashbcjlBlrTRT7cBbBvEfkGdVf4a3dktAuDFmJqosi243IPMsTbe/e Il9F3hjFxt0OqACmck+Ufh+reFPHAr7yzqVUPQETfo+B1Qkdajqz04WJsj8lOlqQHewj YAa23eryqSe3Vb2SJqg4Cp3Mxlb5DVVgwiXtIfqRW/JcGsEWdF8S1laNX/udspTtWC4G UyJQ== X-Gm-Message-State: AO0yUKXP5KYwECu04VhAjlkA0gFIYS6mxjHrCYBr5fpJshY4HLe1GAWM olQuNfOc8hD++IKHV/x4bZd/9Vs6/XAEp2z/ X-Received: by 2002:a05:600c:4496:b0:3dc:de85:5007 with SMTP id e22-20020a05600c449600b003dcde855007mr13279149wmo.21.1676047096878; Fri, 10 Feb 2023 08:38:16 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k7-20020a05600c080700b003daf672a616sm5110843wmp.22.2023.02.10.08.38.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 06/11] hw/sparc64/sun4u: Keep reference to ISA input IRQs in EbusState Date: Fri, 10 Feb 2023 17:37:39 +0100 Message-Id: <20230210163744.32182-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Keep reference to ISA input IRQs in EbusState. To emphasize input/output distinction, rename arrays as isa_irqs_in / isa_irqs_out. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sparc64/sun4u.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 387181ff77..8fe47e2c22 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -84,7 +84,8 @@ struct EbusState { PCIDevice parent_obj; ISABus *isa_bus; - qemu_irq isa_bus_irqs[ISA_NUM_IRQS]; + qemu_irq *isa_irqs_in; + qemu_irq isa_irqs_out[ISA_NUM_IRQS]; uint64_t console_serial_base; MemoryRegion bar0; MemoryRegion bar1; @@ -287,7 +288,7 @@ static const TypeInfo power_info = { static void ebus_isa_irq_handler(void *opaque, int n, int level) { EbusState *s = EBUS(opaque); - qemu_irq irq = s->isa_bus_irqs[n]; + qemu_irq irq = s->isa_irqs_out[n]; /* Pass ISA bus IRQs onto their gpio equivalent */ trace_ebus_isa_irq_handler(n, level); @@ -303,7 +304,6 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp) ISADevice *isa_dev; SysBusDevice *sbd; DeviceState *dev; - qemu_irq *isa_irq; DriveInfo *fd[MAX_FD]; int i; @@ -315,9 +315,9 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp) } /* ISA bus */ - isa_irq = qemu_allocate_irqs(ebus_isa_irq_handler, s, ISA_NUM_IRQS); - isa_bus_irqs(s->isa_bus, isa_irq); - qdev_init_gpio_out_named(DEVICE(s), s->isa_bus_irqs, "isa-irq", + s->isa_irqs_in = qemu_allocate_irqs(ebus_isa_irq_handler, s, ISA_NUM_IRQS); + isa_bus_irqs(s->isa_bus, s->isa_irqs_in); + qdev_init_gpio_out_named(DEVICE(s), s->isa_irqs_out, "isa-irq", ISA_NUM_IRQS); /* Serial ports */ From patchwork Fri Feb 10 16:37:40 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: 652340 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059486wrr; Fri, 10 Feb 2023 08:38:49 -0800 (PST) X-Google-Smtp-Source: AK7set8OZFxwdhW3TNBJA5kLpCP7dBu3JEObq6uqGYHwxIT/ROG2VXT165B76x/cHKkElgd7L2sl X-Received: by 2002:a05:6214:c2a:b0:53a:d85a:f11d with SMTP id a10-20020a0562140c2a00b0053ad85af11dmr22872894qvd.46.1676047129705; Fri, 10 Feb 2023 08:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047129; cv=none; d=google.com; s=arc-20160816; b=Z2jSoEqFhV/S8pz5ljlZoyrX9oT1g/B4ubMTnikGf1+rKr9KaKmkK08VcjEofbwNcP yjU5JNk+G5rN2ggsNnhOGhNuxC+THkzZGRHzMEtSIot0H2QJ9v5iTXWgHFcEFIVbmu2B 6gDLao/ytfje/g38n0Cb7IPS1GFWuKFsF4cvxLZR7wfLd3JjjL6vowCiFyQaPPSf7EzU RXppIdxTzHb4dLH2PgkE52Q0t76CSsp3UYEAhMpmCYXRxp8u+hIzN2SReZUvyj7zCIOx BWjWu6Xm9sYNSrBEJtv4O59C/LCiBg9jGjnkgmeVUOqHy3JKloAEPstVAHNbQhxaE6tS xEHw== 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=789ooQfaoGTNLsCSsIVAXNSCAD6XOwXp+1Wop0X/7+8=; b=qrDxJfGRvtN4YoLX2/1DYHOX7JNQLN5EOc6bOuGaBuoVHubvxld9nKuusKcNdjEOQq 4XZt0MXMluTvUh0ZcVQ76BF8vk7/YMpHEhv163YkdgydBAE5GQxTN5Q1d4fM7Ac/eNsh IIR4jV09Y7S3g0T4W/L2qrtfXnCDTE9VHbs1JFOQIYbqsQK2q0gZl654XB0990jmGBtm 5P5FeQ+NSdNqigbf7u+nO3JXr29LSB/fXqG9ZM4qVFba2J/5wpN9soFCLirF2ZC/i7Py gtrIfzgBM4sNovbBDHn3Sp4Bd4fdjGo7KaJQkpVGCzwmLdcWWpb8EWkVkOIdSiETxarN 9F2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EjVc1K69; 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 o15-20020a0cf4cf000000b005321cec271bsi4258712qvm.186.2023.02.10.08.38.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:38:49 -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=EjVc1K69; 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 1pQWQ2-0001NZ-In; Fri, 10 Feb 2023 11:38:40 -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 1pQWPr-0001Js-Rp for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:27 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPn-0000Hb-1J for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:24 -0500 Received: by mail-wm1-x32f.google.com with SMTP id n13so4224617wmr.4 for ; Fri, 10 Feb 2023 08:38:22 -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=789ooQfaoGTNLsCSsIVAXNSCAD6XOwXp+1Wop0X/7+8=; b=EjVc1K69YB+Oewq2eNrpQ5H6wBU8amXtPamYOi2/QR98uEAvjtQ9VX8g9r+8Ejtjtm /E7qIl/6RRNQIHJsF3JJzTvJ7JbcVFQ4MWibXApbbVWfuzTn7OoHVp6TSldbJAiLkdG8 E3bSiH8sJI7ZywcZRmlIZvzFRKE/45o9Oa+/mMXoCuHj108HmGPTtcQspidbPkxT4+Uf AqoYXzGkuH6UDZYvWOCHjRkpAbfJ6RxXsMTZ4/0ytqAPQEeNe7LcJctmp6Qe8ZXwSXBT EbT7sChduQK3DvF3e5KDYgYMopBpnWZOIk+xJk8VNuFsUFdXtaneNGFxKQ+5OevpZtQt iNqg== 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=789ooQfaoGTNLsCSsIVAXNSCAD6XOwXp+1Wop0X/7+8=; b=4EVqnUEXlUGZWdHeKABv9O8poLpPqTQJogE0oqcqDN+4gssaF3zN8ns+YuFDcM/d+m jFYPZ1giIEN/9HipzigB8OqfWUSGjssnZGfvXnadbzSOd4jlQM+Hc6hfxgCvXR+Dgc4A 4XInWgrk+6IhUrJ6GYsHLivTbjWtSTFM0Umfiidcz7HT1pmuRuDCohy4xxISrPhjZCWo Nk+jeOZtl8Mnp8gpt/guX/x2fQJ2ena1WYUGQ2HNCVgox2s3faVjuGw4cH/6eEtIF+KL pJL2A+ivl+orKkKcwi+S2Fi/reTtEyhLqyELTuRz1uX+vkP9ZUAuP4V2132ERrl8FZUu io/Q== X-Gm-Message-State: AO0yUKWM4VXVfXJCM1kYIn9ev8PaJzdjTMHFwf1ng97Ynkk/G7jv5xEA WWGtAz3LWGX6uD6p4klssF2s0GZp1qO48zL1 X-Received: by 2002:a05:600c:2e89:b0:3e1:bfc:d16e with SMTP id p9-20020a05600c2e8900b003e10bfcd16emr10833011wmn.39.1676047101615; Fri, 10 Feb 2023 08:38:21 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o32-20020a05600c512000b003e0238d9101sm6544038wms.31.2023.02.10.08.38.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 07/11] hw/isa: Reorder to separate ISABus* vs ISADevice* functions Date: Fri, 10 Feb 2023 17:37:40 +0100 Message-Id: <20230210163744.32182-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 Separate functions taking an ISABus* argument versus functions taking a ISADevice* one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/isa/isa.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 25acd5c34c..e81cd33e3c 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -74,12 +74,8 @@ struct ISADevice { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_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_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); -MemoryRegion *isa_address_space(ISADevice *dev); -MemoryRegion *isa_address_space_io(ISADevice *dev); ISADevice *isa_new(const char *name); ISADevice *isa_try_new(const char *name); bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp); @@ -87,6 +83,11 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name); ISADevice *isa_vga_init(ISABus *bus); +qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); +void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); +MemoryRegion *isa_address_space(ISADevice *dev); +MemoryRegion *isa_address_space_io(ISADevice *dev); + /** * isa_register_ioport: Install an I/O port region on the ISA bus. * From patchwork Fri Feb 10 16:37:41 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: 652343 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059659wrr; Fri, 10 Feb 2023 08:39:10 -0800 (PST) X-Google-Smtp-Source: AK7set/7fi+0q1zJRtINNNQcZ4k60p3JYLp2CYL5pnNj1CrsEXki6S4EKIDeo6+GKYzQGrNYZPMV X-Received: by 2002:a05:6214:260a:b0:56a:7a8d:37fe with SMTP id gu10-20020a056214260a00b0056a7a8d37femr27977711qvb.43.1676047149886; Fri, 10 Feb 2023 08:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047149; cv=none; d=google.com; s=arc-20160816; b=qN6A39PSNHKwp2oNs25eeFkgD2jp6+qYlUGERSTeNiKpKIasEkkLDh2LgVu6miWV4C q5iJ8N/ocElwnTj+UNl9YYLWIKqxweOXVB8sLxifJYZU/QSbGmBKakxIT/B7aXs1fEJd 8Qw5yHPVIUlNnxy/rhsTU1ptIy1GNmcwAy4iWyp2SUffI2xA/8acArYYWmkyq9mENPPT 0Gbz5SzfXLOdg0hKDMco+OhoCorWT7mt/PCldlaDGXIFY7jbx0zPctzxFlPyQgYQurDe bs9tVnJ5T+yRY05TLSH2i/Jf7hSMa+ADFlDi+Li3yPQKVrVhixmt9O8/jjNQ+i9rWqLa m9mA== 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=IWcvQknD/lsP28cONSk1Clq7qvez3jPkPtVzdhOOOJk=; b=A0epC95BnsciOGnyeSJ8B7cUrNRlVBD/6yH2N+vJxaiY3uXs/POau8YY+T7Gwto2gZ R/rIgV3jjShXvxdE/6Wuox20HY0Bv4yrtxEysXPzyC4yvDLBVqdCqc/huMNHCV4rwIQl u2u5gR9pjy39UoXTVR2JfinK1RvW8WHrVLu4nq3hHWrw3mkckNqrRTj33eyk7pI/NJYt iB5fR+hlUpDTaF6pnpIzVvWsobknBgzdctYJE8HHGCJncXEHJ6opUykIeQfQ90+d1YjR zlxadODmz6UZZpBMIOPCvPk9f/FxM6nVBZ0zy/fINhlfm07qH+/CD2SL3OWR79niiSgU Krlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vGwwtV6D; 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 t128-20020a37aa86000000b00706ab10e026si4109527qke.229.2023.02.10.08.39.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:09 -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=vGwwtV6D; 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 1pQWQ7-0001b7-AU; Fri, 10 Feb 2023 11:38:43 -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 1pQWPu-0001NY-BP for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:34 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPr-0000Ht-Um for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:29 -0500 Received: by mail-wm1-x331.google.com with SMTP id hn2-20020a05600ca38200b003dc5cb96d46so6677017wmb.4 for ; Fri, 10 Feb 2023 08:38:27 -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=IWcvQknD/lsP28cONSk1Clq7qvez3jPkPtVzdhOOOJk=; b=vGwwtV6DzmFLbxsdZpxIprsKJuG70CrTDeMlBGFU0q7ib+Z32rZwKKLfWj2eJIwqYv DW44mgYTi28C37FsseZ/uo+GL28c0uQ+qDk0xqxEAvE6B7wMRVRoVUBcnCL0+LgNIPvi 5sZMpunm+yyRerIwLWSBUETFwtctiPF1hFue0mKM06zHTcdM+OyPbTakgGosG8VhiNm1 ZPDTKzduKqyodQdVR7lo3fSEs/SKqzfeOTGiXxRB8fMKGuqsDntUAdQLQErtqD+xR5WD h585u8zU8OxGZK70D3KWQV9Fr4yitJadRSwY8A0knR1mU58XYo0tTnvfJ5wJ0lQjlcoB 5CPw== 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=IWcvQknD/lsP28cONSk1Clq7qvez3jPkPtVzdhOOOJk=; b=nnyXmcKeZdcqFrDNymZnEnGMVgQ22Apc1h4fV7BmEbf2z3XxkO/xevwRafSiHiC5Zb 6AWZYAaAWTMerrNjZ/2Fc/abbMxkWhJCqxuVCVinplDIRtDcTVxoEWB9/LARuwrz0r0N qV06lsC9R1cTkUfIXUcXTNqgn+LqxiTgglhkAxEsA2EpSR3VfnD4yQ4Bq3r8l39FLFVv JROsWcxeEhbDiJw4iHH/ng7IoUE8sGrSJ5EF8fNyf98n9VFxK2l34zyoV35EawEE5GPE GK+CH9x15sAzKOLnRTgD94wMOSlbCw0/GyUUMEhWJiuOsR82b7ieKgGtH7SK11i/7wzR XWBA== X-Gm-Message-State: AO0yUKVWxACSmAV69oBd+IL5c37OrSK+eh2wSFcLLB6ILgKz/DzADC1D IQx6P1lK9f4ETWI2jSugi1MiYmmzre6YNO7u X-Received: by 2002:a05:600c:a295:b0:3dc:40a0:3853 with SMTP id hu21-20020a05600ca29500b003dc40a03853mr2540528wmb.11.1676047106331; Fri, 10 Feb 2023 08:38:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z6-20020a1c4c06000000b003d1d5a83b2esm8273180wmf.35.2023.02.10.08.38.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 08/11] hw/isa: Un-inline isa_bus_from_device() Date: Fri, 10 Feb 2023 17:37:41 +0100 Message-Id: <20230210163744.32182-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 No point in inlining isa_bus_from_device() which is only used at device realization time. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 5 +++++ include/hw/isa/isa.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 4fe61d6dfe..5bd99379e9 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -162,6 +162,11 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp) return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp); } +ISABus *isa_bus_from_device(ISADevice *dev) +{ + return ISA_BUS(qdev_get_parent_bus(DEVICE(dev))); +} + ISADevice *isa_vga_init(ISABus *bus) { vga_interface_created = true; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index e81cd33e3c..1691364011 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -87,6 +87,7 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); MemoryRegion *isa_address_space(ISADevice *dev); MemoryRegion *isa_address_space_io(ISADevice *dev); +ISABus *isa_bus_from_device(ISADevice *dev); /** * isa_register_ioport: Install an I/O port region on the ISA bus. @@ -124,9 +125,4 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *portio, void *opaque, const char *name); -static inline ISABus *isa_bus_from_device(ISADevice *d) -{ - return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); -} - #endif From patchwork Fri Feb 10 16:37:42 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: 652342 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059634wrr; Fri, 10 Feb 2023 08:39:07 -0800 (PST) X-Google-Smtp-Source: AK7set/UUI8032l/GO05bN1AXivylLiJKi/5ylp4cKJ2E0SNaRMF8MSmV0EOeNmZzKJ1k16LovYt X-Received: by 2002:a05:622a:244:b0:3b9:b450:61f6 with SMTP id c4-20020a05622a024400b003b9b45061f6mr24734167qtx.62.1676047146920; Fri, 10 Feb 2023 08:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047146; cv=none; d=google.com; s=arc-20160816; b=sTZGjsGf1sBoiM6Q+AEg1L4c9xPKQeIl7WZt9AoCS0nRxsrM0D8g0b4y6Rv0I6In2D bFafsNCb9tIfP8QBV5SauMfB1SsvP81+A58FgfjCtt1/x1w0M5Zjk9zAAxq66SmUyFcH kMHq1FmzTBffGjTOKOWs2CxCirJlg3m6uPz+z8LVP9oMFjDonG6Eiy84rkoBsjv+B7Qg aRhduPbwwyteltn32zAx81wGeYt/d98GGgDq55QC6SeBox0cmUZgbGY2jkA/kXQ3jqAs h45wgPTyIZFMFbYTRIwW795KR9bF7cOYQgu9qkIIe03F4HoYN9HI48f3l3Bx73saD4wQ 88Bg== 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=kTPaflOC6+oM6trEZJQXYf+7BQUWtjQrjMlU/xZObQI=; b=p9wD9qx03L3K9kZlHUqp3LU2IV8zsDjeengazzcd7cmb6seMmU3lxNIwOcLYqOK/ph Re/0NTi5vMIqBN3AVkmJ/wRvwxRc+n7sS730TbdwH3Fi1ZhoMOZFUCoRx9uk5/90LBSS T5hzHocjJ/32lRcbsULg9Z8qdA5u12xpUmzl3fkl9X8qUl7POGHKc8zhjWmhileiwJeS sVAsPbEemv5zQlJyrmaaMDNt/mNVOqpsem7LoVyYFs4wuu1Jqd1TZF/cnOSJtRVCIE4O HWJCPEyvafvIEvTOdSuPST81SyCljswg9Ddb75I4CVAQZXOSGHhP0aCn+y5ozRGrTzro 0QGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lV8gKKER; 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 r3-20020a05622a034300b003b6955054a1si4156973qtw.424.2023.02.10.08.39.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:39:06 -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=lV8gKKER; 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 1pQWQD-0001hv-77; Fri, 10 Feb 2023 11:38: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 1pQWQ5-0001Z6-LN for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:42 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPy-0000If-16 for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:40 -0500 Received: by mail-wr1-x42e.google.com with SMTP id o18so5641164wrj.3 for ; Fri, 10 Feb 2023 08:38:33 -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=kTPaflOC6+oM6trEZJQXYf+7BQUWtjQrjMlU/xZObQI=; b=lV8gKKERQhQIbIjAcFgfOLY1bTun3ZEipDoBHYh8j7s4SfvICup4qNU8Ijm2NiwuEq klJ82qe8W97tOgIjfLkGcJ2l3a+gO6mo1y6Bzmi2w4HUBtRngUG3q/Pl2EM6SdRg0aBx bgNDoiQUuseLtqXk0ohIXhpa+zpN7zkSMfC/zzUFW+QSTHALFmnKf2Ac4ZbifFLyyvyy DJ+jCgCcwDYJ8+sW3yWUkr6Q1IlOmHTuVcht8LWAbYdh7zGLLWBO6lIQg18dS4LBP4Ef p90Z/L87vdxBx7mlNWl2GnbMNa9sh42lVJfcgSA6tjpHKJIO7htCKx2JBHEhtUbCq0Xu zgtA== 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=kTPaflOC6+oM6trEZJQXYf+7BQUWtjQrjMlU/xZObQI=; b=kPEbfpQUN1ofr1BQVR6pBcuhcZgUaiF6x74NuzEEeBAN/KlHE558MYyvwoWUyD6eWq awt8RTzC25a3Jo/h5sZN4DqwWjlnWJMAR36TywiTYQz6noiMVLT98pIThtb2Qfz6PRs4 yKxUkzwXKBs60bBBCpnVPY428MQWcyHRAVPuY/BRROrC/769148zesTZuSLnwUJH8JyC x6DbHU+rkybe67ASBuUuZrNPVIyxZnkegBOd2DgvaU2CohIRGMWhWnaEzkj660C1VRFg mH8VDzoO4tKd5ppJKdX2EJkzSIHZmyJaVNFFCWG6Yq4MpdQQ1K2lxGgR28n3G9Sdj9j9 ZLMg== X-Gm-Message-State: AO0yUKX19UgUFFRwhsRk1ZW5yAnIooNT33JUsZkw3JQVoSTVjtZNLfzW jvid9nN3I9HtcTyg6uf4mTvqTGUERLA1vWyD X-Received: by 2002:a5d:528f:0:b0:2bf:d285:b787 with SMTP id c15-20020a5d528f000000b002bfd285b787mr13767125wrv.56.1676047111833; Fri, 10 Feb 2023 08:38:31 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x2-20020a1c7c02000000b003df30c94850sm8498689wmc.25.2023.02.10.08.38.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Helge Deller , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , =?utf-8?q?Herv=C3=A9_Poussin?= =?utf-8?q?eau?= , Aurelien Jarno , Huacai Chen , Jiaxun Yang , Aleksandar Rikalo , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 09/11] hw/isa: Rename isa_bus_irqs() -> isa_bus_register_input_irqs() Date: Fri, 10 Feb 2023 17:37:42 +0100 Message-Id: <20230210163744.32182-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 isa_bus_irqs() register an array of input IRQs on the ISA bus. Rename it as isa_bus_register_input_irqs(). Mechanical change using: $ sed -i -e 's/isa_bus_irqs/isa_bus_register_input_irqs/g' \ $(git grep -wl isa_bus_irqs) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/hppa/machine.c | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc_piix.c | 2 +- hw/isa/i82378.c | 2 +- hw/isa/isa-bus.c | 8 ++++---- hw/isa/lpc_ich9.c | 2 +- hw/isa/piix4.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mips/jazz.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/sparc64/sun4u.c | 2 +- include/hw/isa/isa.h | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 7ac68c943f..8fea5fa6b8 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -98,7 +98,7 @@ static ISABus *hppa_isa_bus(void) isa_irqs = i8259_init(isa_bus, /* qemu_allocate_irq(dino_set_isa_irq, s, 0)); */ NULL); - isa_bus_irqs(isa_bus, isa_irqs); + isa_bus_register_input_irqs(isa_bus, isa_irqs); return isa_bus; } diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 29f30dd6d3..fed468a34d 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -174,7 +174,7 @@ static void microvm_devices_init(MicrovmMachineState *mms) isa_bus = isa_bus_new(NULL, get_system_memory(), get_system_io(), &error_abort); - isa_bus_irqs(isa_bus, x86ms->gsi); + isa_bus_register_input_irqs(isa_bus, x86ms->gsi); ioapic_init_gsi(gsi_state, "machine"); if (ioapics > 1) { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index df64dd8dcc..7c48ba30e0 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -246,7 +246,7 @@ static void pc_init1(MachineState *machine, i8257_dma_init(isa_bus, 0); pcms->hpet_enabled = false; } - isa_bus_irqs(isa_bus, x86ms->gsi); + isa_bus_register_input_irqs(isa_bus, x86ms->gsi); if (x86ms->pic == ON_OFF_AUTO_ON || x86ms->pic == ON_OFF_AUTO_AUTO) { pc_i8259_create(isa_bus, gsi_state->i8259_irq); diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index d32653369d..233059c6dc 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -89,7 +89,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp) /* 2 82C59 (irq) */ s->isa_irqs_in = i8259_init(isabus, s->cpu_intr); - isa_bus_irqs(isabus, s->isa_irqs_in); + isa_bus_register_input_irqs(isabus, s->isa_irqs_in); /* 1 82C54 (pit) */ pit = i8254_pit_init(isabus, 0x40, 0, NULL); diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 5bd99379e9..d19826f96e 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -67,13 +67,13 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space, return isabus; } -void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) +void isa_bus_register_input_irqs(ISABus *bus, qemu_irq *irqs_in) { - bus->irqs = irqs; + bus->irqs_in = irqs_in; } /* - * isa_get_irq() returns the corresponding qemu_irq entry for the i8259. + * isa_get_irq() returns the corresponding input qemu_irq entry for the i8259. * * This function is only for special cases such as the 'ferr', and * temporary use for normal devices until they are converted to qdev. @@ -82,7 +82,7 @@ qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) { assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); assert(isairq < ISA_NUM_IRQS); - return isabus->irqs[isairq]; + return isabus->irqs_in[isairq]; } void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 1fba3c210c..cda2f5621e 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -725,7 +725,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) qdev_init_gpio_out_named(dev, lpc->gsi, ICH9_GPIO_GSI, GSI_NUM_PINS); - isa_bus_irqs(isa_bus, lpc->gsi); + isa_bus_register_input_irqs(isa_bus, lpc->gsi); i8257_dma_init(isa_bus, 0); } diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index de60ceef73..ef24826993 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -212,7 +212,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) s->isa = i8259_init(isa_bus, *i8259_out_irq); /* initialize ISA irqs */ - isa_bus_irqs(isa_bus, s->isa); + isa_bus_register_input_irqs(isa_bus, s->isa); /* initialize pit */ i8254_pit_init(isa_bus, 0x40, 0, NULL); diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index a913a509f7..52814cc751 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -615,7 +615,7 @@ static void via_isa_realize(PCIDevice *d, Error **errp) } s->isa_irqs_in = i8259_init(isa_bus, s->cpu_intr); - isa_bus_irqs(isa_bus, s->isa_irqs_in); + isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in); i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(isa_bus, 0); diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index fc7898006c..3b09c93a92 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -249,7 +249,7 @@ static void mips_jazz_init(MachineState *machine, /* ISA devices */ isa_irqs_in = i8259_init(isa_bus, env->irq[4]); - isa_bus_irqs(isa_bus, isa_irqs_in); + isa_bus_register_input_irqs(isa_bus, isa_irqs_in); i8257_dma_init(isa_bus, 0); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk_init(isa_new(TYPE_PC_SPEAKER), isa_bus, pit); diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 71143b7692..01f44c19eb 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -837,7 +837,7 @@ ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool use_cpld, Error **errp) irqs = qemu_allocate_irqs(handler, lpc, ISA_NUM_IRQS); - isa_bus_irqs(isa_bus, irqs); + isa_bus_register_input_irqs(isa_bus, irqs); return isa_bus; } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 8fe47e2c22..8a56ba9f98 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -316,7 +316,7 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp) /* ISA bus */ s->isa_irqs_in = qemu_allocate_irqs(ebus_isa_irq_handler, s, ISA_NUM_IRQS); - isa_bus_irqs(s->isa_bus, s->isa_irqs_in); + isa_bus_register_input_irqs(s->isa_bus, s->isa_irqs_in); qdev_init_gpio_out_named(DEVICE(s), s->isa_irqs_out, "isa-irq", ISA_NUM_IRQS); diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 1691364011..0aa36d4115 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -59,7 +59,7 @@ struct ISABus { MemoryRegion *address_space; MemoryRegion *address_space_io; - qemu_irq *irqs; + qemu_irq *irqs_in; IsaDma *dma[2]; }; @@ -73,7 +73,7 @@ struct ISADevice { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space, MemoryRegion *address_space_io, Error **errp); -void isa_bus_irqs(ISABus *bus, qemu_irq *irqs); +void isa_bus_register_input_irqs(ISABus *bus, qemu_irq *irqs_in); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_get_dma(ISABus *bus, int nchan); ISADevice *isa_new(const char *name); From patchwork Fri Feb 10 16:37:43 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: 652351 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1060187wrr; Fri, 10 Feb 2023 08:40:11 -0800 (PST) X-Google-Smtp-Source: AK7set/SXPLtfANWwcIc1Z5K7jBrX5b+wpXFjNNHNEWX6xaUGyVuBfrXV3L0+8C+2BaUQnucyBo9 X-Received: by 2002:a05:622a:d2:b0:3b6:2b39:4373 with SMTP id p18-20020a05622a00d200b003b62b394373mr25139067qtw.23.1676047210860; Fri, 10 Feb 2023 08:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047210; cv=none; d=google.com; s=arc-20160816; b=0DwCkFng3V/dI3MG362J+0haXWvn8k6LEzj4Nm4Y3ZZJBj/q2Sh9rPnTBgREmquHHE LbksJoosA70u+q+1VD7vMz8a+mM/B2VPuQc8sKXIJ40LGpLc5vnCnjCgCe9WGg5dq80/ lmJlnmcFxG9N+SlG3CPHQPL/ldPQmh3ZLt7nKH2J1eRtzkftLzoTFvgwCtzx2uQ0UYZw jCDTO5JZEjBrxiv4YcOC+hMhjegIx08u59EdmHmLjLLsM6OVf0rJnnSQLvE8JDmwVEWJ +GB78GkKUGPGs2uWbh0EO+wlCo8Ql77LT/ridtU5lmvJB7Ox/GvLZqQUoA3FCQzjMOHh Jq3Q== 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=YoHT59j3PIEbNQgJjg9OB8ZAxg8LDaeoLJEvNKTWr5M=; b=kDN6bnYj9y5qUhXxWQw1U+wzQiRf+RLQoQopDE9jbd4BHv3k5KfdECncHyUPnsJvOQ tZJ0FgoXX82wfrv5othxbJdNUcTwPMAFocsnY/ulsIDqfwkCnmwn2QCH1zuEwHaxRI56 fZbfT7slGxpqrJbIJV+XSDTmny6Ig+rcG79vlTIHapFl1m9ZikMkoDIugFIQCY5KQ0wL O/lui5tSRPhU40ZumV3qI4LXZLs/KHIymisCBzvAsYPuE8HfaNmfUQUjI1nvjtX4y9Ho BNpQOR0t5K1liL3cKqo/zvn/Wnl96Oa9l4EutB9lXAJvOwBygiaQvl/mkKRxf/sw+sbR IL2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RJoxFnL0; 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 f9-20020ac859c9000000b003b9a411a972si3941852qtf.547.2023.02.10.08.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:40:10 -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=RJoxFnL0; 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 1pQWQL-0002Nw-Ia; Fri, 10 Feb 2023 11:38:57 -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 1pQWQD-0001ih-1E for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:49 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWQ4-0000G0-4V for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:42 -0500 Received: by mail-wr1-x42a.google.com with SMTP id o15so2321590wrc.9 for ; Fri, 10 Feb 2023 08:38:37 -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=YoHT59j3PIEbNQgJjg9OB8ZAxg8LDaeoLJEvNKTWr5M=; b=RJoxFnL0XsRpjQueoM/BiLfGNgDKnkzHECga3h6hdsHDbcxkSPL18g6p3QjWhJkY7C Vur4IzZxjtUXBqgOa6igkmngsr3WAVi+8qXGtQT3LG1qPYNmsziCWQALnkEIT+cgzDmN 0c2FQ/ZmoSZT7572TifeIa4joU9QssrjLqcD4OykuaGfHf9GWkRd7dHox5W596TLUtjC noPyCquajhwa63361h4ITMucScL1AW6y6yTq5Bs104Ae37TjFWITqKKXHRFUU2DrLZSS 8ctjmpipHEsE16JwwiAPrky3K0AIS/3PAVJyK4LR8PocLjLsvc+kE5YI++58w0XBodu5 gukQ== 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=YoHT59j3PIEbNQgJjg9OB8ZAxg8LDaeoLJEvNKTWr5M=; b=CqisFN6MM0EexOB3cKKPVqhpleh1qSWUfIj3VFNEzCXvd2bOfW19+XADd/Zr41qfYu anl7DbPprZ4bAirpxIh25cMqSxS9OUJt8ul0Hmhsype6PU2xSqh7Cy5TcaV3e/tSRrcO zWjA+Is1/kkr1LaRfh53zfi4hVlKjG21C4DPQV6jadxprg2ynBzhAC5wlSq63oosjLBR 7Yv/pRODQJWjN7CaE97ELum90NV8D3L+u3/sdNAx0fvRoRL9kr0r2mgoG7pnOZep/W5r vAQcQ9i3VGNNEIic/vfcNBHXUWOJlSAaSac7OalnA+hjAUw9QgGRFBcOnH0h2g8cnEN+ mfrw== X-Gm-Message-State: AO0yUKX2dzBctbvHxjkPte+iap+FQ4Un5udkC5uTGTUWomjYisB0ogNE oRy/gA60jDKJA9+iiA5Imxt4WNbFJFHBmLEh X-Received: by 2002:a05:6000:1811:b0:2c5:4b17:166 with SMTP id m17-20020a056000181100b002c54b170166mr1888960wrh.48.1676047116584; Fri, 10 Feb 2023 08:38:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i8-20020a5d4388000000b002c5493a17efsm2023496wrq.25.2023.02.10.08.38.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 10/11] hw/isa: Use isa_address_space_io() to reduce access on global 'isabus' Date: Fri, 10 Feb 2023 17:37:43 +0100 Message-Id: <20230210163744.32182-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index d19826f96e..d12973103f 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -114,7 +114,7 @@ static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start) { - memory_region_add_subregion(isabus->address_space_io, start, io); + memory_region_add_subregion(isa_address_space_io(dev), start, io); isa_init_ioport(dev, start); } @@ -133,7 +133,7 @@ int isa_register_portio_list(ISADevice *dev, isa_init_ioport(dev, start); portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name, - isabus->address_space_io, start); + isa_address_space_io(dev), start); return 0; } From patchwork Fri Feb 10 16:37:44 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: 652348 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1060105wrr; Fri, 10 Feb 2023 08:40:01 -0800 (PST) X-Google-Smtp-Source: AK7set9RlO/sGQercT8tF7TMzNiqhP1ZnIiYDc4rwDJFbJXTTJvw2JkbOvt8AfHFozON6cZThM4M X-Received: by 2002:ac8:5756:0:b0:3b7:ed2c:fbb7 with SMTP id 22-20020ac85756000000b003b7ed2cfbb7mr31225526qtx.0.1676047201782; Fri, 10 Feb 2023 08:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047201; cv=none; d=google.com; s=arc-20160816; b=BpNKP2llrpA67VsTJNdwt5QnOYtqwBHKt9EddKqc+hHF/AFqAfPBEY0vcfx/BMZF1O cMWso3dMeJIaah9kXC9O1efT2O4bWhiu+StpCD70b75Hk+sIOfdQMlINWDCQEcopxk4L Gf6XhmEnvIRGhu+InvutbL/H/xjgmJo0IceDD5Q5u3McB3LNDO1TN3IEiA9EeRiAeSBn bGksXhmOKgNI3aNW6x1vKBv1QeytBNEvxASONX/ff4QvYrlszvbITPuvuoZNGGuTgZCE K5t1pHxEZVtgjD58bhl5vWAzCpuIqHgmtvuHm5FBckYjcJ1igk/YUuqFW/cCH9A9RLXE bO6Q== 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=lXmJ/9H6tejYaoSigJ9Gtxd/ZVq77Quhr/7jqB7U4d8=; b=tcq+iiusdzVFV4v9oB2C9khXgv9EJlh9SqB+UWc6zupBpx/QvepEzEPwqt8CFJDXTk huMnORAyNTdeXJerUGaIgZvXLuO+OoWtAp5T07uWWRpTT6W0uDI2Fc9QgkpIowhhMrX1 dItKGabzra1XbIbZYGMEGTJ5XPGXg/H2+BJoRDQJCOkbKtYdG1Md3uco5HwPo49lKczq oKWOfTowSXBDZKs80YUmMxw4SB8rhl6B20awr3+n+3YcJIE98vy/XkWji2rdKLwdttF+ cK8Ac++nOHz1UZrJP8SXKPGUau1LedGC1g0xm5ssSzyK7YcEr0tGhI0bC5tDlA2LpXon IUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ORGfwVBu; 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 d19-20020a05622a15d300b003bb7c7948a2si4228192qty.556.2023.02.10.08.40.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:40:01 -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=ORGfwVBu; 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 1pQWQI-000275-M5; Fri, 10 Feb 2023 11:38:54 -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 1pQWQE-0001qu-CB for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:50 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWQ8-0000L1-CZ for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:38:50 -0500 Received: by mail-wr1-x429.google.com with SMTP id h16so5596363wrz.12 for ; Fri, 10 Feb 2023 08:38:42 -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=lXmJ/9H6tejYaoSigJ9Gtxd/ZVq77Quhr/7jqB7U4d8=; b=ORGfwVBuN2tpiBwuF4seeFzozkDoKiLEWxteSiyfPa0CljkC8X6cItJvGgtged/P8E 6wHX4Ga4eB/fyblOUP7WFwj18wlm60IaznFQOw2YTWzK+Hk8T/xsbdel1MMjOdEtkRNa eJMbpVe+DC7z2JTYlbjR0wsjt0/zIFYjH/f7luhxV97jvFfWxRVoBWX9yAfLWUA8HhnJ RoOPdtcsumhVMPeszrM9UKUVFPN0shipz8YPUIpvpNZTzxHHtfZDksoDB7ozqaD4UoVX e6MykytDueEusLv7qGaF8Qr4hM0P1A+pr0Lz8M05sz7cgvTeLnRmarVIQbvxiXyH4SO9 AUXg== 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=lXmJ/9H6tejYaoSigJ9Gtxd/ZVq77Quhr/7jqB7U4d8=; b=wgFbykQ/d8+P+mu/vQOGU+RIRghXX2EIxRfVRfkybiWTdj84t5fkSgTY6HuDf6+oqt JNCBRYug3uZJY0KycWGAgh5bisZM4cf/MmVn17rEMjK8QMh14CcEN62KFovga7nX9W6R 7zRrt9kaRFPpiQ49n1ggt55UQo1zhETb9dt0hFJzzYTxK6yS87zmlgXlIJhci4bMezX5 kOi9pkp2QJWcVw+wYAvgzdj0Ggf90Bowwuy9I5TjwDOcSgw2m3tQeaDIrHrvB6EE8CZw Sw99J+YuIKDM1FH5R/WHGlDUyb4QciQzepxjpTinXEmkT7Jx3R7GtTOQfHvsaH6F4d0S 0MfA== X-Gm-Message-State: AO0yUKXOHICq3GZKxPCx54kVe6ZMFAP9cXbCUg8hktAy2XcYlur9O0LQ xxMBWAZnuGI7qQ/7AGghaAbMJBLzHUl9c0E+ X-Received: by 2002:a5d:674b:0:b0:2c4:98c:1c4b with SMTP id l11-20020a5d674b000000b002c4098c1c4bmr4723392wrw.18.1676047121363; Fri, 10 Feb 2023 08:38:41 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5002000000b002c4c1a47adfsm4080952wrt.23.2023.02.10.08.38.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:38:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 11/11] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq() Date: Fri, 10 Feb 2023 17:37:44 +0100 Message-Id: <20230210163744.32182-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org isa_get_irq() was added in commit 3a38d437ca ("Add isa_reserve_irq()" Fri Aug 14 11:36:15 2009) as: a temporary interface to be used to allocate ISA IRQs for devices which have not yet been converted to qdev, and for special cases which are not suited for qdev conversions, such as the 'ferr'. We still use it 14 years later, using the global 'isabus' singleton. In order to get rid of such *temporary* interface, extract isa_bus_get_irq() which can take any ISABus* object. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 14 ++++++++++---- include/hw/isa/isa.h | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index d12973103f..4cf26510bf 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -72,6 +72,13 @@ void isa_bus_register_input_irqs(ISABus *bus, qemu_irq *irqs_in) bus->irqs_in = irqs_in; } +qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum) +{ + assert(irqnum < ISA_NUM_IRQS); + assert(bus->irqs_in); + return bus->irqs_in[irqnum]; +} + /* * isa_get_irq() returns the corresponding input qemu_irq entry for the i8259. * @@ -81,14 +88,13 @@ void isa_bus_register_input_irqs(ISABus *bus, qemu_irq *irqs_in) qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) { assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); - assert(isairq < ISA_NUM_IRQS); - return isabus->irqs_in[isairq]; + return isa_bus_get_irq(isabus, isairq); } void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) { - qemu_irq irq = isa_get_irq(isadev, isairq); - qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq); + qemu_irq input_irq = isa_get_irq(isadev, isairq); + qdev_connect_gpio_out(DEVICE(isadev), gpioirq, input_irq); } void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 0aa36d4115..ba62a2e6c8 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -76,6 +76,14 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space, void isa_bus_register_input_irqs(ISABus *bus, qemu_irq *irqs_in); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_get_dma(ISABus *bus, int nchan); +/** + * isa_bus_get_irq: Return input IRQ on ISA bus. + * @bus: the #ISABus to plug ISA devices on. + * @irqnum: the ISA IRQ number. + * + * Return IRQ @irqnum from the PIC associated on ISA @bus. + */ +qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum); ISADevice *isa_new(const char *name); ISADevice *isa_try_new(const char *name); bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp);