From nobody Tue Feb 10 02:43:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544052798975167.81000168453045; Wed, 5 Dec 2018 15:33:18 -0800 (PST) Received: from localhost ([::1]:37930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUgfN-0006bv-N0 for importer@patchew.org; Wed, 05 Dec 2018 18:33:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUgWs-0006lo-5F for qemu-devel@nongnu.org; Wed, 05 Dec 2018 18:24:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUgWn-0003IG-Sl for qemu-devel@nongnu.org; Wed, 05 Dec 2018 18:24:29 -0500 Received: from 7.mo4.mail-out.ovh.net ([178.33.253.54]:46813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUgWl-0003G3-Tn for qemu-devel@nongnu.org; Wed, 05 Dec 2018 18:24:24 -0500 Received: from player714.ha.ovh.net (unknown [10.109.160.239]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id C03A11C4631 for ; Thu, 6 Dec 2018 00:24:21 +0100 (CET) Received: from kaod.org (lfbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player714.ha.ovh.net (Postfix) with ESMTPSA id 907887D9991; Wed, 5 Dec 2018 23:24:16 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Thu, 6 Dec 2018 00:22:28 +0100 Message-Id: <20181205232251.10446-15-clg@kaod.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181205232251.10446-1-clg@kaod.org> References: <20181205232251.10446-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 6783828414010592230 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudefiedgtdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.253.54 Subject: [Qemu-devel] [PATCH v6 14/37] spapr: modify the irq backend 'init' method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Add a 'nr_irqs' parameter to the 'init' method to remove the use of the machine class. This will be useful when we introduce the machine supporting the two sPAPR IRQ backends : XICS and XIVE. Signed-off-by: C=C3=A9dric Le Goater --- include/hw/ppc/spapr_irq.h | 2 +- hw/ppc/spapr_irq.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index bd7301e6d9c6..0e9229bf219e 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -33,7 +33,7 @@ typedef struct sPAPRIrq { uint32_t nr_irqs; uint32_t nr_msis; =20 - void (*init)(sPAPRMachineState *spapr, Error **errp); + void (*init)(sPAPRMachineState *spapr, int nr_irqs, Error **errp); int (*claim)(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp= ); void (*free)(sPAPRMachineState *spapr, int irq, int num); qemu_irq (*qirq)(sPAPRMachineState *spapr, int irq); diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index f8b651de0ec9..bac450ffff23 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -90,11 +90,10 @@ error: return NULL; } =20 -static void spapr_irq_init_xics(sPAPRMachineState *spapr, Error **errp) +static void spapr_irq_init_xics(sPAPRMachineState *spapr, int nr_irqs, + Error **errp) { MachineState *machine =3D MACHINE(spapr); - sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(spapr); - int nr_irqs =3D smc->irq->nr_irqs; Error *local_err =3D NULL; =20 if (kvm_enabled()) { @@ -217,7 +216,7 @@ void spapr_irq_init(sPAPRMachineState *spapr, Error **e= rrp) spapr_irq_msi_init(spapr, smc->irq->nr_msis); } =20 - smc->irq->init(spapr, errp); + smc->irq->init(spapr, smc->irq->nr_irqs, errp); } =20 int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **e= rrp) --=20 2.17.2