From patchwork Sun Jun 20 22:10:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464359 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2003688jao; Sun, 20 Jun 2021 15:16:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXFJ3G+R2iK8FavprpEyoVg1C/G/vSR4CAZkzTmCdZBi8vIPfks3nDG39g0rfd4CJdY+wy X-Received: by 2002:a67:e990:: with SMTP id b16mr5583049vso.10.1624227368434; Sun, 20 Jun 2021 15:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624227368; cv=none; d=google.com; s=arc-20160816; b=AE30nfJi70ursfAHizD3Fh3x5VxXANY+LhycfhkjN7qNutZV0cTS+HMQ2+pjjIaW9+ bAvsLxXntJo9e/vVjlppDNNNKBFiPe+5C3/Earj0G2zySAQz2Y0e23hOHHoHOISaj7vj 95MYiFqcVJe/A0JakI5sPURt7pYxAK2MV77LdPaCcqI4/i7WLITHTNvsFV3Dl7F7Pno/ uCY9AvjuN9lUiC53EJAnsIqzLFamB0ypH1SB1kVJNJo2ZflmCFAHG53NjjC416YaHgxR ZuzCPk2aEbueQ3dcffmsBFEfJquXNR1b3jJ2nBOqFmFTPPogliOg7M1jCE5pIXwux0OR g8Yw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=vOSYcR5bhsrCjJ6PbKl43sOwPlBS+THlM2yD0LGuQ1A=; b=KWJWIWCtGs+QrfFr7/04PpoaQmWpxgqzB/V6TZtFNTlW+z6yqemqI8WdaCqS31xxmU DkzD7r0SNlttuiu5mQHMBlkPRGvrliqKHXgMKTjTgItKBHv8TWkNklIoGFxbkFkdcIy1 J0sNh2hP46XnGc79eOy0OcVqQU/VCJYtnKnDnLyh65Utkm6NS7BR6fjUEzeTsPFSPaFQ F+g0SYsokDhaHZQAvlq1kOSEzp8bo6ilGSpaDN5XCcCWOu3ZWzMLYt4wHjqRl/SwOp91 QxtHncM+x3kuh4LoDMMtlwq2Nsj6MSZyFr84Amm/F1hSZ9bm/h97lv23ivTrcOutAELT z+Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ksDyy6L1; 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 b12si11486203uaf.130.2021.06.20.15.16.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 15:16:08 -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=ksDyy6L1; 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]:37906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv5jb-0002O9-RN for patch@linaro.org; Sun, 20 Jun 2021 18:16:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv5eX-0001Z3-Nk for qemu-devel@nongnu.org; Sun, 20 Jun 2021 18:10:53 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:40667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv5eT-0007qx-SL for qemu-devel@nongnu.org; Sun, 20 Jun 2021 18:10:53 -0400 Received: by mail-pl1-x635.google.com with SMTP id m17so4303711plx.7 for ; Sun, 20 Jun 2021 15:10:49 -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 :mime-version:content-transfer-encoding; bh=vOSYcR5bhsrCjJ6PbKl43sOwPlBS+THlM2yD0LGuQ1A=; b=ksDyy6L1svmn0A53RK+Vj788pHYOCKIAP5A6a+J9eMrtH8wIy+5dDi0RNT1+J2JEbM ncpxXkoObVCw6TbiQsHrBuQvjdMuyETJpHliG8o11WAkzIRFBoH97iLgworclCvqVqBO nA+BdZsKYkEzg7GaWMSN++5uQw8wF4azuMj8OKbRiOFtrd5n5Deg5iMtKEOdNkOUHVJc bsOUX8FOxprCFi0leOT2itgURl1oDrRDSN9MVWJvnhUvMFLhQYjK7wLvg6CdxnodK3vT YEZlFHgGl5uyHA8skf6Ev/Z1+ztuIwPokTqHzYtmbG2BV+yT86Sc11yCqLB7YqaAAXcC 4vtw== 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:mime-version:content-transfer-encoding; bh=vOSYcR5bhsrCjJ6PbKl43sOwPlBS+THlM2yD0LGuQ1A=; b=SSFs28pXAnN110Wn+X1yeG0nRbvIe1VP6GfribFy18RZoB9lyt6YCbjgl3FoC02NQo SyG/yZTonXmAf7Rw8DE1SM/1yu3Ck3UlAEcM9QsqoyYCjSCMKsbE5eF4rqrYbTBIS/h/ RKL/21tQ3LZb+iN5ddtACE+24WqOUVGDc+iMb5bQEebs8Ey2NgJcUdUzAe6ddp1tylJg CuQ8okvQehm+KBBzC0XJDehlh+ZGD9Vl348xwvvl/k6FaFISjhMYzfY8TwvVKXyRVbaI dRSkPvglhhhmXS2AVogbtq+/ipK8+CGgJsHddkLSmZwt4ufIqTdNo4Et7LxyIefZmzPK GuTA== X-Gm-Message-State: AOAM531XlmMDzoeUGXCAwpSiRqk3ALP+VkhiKUrdLmGVocuUIEs55hPZ 26Mkb1nG0ip/e0Bwge7vLVuIjXMbFvdOgw== X-Received: by 2002:a17:90b:4b91:: with SMTP id lr17mr9570714pjb.69.1624227048632; Sun, 20 Jun 2021 15:10:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 135sm11122961pgf.20.2021.06.20.15.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 15:10:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 2/7] target/nios2: Use global cpu_env Date: Sun, 20 Jun 2021 15:10:41 -0700 Message-Id: <20210620221046.1526418-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620221046.1526418-1-richard.henderson@linaro.org> References: <20210620221046.1526418-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do not need to copy this into DisasContext. Signed-off-by: Richard Henderson --- target/nios2/translate.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 388fae93a2..39538e1870 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -97,7 +97,6 @@ } typedef struct DisasContext { - TCGv_ptr cpu_env; TCGv *cpu_R; TCGv_i32 zero; int is_jmp; @@ -147,7 +146,7 @@ static void t_gen_helper_raise_exception(DisasContext *dc, TCGv_i32 tmp = tcg_const_i32(index); tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc); - gen_helper_raise_exception(dc->cpu_env, tmp); + gen_helper_raise_exception(cpu_env, tmp); tcg_temp_free_i32(tmp); dc->is_jmp = DISAS_NORETURN; } @@ -474,7 +473,7 @@ static void rdctl(DisasContext *dc, uint32_t code, uint32_t flags) tcg_gen_mov_tl(dc->cpu_R[instr.c], dc->cpu_R[instr.imm5 + CR_BASE]); #ifdef DEBUG_MMU TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE); - gen_helper_mmu_read_debug(dc->cpu_R[instr.c], dc->cpu_env, tmp); + gen_helper_mmu_read_debug(dc->cpu_R[instr.c], cpu_env, tmp); tcg_temp_free_i32(tmp); #endif } @@ -504,7 +503,7 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags) { #if !defined(CONFIG_USER_ONLY) TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE); - gen_helper_mmu_write(dc->cpu_env, tmp, load_gpr(dc, instr.a)); + gen_helper_mmu_write(cpu_env, tmp, load_gpr(dc, instr.a)); tcg_temp_free_i32(tmp); #endif break; @@ -521,7 +520,7 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags) if (tb_cflags(dc->tb) & CF_USE_ICOUNT) { gen_io_start(); } - gen_helper_check_interrupts(dc->cpu_env); + gen_helper_check_interrupts(cpu_env); dc->is_jmp = DISAS_UPDATE; } #endif @@ -817,7 +816,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) int num_insns; /* Initialize DC */ - dc->cpu_env = cpu_env; dc->cpu_R = cpu_R; dc->is_jmp = DISAS_NEXT; dc->pc = tb->pc;