From nobody Thu Nov 6 19:12:10 2025 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.zoho.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 1488344093664544.3754677551586; Tue, 28 Feb 2017 20:54:53 -0800 (PST) Received: from localhost ([::1]:38383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciwHs-0007xN-Gz for importer@patchew.org; Tue, 28 Feb 2017 23:54:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciw7o-00082i-Ba for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciw7m-00006t-39 for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:28 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:45931) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciw7l-0008Ve-IE; Tue, 28 Feb 2017 23:44:25 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vY2sS4tRVz9sNC; Wed, 1 Mar 2017 15:44:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1488343452; bh=nnKTjacQ48q44nq7ZQCpPzqOJ7bkbreTa/75h/zVvqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6mLVFCnM9P/RPaZ9KHyaEQv4xwGtyV0XIvs82AOkpjjNrO3LwUyiOKLAkjXCUDst 17P39cSnaMl6R+E1b4e3UM93NxdWCneyGwVRXJzHHwfE0U2ElgpGSuDndaMYz1Rmmw Wu8vNnb/S+7mHN7GYDjuXkoDZe4kwzx8WENh1EkI= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 1 Mar 2017 15:43:45 +1100 Message-Id: <20170301044405.1792-31-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170301044405.1792-1-david@gibson.dropbear.id.au> References: <20170301044405.1792-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 30/50] ppc/xics: introduce a XICSFabric QOM interface to handle ICSs 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: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater This interface provides two simple handlers. One is to get an ICS (Interrupt Source Controller) object from an irq number and a second to resend the irqs when needed. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/intc/xics.c | 7 +++++++ include/hw/ppc/xics.h | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index c7c9bd6..433869a 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -745,6 +745,12 @@ static const TypeInfo ics_base_info =3D { .class_size =3D sizeof(ICSStateClass), }; =20 +static const TypeInfo xics_fabric_info =3D { + .name =3D TYPE_XICS_FABRIC, + .parent =3D TYPE_INTERFACE, + .class_size =3D sizeof(XICSFabricClass), +}; + /* * Exported functions */ @@ -785,6 +791,7 @@ static void xics_register_types(void) type_register_static(&ics_simple_info); type_register_static(&ics_base_info); type_register_static(&icp_info); + type_register_static(&xics_fabric_info); } =20 type_init(xics_register_types) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 37d4d9c..1c43305 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -178,6 +178,24 @@ struct ICSIRQState { uint8_t flags; }; =20 +typedef struct XICSFabric { + Object parent; +} XICSFabric; + +#define TYPE_XICS_FABRIC "xics-fabric" +#define XICS_FABRIC(obj) \ + OBJECT_CHECK(XICSFabric, (obj), TYPE_XICS_FABRIC) +#define XICS_FABRIC_CLASS(klass) \ + OBJECT_CLASS_CHECK(XICSFabricClass, (klass), TYPE_XICS_FABRIC) +#define XICS_FABRIC_GET_CLASS(obj) \ + OBJECT_GET_CLASS(XICSFabricClass, (obj), TYPE_XICS_FABRIC) + +typedef struct XICSFabricClass { + InterfaceClass parent; + ICSState *(*ics_get)(XICSFabric *xi, int irq); + void (*ics_resend)(XICSFabric *xi); +} XICSFabricClass; + #define XICS_IRQS_SPAPR 1024 =20 qemu_irq xics_get_qirq(XICSState *icp, int irq); --=20 2.9.3