From patchwork Sat Mar 23 19:09:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160971 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2187386jan; Sat, 23 Mar 2019 12:33:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHjgHSqGMbAQbccaWeeK9F9hdOKYcCRpNaTdmP6WvtmdqJ8h4W2NpB4BTJqxgujLrNLVF5 X-Received: by 2002:a81:6507:: with SMTP id z7mr13480680ywb.90.1553369584724; Sat, 23 Mar 2019 12:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553369584; cv=none; d=google.com; s=arc-20160816; b=jIfbPKsjTuCcdYGxxWXUTKNtc+XQEPTp/aoyvAW5V4AcG7xwUn3RFqQ7+zX0Ynnp1v 9cOXK4aam3+3JdCYLoPe6tGG55Knn1Xfi+I6/qB3Fkt3v8BNET9u2UMSDQG2kUGmJVMs JcR72nio5/dYl9P9pdRdMGhVX165cmEqd1uwv6+/gtl13MwqmvVZ8pJWSBAm0Qfd+G9y MoZ2fASeIPf4TmGV1TuTMFBc1U2HO7PGt7nzSezXdYnW5kQpVCuxJV8BNz7Qm84ySrF3 eaL2t++IlAYsqFuO90C2JIACz61ZL2AYBR+QZwNq65YcWWmUdXB15Ig2ejX5dLwyjEvE 6k5A== 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=ZBOaSrZYu8TLC7VlABk86U3Pi8aEE6O+6qtsbgXkLvZzB9JL8Zj8cBQUb2JwT84dvm TYysv0S7YheLFLQhpRGCxlInR7UK67HXhHhge9s/8ckVMdrGn8CRr8qMs+pz93xqIeBR 7SadNJo136RuwO6bnPKz4yf05Bfb+lfNlXssKcH2hsC9lxwSz4tuQQozuXuK+4LgKVps DPjxahSguJI9g5+AueCsPVOr90kJopOnRIpP60cvlP46sPoh2NFB0dLwqMSvl6yQ3wWl iiezhfs49ZaCf+bKavZcbCSbuQcroSgIJMfHar2sKNCLiXFcZO47WT5Bq3CFwDtqajJy C80g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fjVzLr8h; 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 o4si862160ybq.85.2019.03.23.12.33.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Mar 2019 12:33:04 -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=fjVzLr8h; 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]:47061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mO8-0005xI-6S for patch@linaro.org; Sat, 23 Mar 2019 15:33:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mFv-0007kB-WA for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7m2G-0007Mw-Cw for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:10:30 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:46021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7m2B-0006v9-P9 for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:10:24 -0400 Received: by mail-pg1-x542.google.com with SMTP id y3so3683515pgk.12 for ; Sat, 23 Mar 2019 12:09:50 -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=fjVzLr8hPMK9JQIotiRP0mttj40Zq0kMKyBQ9JsrIPCjUpuXdIcJG86vxuM95dpdRq NaNk+6Fc3Mlj+c2Yj41iQBtg5p88sdcG0+tZoG8aD1rWKcWI8nYYCWI1RlmUXyEMc9Cf NpWgBQVtbWyhnV5yarKS1fCRLF0eTYOscJOTWi3vWPb6AGd6lbHh/oWfJFv6qab5UX1y iNphyGiVrWdqE/zHjcoAKu9IL/BrkbOpF8LIUsZOhN53BsRN7ykapL84z4dJbO1Tnhwl H7d+2iXeRhpxMwjGJzAm8KbA7Fp+80IG85ARf2pifcI19CQP5fxUMJ9kz5ve3u89tMSL liBg== 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=WKOAQBxzpwleoRhxg1HR8aZ4cIm5qRNFSsSYl2xi2BN/KM2O8bwg6xymMlx0jOIsX/ D3fWYZQ4TX++8apHSr7lXI2t9VG80aDlKxlSucSniQ+ykiM65VDUS3pWlCB4+oSqh7ID 9xbU/IGp9qTGa15rZucdM6J/tQ4VmcNS1GmIePfnYWz+gv5Z7JNkO4zcmeylS7Z+sVe/ 4MqSIsuS+Jrhws4qHyoy/80feYpCOYtfEAhysLWtIwn0nha7yqYid5+qeHBoNBNy4a0f Dp82jjfvxt4RmmuYMN5Uh0LuRkZ/pVZxr2ZJEcuwLd8oZR91p2vZ4r8z9A4c2QpcG3+w Scsg== X-Gm-Message-State: APjAAAXesgiSXmgNr5xHXfdnuYPIkjhZQPtNfy5jc+3LO04Q3pEiIMZD m8JtspGhc0SebX775gnhPOrfeWmbpXQ= X-Received: by 2002:a63:f84d:: with SMTP id v13mr15348891pgj.384.1553368189714; Sat, 23 Mar 2019 12:09:49 -0700 (PDT) Received: from localhost.localdomain (174-21-5-201.tukw.qwest.net. [174.21.5.201]) by smtp.gmail.com with ESMTPSA id h184sm25990703pfc.78.2019.03.23.12.09.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 12:09:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Mar 2019 12:09:07 -0700 Message-Id: <20190323190925.21324-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190323190925.21324-1-richard.henderson@linaro.org> References: <20190323190925.21324-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::542 Subject: [Qemu-devel] [PATCH 17/35] 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 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;