From patchwork Thu Mar 28 23:03:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161357 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1338116jan; Thu, 28 Mar 2019 16:39:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqycrs3zDRDRvuHmL75IMKEXvwvgBnOOX+b+dvX2jK4S/0PHuZPVWV0SWiaIAaOzHRe0jZFF X-Received: by 2002:a6b:b7d8:: with SMTP id h207mr30839572iof.210.1553816340983; Thu, 28 Mar 2019 16:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553816340; cv=none; d=google.com; s=arc-20160816; b=Mf3lt4Qfo7GrNXpGr3rqGa0ET4z7BMWCgnB2fZphoAr9iY8vM6ZEBN2qI3dJ+/qFDs wbrn4HHacOok0U++4UHKTJESJgaSwDrxP4/s5lL86wZ9eqTIoCILr1dNG5v/O+Hbmt+H GIhxXrbE9X5sKSj2InLqhmoVxV3hZj0cOAu6vv+H2jI4atwa1oxGi67jzom1GeI2f4Hr sdUozU+biXmYldM8G1NOZzJFrgzZEAi5FAU3+a7of6YNifeBeQJeeG5zJEitZZPS/Pue PfP2Fc5WJHK6s3+xVtc1Ye7V5wlFSxTqGD7htp3zwT6SCAQ3jc7OtGk4r61LDmx8Htcu DkBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=mkqdyW5/3Htii3Wd/GiAKdhmnJwDMiTansAHma9RvjA=; b=Xxyf9VXGbrr3mpcLrb9J05bBHQMYcaqChRECaRegvCjRV28N9NqzDEP4FAMXyj88OG Cb6EFLjND5HycFdePgV8R2Nq8UV2SMpAdwn38TSzP9sQkrcCc8TuYbSgu4jTsFEGbDJf dsqITLjSYejee7RZOYR3B1WUPVyjBvz4LDeBPjzL/24PaF0WK/gzZV4vlW/ojy10+Q43 JvZdx1zNfDakYEFBJSepFVxqnTagtnF9dOUlD6UarfzePtyoMz9bjtk4832+3/INyYCS f36x9e/SpksAO7LF//CzOE7nNZjuK83ff0prKw8aDT2yOoh4V8a43FWqo4BqAf9EsArL 3jrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U8BFFBIh; 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 t62si245709itt.128.2019.03.28.16.39.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Mar 2019 16:39:00 -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=U8BFFBIh; 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 ([127.0.0.1]:43424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9ebs-0001b0-93 for patch@linaro.org; Thu, 28 Mar 2019 19:39:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9eKq-0001dn-N0 for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:21:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9e4c-000364-EY for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:04:41 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:40993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h9e4b-00035V-6S for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:04:37 -0400 Received: by mail-pf1-x444.google.com with SMTP id 188so76039pfd.8 for ; Thu, 28 Mar 2019 16:04:37 -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=mkqdyW5/3Htii3Wd/GiAKdhmnJwDMiTansAHma9RvjA=; b=U8BFFBIhQZK5UIw5o64o4tNuRHoTEIeXz9wTZ6zJG2IqO9iCf9+pw79egwzitBNBL+ sOBRPgVnrghUqkP8hGWpbvwM6hU6c/ZOc6OfjJ7B3UD0/4VfaPwiXnssbkHKQi2Zb7iV lANDekogZVF0rvSxcNnwHgKfK3HF5V6TEtadGNlZX/OJOpi5LyCSZjTZEUkpU2EwZSAs FKrFRQXbFjM6pt7vF9rRXhGakV2sKyiDad5U1VwRBh1fr4T9Xh5pHTE3PZhLHTJ+yFQQ HdtvnzOuGBTSonsPPw/kYvLzdT5OB4QY74BbvKadH9qzmdXZdxxZhwFjcRWpbkZBRwB6 4KbA== 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=mkqdyW5/3Htii3Wd/GiAKdhmnJwDMiTansAHma9RvjA=; b=uBB6F+hiM2gNDkV4WR/eIH/fb+j3If16XlhUWpGX/s6UTraUR11afrVFqF2vBfBFRL tH0UgrrwTbXgDqoc+JOZtaI+tdpcBCcOwfhyl47RYl1gr75+njoQcMyY2oRM0MMblQEM zGeE9SxNlbObFs/FpZVCzZ8hBQu71ZnLw28kbYcYCLyRUL8qyg18jiGRMs2yCVZzgVJd O/97fGSlD3n8ky1uUz7PBDw2mN+IMLJHPxEydg9QyyDE+e4UkKO3YcM06x7gAokYwEPK dsppUHZU5keOGiEJdDAEQ2+75mWFMwRd2COjDyDqHDRUVybBp+JF6KYR9mUUn8WZQLIc /U6g== X-Gm-Message-State: APjAAAUTrseQwQwNS2kUG6zoKFd2FA2ZzHWU8YkaJiAAzWYnucOg4iAF E5k0asFTSm3BxT/tcg23JhlJqn9iSKg= X-Received: by 2002:a62:75d7:: with SMTP id q206mr20281085pfc.213.1553814275997; Thu, 28 Mar 2019 16:04:35 -0700 (PDT) Received: from cloudburst.ASUS (cpe-66-75-72-255.hawaii.res.rr.com. [66.75.72.255]) by smtp.gmail.com with ESMTPSA id f1sm280911pgl.35.2019.03.28.16.04.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 16:04:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2019 13:03:45 -1000 Message-Id: <20190328230404.12909-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190328230404.12909-1-richard.henderson@linaro.org> References: <20190328230404.12909-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::444 Subject: [Qemu-devel] [PATCH for-4.1 v2 17/36] target/moxie: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/moxie/cpu.h | 5 ----- target/moxie/helper.c | 6 +++--- target/moxie/translate.c | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index c050d6e15d..71e7cf0f08 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 f3d8ee7d6b..a22870228c 100644 --- a/target/moxie/helper.c +++ b/target/moxie/helper.c @@ -42,7 +42,7 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, 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. */ @@ -79,7 +79,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); @@ -89,7 +89,7 @@ void helper_debug(CPUMoxieState *env) void moxie_cpu_do_interrupt(CPUState *cs) { - CPUState *cs = CPU(moxie_env_get_cpu(env)); + CPUState *cs = env_cpu(env); cs->exception_index = -1; } diff --git a/target/moxie/translate.c b/target/moxie/translate.c index 68ca223e22..bb25a3dee7 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, struct TranslationBlock *tb) { 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, max_insns;