From nobody Tue Feb 10 02:28:13 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=1560133194; cv=none; d=zoho.com; s=zohoarc; b=DUm4JtCJn3NcNR0J3yP+UpcWYpeDoRJm1UrmpS3c113UO5gjVuev9zkffrYRO9ovQsFEqcvAFrPfuYSzAnBW4NNeqOIYRr9rK6O5Kf4qr+50u+OHruZH7cUgtaj8nWf3IFeJQ1Qz9uX+A6LK2SmiAFp0x0kM45jBKJK2os5KQt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560133194; h=Cc: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=QgB0Nu+t0mnNwyHYnQWVmh0yxCdODZBJfwH8/zBCUgo=; b=AA1EDSxOvh327aVBhVTK91HcyOOfPyNOU0akchiHSkytiliOdRoOI/rE6pJW4w9uNy/R65kqp1EmdRqrAEou7KinopB7jSspxZffPsgRoDlfiZz9s9wqRfegotuEdcaOvyIVJBlyRa+87trTmOr8Wwgr5viORDiDYc3HkPxTH50= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560133194136890.2032499666913; Sun, 9 Jun 2019 19:19:54 -0700 (PDT) Received: from localhost ([::1]:39714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha9uZ-0004qg-CW for importer@patchew.org; Sun, 09 Jun 2019 22:19:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53124) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha9e2-0006Ei-2e for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:02:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ha9e1-0001l2-3A for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:02:46 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:44311) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ha9e0-0001kZ-Tq for qemu-devel@nongnu.org; Sun, 09 Jun 2019 22:02:45 -0400 Received: by mail-pl1-x62a.google.com with SMTP id t7so372418plr.11 for ; Sun, 09 Jun 2019 19:02:44 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id l63sm9749013pfl.181.2019.06.09.19.02.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 19:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QgB0Nu+t0mnNwyHYnQWVmh0yxCdODZBJfwH8/zBCUgo=; b=BwlYGcqRvTqqTTj86O4PyI6MUqVgFjfAK7QGWBsrVIDFe94kq4sBN1MdoYsTlSXjHd drHZoCOplE1r6SoJKTb9j2172Ljh5/ee6lVSry4FUAbOShTT0WMUQkG5gen51AT7F18B bi2z+1P/KzRg98NqVJWTZk3tq4WmpWpYlfiHaRAieCzRKdoN7x7EscsV5Ot71CqPscSZ ZEILsQeEPpumQ2Z/XKOiWrpKop+WjSRJ8v5OvnSRPu8O8NuWYBod7+1J12jb5sDjxuqQ 4YW1A+H6jeOjjSkn3swWvQbyTz0Lfwsna6uNSo/wtATccf6MXE1r6LR6kJWACWzNvWZw YuRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QgB0Nu+t0mnNwyHYnQWVmh0yxCdODZBJfwH8/zBCUgo=; b=MlWLEK6XMqEAxvZBAkd/V5GMumiqQlh2ZMSrV/5Fd9taCJjSaHCToHqUl5tMRaAsGB 9QtiP/6+XPglK2tU/Pg5Wc5Am6oqQLrnku9ZRQ3Ytp2zhxKMo+eGInAvT49pFe3FaHyq 21b7en2/sjyElAvWJPif6iZWhDFIz05sRNkKo9cGP+1ARbhopsf7X71SHE1Ne3ZWurIy RAJVay+/N7Ja22mmyaxJCYrwvQNm8BhvXEKN9UHnb7pDrK42ADF6h8qr6e94X3luS2ik jHmDPsBww0HSuq4TJomYLUZ0MmR8ALa8haZkwYDZbpujuieOI2xEG8t6NAq86PUN8lde FvwQ== X-Gm-Message-State: APjAAAUUfI7OF94D1xi1G8zq6OENBDc9m+qrWv5slxM3ChmTVLMJw+3O h1UMvz3FblrYpiqDKBKsWXJC/SpXits= X-Google-Smtp-Source: APXvYqwGOZfGmfoqrb+E78oIhc3FNKCEnEYB3s0dBzxFQY+RxzzCOXv8Ri3W1/elfzCNY5nTyExxqQ== X-Received: by 2002:a17:902:7793:: with SMTP id o19mr7838314pll.110.1560132163631; Sun, 09 Jun 2019 19:02:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Jun 2019 19:01:58 -0700 Message-Id: <20190610020218.9228-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610020218.9228-1-richard.henderson@linaro.org> References: <20190610020218.9228-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::62a Subject: [Qemu-devel] [PULL 19/39] target/moxie: Use env_cpu, env_archcpu 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: peter.maydell@linaro.org 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 moxie_env_get_cpu with env_archcpu. The combination CPU(moxie_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/moxie/cpu.h | 5 ----- target/moxie/helper.c | 4 ++-- target/moxie/translate.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index 275fb9bfbb..b9f5635e50 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -90,11 +90,6 @@ typedef struct MoxieCPU { CPUMoxieState env; } MoxieCPU; =20 -static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env) -{ - return container_of(env, MoxieCPU, env); -} - #define ENV_OFFSET offsetof(MoxieCPU, env) =20 void moxie_cpu_do_interrupt(CPUState *cs); diff --git a/target/moxie/helper.c b/target/moxie/helper.c index f5c1d4181c..b1919f62b3 100644 --- a/target/moxie/helper.c +++ b/target/moxie/helper.c @@ -28,7 +28,7 @@ =20 void helper_raise_exception(CPUMoxieState *env, int ex) { - CPUState *cs =3D CPU(moxie_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D ex; /* Stash the exception type. */ @@ -65,7 +65,7 @@ uint32_t helper_udiv(CPUMoxieState *env, uint32_t a, uint= 32_t b) =20 void helper_debug(CPUMoxieState *env) { - CPUState *cs =3D CPU(moxie_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D EXCP_DEBUG; cpu_loop_exit(cs); diff --git a/target/moxie/translate.c b/target/moxie/translate.c index c668178f2c..c87e9ec2b1 100644 --- a/target/moxie/translate.c +++ b/target/moxie/translate.c @@ -816,7 +816,7 @@ static int decode_opc(MoxieCPU *cpu, DisasContext *ctx) void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_ins= ns) { CPUMoxieState *env =3D cs->env_ptr; - MoxieCPU *cpu =3D moxie_env_get_cpu(env); + MoxieCPU *cpu =3D env_archcpu(env); DisasContext ctx; target_ulong pc_start; int num_insns; --=20 2.17.1