From nobody Mon Feb 9 17:06:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1574665719; cv=none; d=zohomail.com; s=zohoarc; b=Aav4jow8z4DE7tzyvwKA9lsEWeRCfNlU0tsvNlsvy2yeiYVQRFDB5OLPUULDYDiX8NuEMfYJ5Z8QY18aa1q4dPpxq3xW2jFVmLGWrGi90aetOMAe/8Hvvq+M4hjIun/M+sdlqHwKHPkr2iJIF6pm9R2vh5gQIItzuNuN187KdvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574665719; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NWZH92owuqdp6B/6dhLS3DsJT6jS9PcUdF++X3aKaHU=; b=NjXthtYEwBLtyU0qlmfU4WX/q7yDbQQXWXpurDsigPrrvRu5t44t/CcVGBM+Pcoy/LJHUYHq34RTQ8UUr/mO7GdxAdVh1jwdy+OtHvz6bbgFcFXya+iMuT0DRHHAyhGLIuv4+1zv3nUqNV/80iQ3sfvj+mIlr5ki8+E6a0WWFyY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15746657199681014.5713742626613; Sun, 24 Nov 2019 23:08:39 -0800 (PST) Received: from localhost ([::1]:40834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZ8U9-0003fJ-W4 for importer@patchew.org; Mon, 25 Nov 2019 02:08:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41557) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZ8Ku-00029l-Dd for qemu-devel@nongnu.org; Mon, 25 Nov 2019 01:59:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZ8Kt-0001Mv-8K for qemu-devel@nongnu.org; Mon, 25 Nov 2019 01:59:04 -0500 Received: from 5.mo69.mail-out.ovh.net ([46.105.43.105]:44945) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZ8Ks-0001M4-W6 for qemu-devel@nongnu.org; Mon, 25 Nov 2019 01:59:03 -0500 Received: from player697.ha.ovh.net (unknown [10.109.159.48]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 7E21A6D944 for ; Mon, 25 Nov 2019 07:59:01 +0100 (CET) Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr [90.76.50.223]) (Authenticated sender: clg@kaod.org) by player697.ha.ovh.net (Postfix) with ESMTPSA id 74A3CC80947F; Mon, 25 Nov 2019 06:58:55 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH v6 05/20] ppc: Introduce a ppc_cpu_pir() helper Date: Mon, 25 Nov 2019 07:58:05 +0100 Message-Id: <20191125065820.927-6-clg@kaod.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191125065820.927-1-clg@kaod.org> References: <20191125065820.927-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 8914031038632791014 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudeitddggeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdqfffguegfifdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpledtrdejiedrhedtrddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrheileejrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt 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: 46.105.43.105 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: C=C3=A9dric Le Goater --- include/hw/ppc/ppc.h | 1 + hw/ppc/ppc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h index 4bdcb8bacd4e..585be6ab98c5 100644 --- a/include/hw/ppc/ppc.h +++ b/include/hw/ppc/ppc.h @@ -5,6 +5,7 @@ =20 void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level); PowerPCCPU *ppc_get_vcpu_by_pir(int pir); +int ppc_cpu_pir(PowerPCCPU *cpu); =20 /* PowerPC hardware exceptions management helpers */ typedef void (*clk_setup_cb)(void *opaque, uint32_t freq); diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 52a18eb7d7a3..8dd982fc1e40 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1495,15 +1495,20 @@ void PPC_debug_write (void *opaque, uint32_t addr, = uint32_t val) } } =20 +int ppc_cpu_pir(PowerPCCPU *cpu) +{ + CPUPPCState *env =3D &cpu->env; + return env->spr_cb[SPR_PIR].default_value; +} + PowerPCCPU *ppc_get_vcpu_by_pir(int pir) { CPUState *cs; =20 CPU_FOREACH(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - CPUPPCState *env =3D &cpu->env; =20 - if (env->spr_cb[SPR_PIR].default_value =3D=3D pir) { + if (ppc_cpu_pir(cpu) =3D=3D pir) { return cpu; } } --=20 2.21.0