From patchwork Wed May 8 00:06:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163566 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1991309ilm; Tue, 7 May 2019 17:12:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMmSfnMLHHmcbvnWtU4FsWiNAItRGkH86flPtx0oRPlCctMITivRJ8PNbS3XSNrBmAN/kL X-Received: by 2002:adf:dece:: with SMTP id i14mr2269154wrn.138.1557274376352; Tue, 07 May 2019 17:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557274376; cv=none; d=google.com; s=arc-20160816; b=icwns8v/v6okDNfFTKLijaDZkHEooqqVzXyj3DgRrSiMUXXEeiCu25YpT5sd1Jr/M0 IgBLa6lRWpBjxkMnTSjm4DdKdrPS+VXU3aiVoL9Xooi1xC9rCf0V97i0E8N5OhF7QrEB VmHAwNehIG4nZd3TBf4VB+G2SqRQFJGHGzI26BT7zbioZG5rcmT81LWvLwxWZcVon26s Z6O0IHJG/4tiDxSBWkRCvgu4RuJzsi8E2T+s4ZqixGChZoJFDCowRgbSzT1EEm5FnEBR orpeWB6Y+BZCSh9u9HtITu8eg+zPJRcNLC3hiQGOK5ZKrqnLE9vrGe3c5rXmbwXegrzU 5Fhg== 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=bsBvgkjLp0ir6Bx0e+Ug5zY9yKjm3Gk42ZlTiG9RLWY=; b=jQrK8vD4rh3rmnhIuWg6FJGMVPmU4YTWNek54klWyNKKRv1B4n4gGUb+fG9YgDopBu BcjVpjDGoXVg4Purwq58zEB4EGTLI06HNbpcf9aI7D04p/HuyeB9egmEnBCSr4IbClUr YFDcQpQx7VdAvmlay2+qI1EB/bmViHchqhg3b9/4APNuBoqTs9pKtaFMH+6V2FJw3+Gx Co+5rnLxKFyOB3r2uUclnAQVyNaU3vhkwQAM8LUcv0Lqh1WbpVqKigCk9UIgVO93WaiS gdloG94r0bp8HmErPpnkVtW3llvAp3UINl1WnAydq7c0SUbz445SLFrKSvYh2daBjEvT /TPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ih/utePT"; 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 e3si4041127wrx.47.2019.05.07.17.12.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 May 2019 17:12:56 -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="ih/utePT"; 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]:56461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOACb-0003sB-6v for patch@linaro.org; Tue, 07 May 2019 20:12:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA6w-0007JK-4F for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOA6u-0006Pd-WF for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:02 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:38290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOA6u-0006NL-QE for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:00 -0400 Received: by mail-pl1-x642.google.com with SMTP id a59so8962778pla.5 for ; Tue, 07 May 2019 17:07:00 -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=bsBvgkjLp0ir6Bx0e+Ug5zY9yKjm3Gk42ZlTiG9RLWY=; b=ih/utePTSB4D4lO+CyQSOod8ybvtckx3m4y2J0UhKokwdWnEdxo8mTauI5xLl1Gcps z91ZjYynzPk9mC/JCKHOibBgR0zZNvWWIViocWs4yJuUE34FYrdCoi+KH3QTtcSKAgiA Yj+NlmgbTk0DYh8rrOhL6LbVTovvYJzH83DQuVz+uhpM1oZyFZukecs4+jpKwdqBOvUa QXNQaKrIqShBrcS6JkGsbxf/Alnjj8G6z3BrWAqh0OxI9XLi22rb+HQPQb6+7kpzTeup RfEbfCb4/3Z/kAZZFf8zJrSz+4CI1IVdvXTsy8IqI7l672UW+yCr5s0X+Tu0dp50qbyS x/+Q== 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=bsBvgkjLp0ir6Bx0e+Ug5zY9yKjm3Gk42ZlTiG9RLWY=; b=AYRhwdgczhiGVPUdfzYUgtjIBu8QJOEJ1Yh3nzcuQOtp7s/b+O4D+I9AWUKAAFXQib rlDpDWXVzL3+MviIqmcQwHHOqIbHVA/92uGopJRSqsMjKqXC4OJWZD2kyZlqShld5d6l /notvxFJlWB2Hjv7BhyLy1A2dFcX1y5eNuoSzZV4wR1cUY36wrgeBc/PZme9HavnYe2r 6RMzKQyj3TDPQQgYSq1gnsW4mOtTSUiOxOiyywkOqGcxi7jySsESOUodFBlEp4ZsixDe PELlkD6WwJKIZuERH+GXeU5w5OaHnzAY7oVjlWxXKxtC0OaxSlk333VnfYTxNhOvbqeA 7x2A== X-Gm-Message-State: APjAAAVrb1hfixfgsIsYv5kNtM9qlpB8SsJmUn1QS6BiVM1oPwiMUcvZ sl4iHqZgsoyPKev52frxSjCn0g3AmGo= X-Received: by 2002:a17:902:9a03:: with SMTP id v3mr44946134plp.27.1557274019496; Tue, 07 May 2019 17:06:59 -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.06.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 17:06:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 17:06:14 -0700 Message-Id: <20190508000641.19090-13-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::642 Subject: [Qemu-devel] [PATCH v3 12/39] target/cris: 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/cris/cpu.h | 5 ----- linux-user/cris/cpu_loop.c | 2 +- target/cris/mmu.c | 3 +-- target/cris/op_helper.c | 10 +++------- target/cris/translate.c | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) -- 2.17.1 Reviewed-by: Alistair Francis diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 883799b463..7f244ad545 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -183,11 +183,6 @@ struct CRISCPU { CPUCRISState env; }; -static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env) -{ - return container_of(env, CRISCPU, env); -} - #define ENV_OFFSET offsetof(CRISCPU, env) #ifndef CONFIG_USER_ONLY diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c index 7ec36cb0b5..86e711108d 100644 --- a/linux-user/cris/cpu_loop.c +++ b/linux-user/cris/cpu_loop.c @@ -23,7 +23,7 @@ void cpu_loop(CPUCRISState *env) { - CPUState *cs = CPU(cris_env_get_cpu(env)); + CPUState *cs = env_cpu(env); int trapnr, ret; target_siginfo_t info; diff --git a/target/cris/mmu.c b/target/cris/mmu.c index 9cb73bbfec..2acbcfd1c7 100644 --- a/target/cris/mmu.c +++ b/target/cris/mmu.c @@ -288,7 +288,6 @@ static int cris_mmu_translate_page(struct cris_mmu_result *res, void cris_mmu_flush_pid(CPUCRISState *env, uint32_t pid) { - CRISCPU *cpu = cris_env_get_cpu(env); target_ulong vaddr; unsigned int idx; uint32_t lo, hi; @@ -312,7 +311,7 @@ void cris_mmu_flush_pid(CPUCRISState *env, uint32_t pid) if (tlb_v && !tlb_g && (tlb_pid == pid)) { vaddr = tlb_vpn << TARGET_PAGE_BITS; D_LOG("flush pid=%x vaddr=%x\n", pid, vaddr); - tlb_flush_page(CPU(cpu), vaddr); + tlb_flush_page(env_cpu(env), vaddr); } } } diff --git a/target/cris/op_helper.c b/target/cris/op_helper.c index d4479167a5..0e323c1dd7 100644 --- a/target/cris/op_helper.c +++ b/target/cris/op_helper.c @@ -67,7 +67,7 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, void helper_raise_exception(CPUCRISState *env, uint32_t index) { - CPUState *cs = CPU(cris_env_get_cpu(env)); + CPUState *cs = env_cpu(env); cs->exception_index = index; cpu_loop_exit(cs); @@ -86,8 +86,7 @@ void helper_tlb_flush_pid(CPUCRISState *env, uint32_t pid) void helper_spc_write(CPUCRISState *env, uint32_t new_spc) { #if !defined(CONFIG_USER_ONLY) - CRISCPU *cpu = cris_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); tlb_flush_page(cs, env->pregs[PR_SPC]); tlb_flush_page(cs, new_spc); @@ -100,9 +99,6 @@ void helper_spc_write(CPUCRISState *env, uint32_t new_spc) void helper_movl_sreg_reg(CPUCRISState *env, uint32_t sreg, uint32_t reg) { -#if !defined(CONFIG_USER_ONLY) - CRISCPU *cpu = cris_env_get_cpu(env); -#endif uint32_t srs; srs = env->pregs[PR_SRS]; srs &= 3; @@ -140,7 +136,7 @@ void helper_movl_sreg_reg(CPUCRISState *env, uint32_t sreg, uint32_t reg) D_LOG("tlb flush vaddr=%x v=%d pc=%x\n", vaddr, tlb_v, env->pc); if (tlb_v) { - tlb_flush_page(CPU(cpu), vaddr); + tlb_flush_page(env_cpu(env), vaddr); } } } diff --git a/target/cris/translate.c b/target/cris/translate.c index b005a5c20e..c0af9665fc 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3104,7 +3104,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) * delayslot, like in real hw. */ pc_start = tb->pc & ~1; - dc->cpu = cris_env_get_cpu(env); + dc->cpu = env_archcpu(env); dc->tb = tb; dc->is_jmp = DISAS_NEXT;