From patchwork Wed May 8 00:06:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163578 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1998799ilm; Tue, 7 May 2019 17:23:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpIrN/PkXvzG8Ju6HRUzdZIwMGEwo9Z8peL2BatFdfh0QaioYjRSamB4mASD/Th7MYpmHh X-Received: by 2002:a1c:9cd1:: with SMTP id f200mr701087wme.91.1557274997482; Tue, 07 May 2019 17:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557274997; cv=none; d=google.com; s=arc-20160816; b=A6Y+Oky0SpkZY2j6H8BkHYqKF7umadR83E3dm8YlGRSI9pwbCv3hBh6BIY3uzMClzk kgipXsKxpBml+pNnHQoQGtGOX+SnTa8bp1aBapRfKOGR9nrQZN7AnRikeQZ2PNoqq/jd CNVCzkw3WjhQJv2+/cgwdIBA+XTH59DmKyjaj3OcYAqNjVLBGDTnGtNoEj0h5AO2bTsl FOPL/4OkileoyR2BcA6UwtBgyd9LBun94tHwd2Zty7x0ZsJoQbpRWXwk9DTSDuHtAX6d IUWozB2NzdKxNkzhwrXjtxoUSEdBltFTTfaMFmPC6Z2kwY5PY94p2CyHP8O5hpDVvhkq 1F+Q== 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=ibb3OfpNtU4NVHHARrwIHaHoS9z7x74Z77VSeJYRX1k=; b=Y5n9bMVz0bEPweJOLAT3bW1NXk8gd8d7n5GM/t80CudC0YjesxAd8XtfDAEiWluKA1 43yuPhKq5R0z89GLUbtNj9gPnNBJgQvpgCsYdxZyCOIqSu8iXGVuIR2NGR1ptfPKlJ3U 9q9MFVUbw+xT+DYyoY+C1AbJEHM0OlGJz0mcbJn3MrOM1+2MXqITdvUgZPM/6JhcZ7sI BQljRBQ+djgkaPaP+u+8AwWBD0NjamFrN/c5F9vUSQMKxSszF1EzSNowf1D9X+lowF3T WC5WS4PVL4tQVM7cxSFuik7DGJUombHUJczAk+0/mXcf7kadznHrqb8ViXXtdA7HEc79 QTtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ztlVI8Vl; 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 r18si10746918wrv.176.2019.05.07.17.23.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 May 2019 17:23:17 -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=ztlVI8Vl; 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]:56606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOAMc-00054I-FA for patch@linaro.org; Tue, 07 May 2019 20:23:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA78-0007b9-Lg for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOA76-0006y1-Ku for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:13 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:38881) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOA75-0006ny-EF for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:12 -0400 Received: by mail-pf1-x444.google.com with SMTP id 10so9495480pfo.5 for ; Tue, 07 May 2019 17:07:09 -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=ibb3OfpNtU4NVHHARrwIHaHoS9z7x74Z77VSeJYRX1k=; b=ztlVI8Vl7ku1Hh+77EEChmw1UKGXCCtPzmUEmN34ktQlBedRWKj7/lpemmXpuFAQs+ 1RUBMdbzNX0Jt9dtKfXkNgR/+xQ4fGWbABmHgjHOa6qOUyGrdl6Le0J8vHw2h4SOQovD bmq4WZmlUURkeG2wpf7wgrqWFfHcm5DzAefVeZyOYInkClUMG49hcZLzAt3GluJw6foV 3kQP2dQecMJ7jUDb9AMcPpPi/YzRR/YMats9ITGSiTda3Oc1RoYjAY0YP4wq0IraaGj8 RnqDcBw4Jle6TPu6mpqNHtiWQQIhL0r+7mWxTM+Fd6VbXZbHtB8qe0p0JqDlDFIq+/Hs iHXw== 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=ibb3OfpNtU4NVHHARrwIHaHoS9z7x74Z77VSeJYRX1k=; b=kjVEkiLdleykixFKrb+rVRtHesZLnDR2yKK+LvUzyZbTwCg3MTCLKzucCtrXOimfN9 eigQdxT2+XqcEX+8VOpLY709zHvVd+vdDaZ236QADhRKJbqO6kMg/djnz8ZIAt1Sn+aJ AD4kzRW/hJqxZmcn93sYC8YDhxL0/Xz4Fl2ZuCi1ip1FPGvgrX3M1NUpllJLOV17qWPB whlSpQl3HklvRxOjbBaNQ3lqsLW2uyRBbNQuGD1QdiycrIGC4azOAA6QyC8hN481/8gl ZlkyVbh6/y7ih3nVkVigbK5NQer4f74nf5mJAwYST7zqPhRLMujihejRNs4B2fkwyuOl ZhIA== X-Gm-Message-State: APjAAAWa8jg6GBl6GGhEHUYxiKs9XrG//iFeuGvQQUdXOWJ+6whhsVvr rxeOJYxUz3ss/GCnRUb4MNnvVRc/Nkk= X-Received: by 2002:a63:e602:: with SMTP id g2mr2856250pgh.172.1557274028117; Tue, 07 May 2019 17:07:08 -0700 (PDT) Received: from localhost.localdomain (97-113-189-189.tukw.qwest.net. [97.113.189.189]) by smtp.gmail.com with ESMTPSA id j1sm15793183pgp.91.2019.05.07.17.07.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 17:07:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 17:06:21 -0700 Message-Id: <20190508000641.19090-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508000641.19090-1-richard.henderson@linaro.org> References: <20190508000641.19090-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 v3 19/39] 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" Reviewed-by: Peter Maydell 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: Alistair Francis diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index 5b9aae95d2..a481a92833 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 287a45232c..a18b21c4c0 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 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;