From patchwork Mon Jun 10 02:01:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 166257 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp472114ilk; Sun, 9 Jun 2019 19:21:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqztdnDgfHTEpPK/IkL+uPO8O55deZIhPNBkhHc3yqKftQI2Lv6qddnESxLQrzOHT0TEaFBE X-Received: by 2002:ac8:29e6:: with SMTP id 35mr13805930qtt.116.1560133272751; Sun, 09 Jun 2019 19:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560133272; cv=none; d=google.com; s=arc-20160816; b=iaNmyn8+FSuhut6dXz6z1OTSbgKMkUXqYFJQJNjkbOVcySHQ4LsDL1GH4hKByxKdWV 621WDQysjzwr2ANZMC5ayCPN09m4ZO7nmjr0SQd1BcJm+ITqUBYYsmQ24RfRwFrRZenI DjModDj3FlCz/ksg97qO646OGccNPUm8hUAEPAXP10uSDMecY21IbHJ9j3otYesUV8dU 0rxewUUWb03hiikaDLHqKK7DFbAPzVAxoPoOvPmqRtZ39x9YU1WbNuU60+fCxslseEfA JRPAqDJsurQbfV2ih6I5El4WVBUsSjjvEFITaSERujEVY6pUAj17p0tHOu7zwIRrSQBP L/Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=QgB0Nu+t0mnNwyHYnQWVmh0yxCdODZBJfwH8/zBCUgo=; b=ZqN3n/Weqc6hxauWbAsClNZV119eJPdnWhXbo8dDjBds2H/JnW7r4IlUh+JMOlFQRj qsHhDkgcRVUT9KfzYOTt8ennmGjUsbXgrHtRUHEDDAZzR7r3NM5kbqUZSRckOdTHI4NS W7rOlzwJhgkYw9zjzSjGGRIplfL7tKeebTKTtjgVagkRuGMe4e5NcvWcnQcdL2KDn6sU VHxsWBrHaAC44XhMmxKQHcbtXM0u1+vzwzNx9B2Nt2FiqKyBSVDA3ru3chXv3DjrF3d8 v48rDtCNms9qD4+qaGM6Uad72SuFEw9VlCPqRiMONbgnNdf6P9bLed+4QQAdEPqbh0VD fEHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BwlYGcqR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n10si6349894qtl.245.2019.06.09.19.21.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2019 19:21:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BwlYGcqR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha9vs-00075U-CF for patch@linaro.org; Sun, 09 Jun 2019 22:21:12 -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) 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-Received: by 2002:a17:902:7793:: with SMTP id o19mr7838314pll.110.1560132163631; Sun, 09 Jun 2019 19:02:43 -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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.1 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; -static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env) -{ - return container_of(env, MoxieCPU, env); -} - #define ENV_OFFSET offsetof(MoxieCPU, env) 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 @@ void helper_raise_exception(CPUMoxieState *env, int ex) { - CPUState *cs = CPU(moxie_env_get_cpu(env)); + CPUState *cs = env_cpu(env); cs->exception_index = ex; /* Stash the exception type. */ @@ -65,7 +65,7 @@ uint32_t helper_udiv(CPUMoxieState *env, uint32_t a, uint32_t b) void helper_debug(CPUMoxieState *env) { - CPUState *cs = CPU(moxie_env_get_cpu(env)); + CPUState *cs = env_cpu(env); cs->exception_index = 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_insns) { CPUMoxieState *env = cs->env_ptr; - MoxieCPU *cpu = moxie_env_get_cpu(env); + MoxieCPU *cpu = env_archcpu(env); DisasContext ctx; target_ulong pc_start; int num_insns;