From nobody Tue Feb 10 06:57:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1559681605; cv=none; d=zoho.com; s=zohoarc; b=jEsAkHf4oIrn4oc4WEiDTvXVFH4FMMNTe2mRRwojnsxdqaZCjNOVAh1n+xgaOZS/zJik1mUFqvELUWBYV2bYOwmcpjvs5/3WB32GS5RcNy4isbNvIvdZAxp23+eQxVj/0xY8etTEZ18K0UE7oVMyGd3bZI/x9ccxo0GZHALce6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559681605; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tSiI4G5J5ouiA/gsVkWkdNcl9+jS6pdNMYuFN+MKcoA=; b=kJnynyOKzVlkW1ZhdV5SU2GJ4WLwF0cY+UHfGCqC5r39WKTCRt3N4P7GiVZVOOoUpnpIjWRK/ZIyiWvHa7Nm1PL4YkowhwVI04nvkGTQY0HW5c1b2Irzwvbc363U6q6gA35lGBoQTBo64eXYKHHAYne3tdmRpMBT/t2ByRrMIVU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559681605326261.67338333328235; Tue, 4 Jun 2019 13:53:25 -0700 (PDT) Received: from localhost ([127.0.0.1]:57854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYGQm-0008Il-5R for importer@patchew.org; Tue, 04 Jun 2019 16:53:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYG8c-0001K6-7O for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYG8b-0004Q6-7Q for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:30 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:40974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYG8b-0004PM-2G for qemu-devel@nongnu.org; Tue, 04 Jun 2019 16:34:29 -0400 Received: by mail-oi1-x241.google.com with SMTP id b21so12668685oic.8 for ; Tue, 04 Jun 2019 13:34:29 -0700 (PDT) Received: from localhost.localdomain (200-56-192-86-cable.cybercable.net.mx. [200.56.192.86]) by smtp.gmail.com with ESMTPSA id h1sm5979901otj.78.2019.06.04.13.34.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 13:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=tSiI4G5J5ouiA/gsVkWkdNcl9+jS6pdNMYuFN+MKcoA=; b=jiF+zYDfziQIWsSLbY3qDc8I+sLKQVvgdJtiOLtlpnKPGRm1QzKc9pMKi1Y4LqCC1e b3PxHsP33RiaC33MXSMSD58AmDey5CU2u+8kOaZ1D8Y3Ds/8+CsSDC+yPF/LiwppZ194 x6BZNurk2Vzyfs3BIf+ArQSTjkGkfuJ1WZhbdZWUclCZf2QeSHNdGjxRP125zFMDeUsx r+4P8uZB44u/THcDynkL9XYeU0Z1knvS4oSQdx9ijnmBrv3OkBTjNq3RrbLkKXLVHxxJ l72XRQNAG3kYPVOfOSrdx3DShwD7N8ZDesZpgsf/9ICiCUxpvV/EhAPRpGCI+WFiXXch gSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=tSiI4G5J5ouiA/gsVkWkdNcl9+jS6pdNMYuFN+MKcoA=; b=saHF9L5Xr+REGykqdw/dBfeuN4oD6pqF93mbxY2UAsErBqilzqDdb+g3rIGUuFqIC+ Ff2/Tg2iHZySWkTqp/IL1/mq1oo4Ylp3kOAv2HqLRPzVUcgIcBdpdYgEHSInnNqqXFNg vtaCK8IS9/s/hbD2Wwie+FWj5p3QaAtuU7e10HI9Rb+zagswnQrlOtRsEAapPyW1maGa fHrHS5dspVAd+gQqrBe+JrgLYJYKg63g9dOFRpqZy03IwOjUzN3Keb79Ddo790jd5dA6 emSYdCn+r0uN0gOapiSc9wOVNaP80IILa5475ucyfSjQJfbY2ASTB1cCr/F16dh93EFU oPaw== X-Gm-Message-State: APjAAAUrp3NGBA8g73BBz4+6vLNhtVjmtrhRTHHb6fnsUY60eKlI6/z3 6V2DPQRg5uL7d6umXB9IgR2dJhsV6psa0g== X-Google-Smtp-Source: APXvYqyry3ccnGol7smOk24OC2BSLzUQ/KENwsFf4iV3iSFSRjf14JlsSKCkVhV8Zk5+56N4N0VIcg== X-Received: by 2002:aca:5f8b:: with SMTP id t133mr5736686oib.85.1559680468104; Tue, 04 Jun 2019 13:34:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 4 Jun 2019 15:33:33 -0500 Message-Id: <20190604203351.27778-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604203351.27778-1-richard.henderson@linaro.org> References: <20190604203351.27778-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::241 Subject: [Qemu-devel] [PATCH v4 21/39] target/openrisc: Use env_cpu, env_archcpu 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cleanup in the boilerplate that each target must define. Replace openrisc_env_get_cpu with env_archcpu. The combination CPU(openrisc_env_get_cpu) should have used ENV_GET_CPU to begin; use env_cpu now. Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/openrisc/cpu.h | 5 ----- linux-user/openrisc/cpu_loop.c | 2 +- target/openrisc/exception_helper.c | 5 ++--- target/openrisc/sys_helper.c | 8 ++++---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 50f79d540b..9e46ac5266 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -317,11 +317,6 @@ typedef struct OpenRISCCPU { =20 } OpenRISCCPU; =20 -static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env) -{ - return container_of(env, OpenRISCCPU, env); -} - #define ENV_OFFSET offsetof(OpenRISCCPU, env) =20 void cpu_openrisc_list(void); diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index f496e4b48a..4b8165b261 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -23,7 +23,7 @@ =20 void cpu_loop(CPUOpenRISCState *env) { - CPUState *cs =3D CPU(openrisc_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); int trapnr; abi_long ret; target_siginfo_t info; diff --git a/target/openrisc/exception_helper.c b/target/openrisc/exception= _helper.c index 0797cc9d38..d02a1cf0aa 100644 --- a/target/openrisc/exception_helper.c +++ b/target/openrisc/exception_helper.c @@ -25,15 +25,14 @@ =20 void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp) { - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); + OpenRISCCPU *cpu =3D env_archcpu(env); =20 raise_exception(cpu, excp); } =20 static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc) { - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D EXCP_RANGE; cpu_loop_exit_restore(cs, pc); diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 05f66c455b..8f11cb8202 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -30,8 +30,8 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong r= b) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + OpenRISCCPU *cpu =3D env_archcpu(env); + CPUState *cs =3D env_cpu(env); target_ulong mr; int idx; =20 @@ -194,8 +194,8 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, targe= t_ulong rd, target_ulong spr) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + OpenRISCCPU *cpu =3D env_archcpu(env); + CPUState *cs =3D env_cpu(env); int idx; =20 switch (spr) { --=20 2.17.1