From nobody Thu Nov 6 19:07:13 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 148834352709129.586268404370003; Tue, 28 Feb 2017 20:45:27 -0800 (PST) Received: from localhost ([::1]:38332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciw8j-0007uX-7u for importer@patchew.org; Tue, 28 Feb 2017 23:45:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciw7f-0007ty-56 for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciw7e-0008Rv-1S for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:19 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34003) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciw7d-0008RE-Jb; Tue, 28 Feb 2017 23:44:17 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vY2sQ15kSz9s7m; Wed, 1 Mar 2017 15:44:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1488343450; bh=59tMH+omInj1pVlmxJJW36BmlMITHufR+3Wn+ZN8geg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YkDo/0bKA0lAHf56y1xJ6hSOBrpQJHHEyjTyWQ3KlPArWy7dojq1aKjym8y7992zS y7xuBZRKTzieiJ6nUrVK/rhD0qBekqYD/xcVgYuxpzN+NeUc9xsNLht2m6bxcCkGtI t9BNdTy4VS0Eo9i/xG6Y8OxRi0RxyABa0begLKyI= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 1 Mar 2017 15:43:16 +1100 Message-Id: <20170301044405.1792-2-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> 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 01/50] target/ppc: move cpu_[read, write]_xer to cpu.c 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, Nikunj A Dadhania , aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Nikunj A Dadhania Signed-off-by: Nikunj A Dadhania Reviewed-by: Richard Henderson Signed-off-by: David Gibson --- target/ppc/Makefile.objs | 1 + target/ppc/cpu.c | 36 ++++++++++++++++++++++++++++++++++++ target/ppc/cpu.h | 14 ++------------ 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 target/ppc/cpu.c diff --git a/target/ppc/Makefile.objs b/target/ppc/Makefile.objs index a8c7a30..4f4168f 100644 --- a/target/ppc/Makefile.objs +++ b/target/ppc/Makefile.objs @@ -1,4 +1,5 @@ obj-y +=3D cpu-models.o +obj-y +=3D cpu.o obj-y +=3D translate.o ifeq ($(CONFIG_SOFTMMU),y) obj-y +=3D machine.o mmu_helper.o mmu-hash32.o monitor.o diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c new file mode 100644 index 0000000..de3004b --- /dev/null +++ b/target/ppc/cpu.c @@ -0,0 +1,36 @@ +/* + * PowerPC CPU routines for qemu. + * + * Copyright (c) 2017 Nikunj A Dadhania, IBM Corporation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "cpu-models.h" + +target_ulong cpu_read_xer(CPUPPCState *env) +{ + return env->xer | (env->so << XER_SO) | (env->ov << XER_OV) | + (env->ca << XER_CA); +} + +void cpu_write_xer(CPUPPCState *env, target_ulong xer) +{ + env->so =3D (xer >> XER_SO) & 1; + env->ov =3D (xer >> XER_OV) & 1; + env->ca =3D (xer >> XER_CA) & 1; + env->xer =3D xer & ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)); +} diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 425e79d..b559b67 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2343,18 +2343,8 @@ enum { =20 /*************************************************************************= ****/ =20 -static inline target_ulong cpu_read_xer(CPUPPCState *env) -{ - return env->xer | (env->so << XER_SO) | (env->ov << XER_OV) | (env->ca= << XER_CA); -} - -static inline void cpu_write_xer(CPUPPCState *env, target_ulong xer) -{ - env->so =3D (xer >> XER_SO) & 1; - env->ov =3D (xer >> XER_OV) & 1; - env->ca =3D (xer >> XER_CA) & 1; - env->xer =3D xer & ~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)); -} +target_ulong cpu_read_xer(CPUPPCState *env); +void cpu_write_xer(CPUPPCState *env, target_ulong xer); =20 static inline void cpu_get_tb_cpu_state(CPUPPCState *env, target_ulong *pc, target_ulong *cs_base, uint32_t *f= lags) --=20 2.9.3