From nobody Tue Feb 10 07:22:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1557274151; cv=none; d=zoho.com; s=zohoarc; b=SIQ5zj+uW+Q+d2CLJCuZZpdOivBlabwBJXyGyj5UX8YvyNrY0QrL0Hh0KnOt7HAQgGRjaTDx/SKRJu3Gku+NN+QqxbtvqzPF1sWl40y2sKWVPaGtXIqWDBj3gLI8rS1MUjOsHSW8OtbNRY+UJzdJeGOKxr3PmcnRwN1to/266JQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557274151; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OiKWP6/OoPfPIuCP7uADTa7Y66Y39q2egElf8tswYBg=; b=WKi7OcC4ZDPVTgDuWgLGtWribLMd2MNiGfwBCq/5dmJorz2pTpxQ8wUgbvNw3YUwTMLvpbUrcAIdQDFAQXR2KdB3CU+D1Ce2xACgnz9XGboNFxZcqPZxXc4hjZLWAbSnvAt318AoxYgVpIEuQFfIfbtyJPL7OH6wPzEQtoo15X4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557274151206222.94497338356246; Tue, 7 May 2019 17:09:11 -0700 (PDT) Received: from localhost ([127.0.0.1]:56393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA8r-0000Gh-Ak for importer@patchew.org; Tue, 07 May 2019 20:09:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA6r-0007DZ-Oe for qemu-devel@nongnu.org; Tue, 07 May 2019 20:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOA6p-00068O-M8 for qemu-devel@nongnu.org; Tue, 07 May 2019 20:06:56 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:42964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOA6p-00066C-F2 for qemu-devel@nongnu.org; Tue, 07 May 2019 20:06:55 -0400 Received: by mail-pl1-x644.google.com with SMTP id x15so8963093pln.9 for ; Tue, 07 May 2019 17:06:55 -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.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 17:06:53 -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=OiKWP6/OoPfPIuCP7uADTa7Y66Y39q2egElf8tswYBg=; b=xJ0fgsIVnk1IeUNgVRf7oddqihPNVP+vsm1JK7UJlabD4IS3jEH2NDUA9/hkrNjaF2 jSdL3rJOO4k0gFnSkhTwrmq/rVmExMVDF4JCk81DKYZklv/TJD88sPhKlDknrUM2nxut dL1VjO3lxvJT6cVhYT5dFJMOqpGQX8ZEY9IGCG1okN6pxb4MAt3lfDmpieB868h+VSZf sFW6QzIIYWgJNbxtkvRFEQ/ir/Y0/Iq6OWzrG6N+cpy0PgmQnSDR3tc8eRD8ztm7X7UK Hv56NDYL8W5WuYGwYDX84ZRB/slw8vNqdSvsxU020FS0a6ew53KOO9gCs/cVM/psOsfe WbWg== 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=OiKWP6/OoPfPIuCP7uADTa7Y66Y39q2egElf8tswYBg=; b=OiAO5U79mQmmJn5mRtliua26WRsKdR5vDsZeTW5C8wtkNrXTOd2WTrtQf3R74DLP2L Umex/+gK9f/z6vKsLteDQaMDpek3K/XJ85p8sTKGcG+vBMIHnkz11CsCVfT1EzCqjKtq 0g5c+hVIoTJpFW0i6qgLV83+Tsy+HqzKeqbo5z5tOfyhRwkcsUFOk74Bgez2E/4BjXza 3OLYfBWaBDFXWMlaJxq77RFLq0nklfnzRuVPGMSbDb2HP4v1UhqOkuyvb/6O7xWL+6L6 PsgE+yu+L/L+sXW4kJcxiAkkarBZjQiDAsvALXBoyKhMvav+vIwp9gD5LIVQmDIMCci+ 49ng== X-Gm-Message-State: APjAAAXj9clnPQ+jl9OiFed4aLZWPnkNlfw9crMnL/8atNyg8UrB8MIu 7Je0NAiqhJreqojdFVl2aW+BkDHp9+s= X-Google-Smtp-Source: APXvYqynqn4pPiGUSGdiCqum8Pbk7GmFcmoBFtROTyUtzwwEO5XmbAZVYHq+6tCDP6PcMw0UMzYG3g== X-Received: by 2002:a17:902:5acb:: with SMTP id g11mr7381466plm.198.1557274014064; Tue, 07 May 2019 17:06:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 17:06:10 -0700 Message-Id: <20190508000641.19090-9-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::644 Subject: [Qemu-devel] [PATCH v3 08/39] target/alpha: 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With exactly one exception, most uses of alpha_env_get_cpu were failures to use the more proper, ENV_GET_CPU macro, now replaced by env_cpu. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis --- target/alpha/cpu.h | 5 ----- linux-user/alpha/cpu_loop.c | 2 +- target/alpha/helper.c | 8 +++----- target/alpha/sys_helper.c | 8 ++++---- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 2c7f75f584..53c085f691 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -273,11 +273,6 @@ struct AlphaCPU { QEMUTimer *alarm_timer; }; =20 -static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env) -{ - return container_of(env, AlphaCPU, env); -} - #define ENV_OFFSET offsetof(AlphaCPU, env) =20 #ifndef CONFIG_USER_ONLY diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 61992571e1..7a94eee84c 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -23,7 +23,7 @@ =20 void cpu_loop(CPUAlphaState *env) { - CPUState *cs =3D CPU(alpha_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); int trapnr; target_siginfo_t info; abi_long sysret; diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 7201576aae..08dfb834a5 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -119,7 +119,7 @@ static int get_physical_address(CPUAlphaState *env, tar= get_ulong addr, int prot_need, int mmu_idx, target_ulong *pphys, int *pprot) { - CPUState *cs =3D CPU(alpha_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); target_long saddr =3D addr; target_ulong phys =3D 0; target_ulong L1pte, L2pte, L3pte; @@ -463,8 +463,7 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int fl= ags) We expect that ENV->PC has already been updated. */ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error) { - AlphaCPU *cpu =3D alpha_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D excp; env->error_code =3D error; @@ -475,8 +474,7 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int = excp, int error) void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr, int excp, int error) { - AlphaCPU *cpu =3D alpha_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D excp; env->error_code =3D error; diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c index ac22323191..f9c34b1144 100644 --- a/target/alpha/sys_helper.c +++ b/target/alpha/sys_helper.c @@ -44,17 +44,17 @@ uint64_t helper_load_pcc(CPUAlphaState *env) #ifndef CONFIG_USER_ONLY void helper_tbia(CPUAlphaState *env) { - tlb_flush(CPU(alpha_env_get_cpu(env))); + tlb_flush(env_cpu(env)); } =20 void helper_tbis(CPUAlphaState *env, uint64_t p) { - tlb_flush_page(CPU(alpha_env_get_cpu(env)), p); + tlb_flush_page(env_cpu(env), p); } =20 void helper_tb_flush(CPUAlphaState *env) { - tb_flush(CPU(alpha_env_get_cpu(env))); + tb_flush(env_cpu(env)); } =20 void helper_halt(uint64_t restart) @@ -78,7 +78,7 @@ uint64_t helper_get_walltime(void) =20 void helper_set_alarm(CPUAlphaState *env, uint64_t expire) { - AlphaCPU *cpu =3D alpha_env_get_cpu(env); + AlphaCPU *cpu =3D env_archcpu(env); =20 if (expire) { env->alarm_expire =3D expire; --=20 2.17.1