From patchwork Sat Mar 23 19:08:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160982 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2193494jan; Sat, 23 Mar 2019 12:41:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIzkQLkGnt2JPVWlZcKrJhRhD+Sxiq9VE7+4QtU6qgomYJoorerm7fvHll5En94kdSjgal X-Received: by 2002:a25:24c6:: with SMTP id k189mr13927493ybk.79.1553370062443; Sat, 23 Mar 2019 12:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553370062; cv=none; d=google.com; s=arc-20160816; b=oOPtpAu/2CNvLSPwE+PoqChPkp/2fY3kYAPRfIoU9sP5GcvJRB16eoLTdl4E4juiVs hdfD42DLuBXRTtf2fEAn0qGtSK7KO07cvioLHkqIOTGj2GvuEvavC96/0qGGhwOxMJXX zaMh2wATcM4WCmY3zrUMWUiBF63YI6ep0vsYbzQLxWSXzaT5jPRRqTkkx3R8HPoyiGNa z4h1+xEw8CQXcpe3Sj5boYmGkWI06km0s1+zzk75r9nl4GARLGwTbwh8LoOR1vcxKTlW n32aSnyqGcp+UhEExjX/Om84M+AqkiD28nQDaoDXwzxeo3WiGShOwBsZxl7a9Rb3hK/Z kMSg== 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=Css6NKgFH171QC6SSk07lpmy2ZqpsnjuUU/ll24a9MA=; b=UKiLMGU2q0E4PXN/C0QtEmwMq+CkOUbJ49QUJMgcN7U0oAF6yjYsYL9MnqDQDB671M YVDVufJYyArBIjgOsJnxk7exlpnyKztKAQvskc1SZwnqBf6OLfiHGXW9pxEf9VY/6oYT vaTslZmxHM7BU8f85sRtljuBIVf3NZFkS3MEfIszXC4bG+c+vLi7SQVCgz058SCJRJdS 5UBYnOERSaWfGZrJPWQ+7dE+SHEtrKidSKKtWnROuHHk14YqlW4mAaiGbgyTSc6mJG4u JCbs4IMtJ+F0xffilllitbm8+kO9D8pdQTK1pHeyuHWj9bwclkv9507B80FAn9QrcNnV OgAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="a5/edUtj"; 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 l21si286896ywc.166.2019.03.23.12.41.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Mar 2019 12:41:02 -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="a5/edUtj"; 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]:47185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mVp-0005Kr-U6 for patch@linaro.org; Sat, 23 Mar 2019 15:41:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mG9-0007mr-KJ for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7m1V-0006pu-Ud for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:09:43 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:36724) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7m1V-0006oe-9D for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:09:41 -0400 Received: by mail-pf1-x442.google.com with SMTP id p10so3692660pff.3 for ; Sat, 23 Mar 2019 12:09:40 -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=Css6NKgFH171QC6SSk07lpmy2ZqpsnjuUU/ll24a9MA=; b=a5/edUtjg/m+Ty6MaUiJiTWAxLQaFgR9wuvCZbUAkSKGwWYlH076EzUDGktF/1vILj WiO6YF7l2CH0Rs9LK+V9Ru9s5vRUQWHJfqt2j6vUL+7j+N8KJxf3aq/TanvBtzSO43aR uFNNXX4I0st0m1wBT+48kwpSJRoKNvU50+jZsQEP4wBbhqRCV5gZsGB7na1Y8T5uCZfR MD5P8mMINaNmrxe9GtPQOMeKUHkTEcv1tKenoOt/2yuKRctCz1W4kmkOyNbz3ZJvj/Eu rD2P16GGjQ3ipwUuemoxJnIaUfa3/04g7GMFNI3MpXYi9Ugi2G1aAKe+yDokDdxgXw33 OjrA== 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=Css6NKgFH171QC6SSk07lpmy2ZqpsnjuUU/ll24a9MA=; b=oXWb+xkLuxlIga8eVPdMadiCAulALWR+kKA5G4qD/tLreLaIMIInnoj4+gXdqHNbSt CPyAfICCBgCCltUkmxC2maCDuZ8DNWz930Hia42XoPbvQuf+cdHjWO7Uf+sekCWbY0Hn gBjZDa/gb8ePWbm+aRzaU5Fj35YqYqdEaoBdED2b8kpP7hEgcRw4jN0AzAomzVKTkJiK YhCHDFNL8253FRvqiqvavz7FheotI1V1/xAu9ChCHv9bytk6CJ8+SOdEWk/2P9dXQbQn X9S9r9Ry7JbxRekZkRng7YmRIilHr4saHhfpSI88S/mkHF9KMTacWC9h5fhIJKbc2oU8 YINA== X-Gm-Message-State: APjAAAWuEWzuWRPRgrEPwnBRpd7zggosc5cNgzD5fYGimuj/2d+ROH9z 5kxhRpO0qgn0Z4h78FFoGdgI/Um/Gr8= X-Received: by 2002:a65:5a81:: with SMTP id c1mr13600755pgt.391.1553368179379; Sat, 23 Mar 2019 12:09:39 -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.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 12:09:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Mar 2019 12:08:58 -0700 Message-Id: <20190323190925.21324-9-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::442 Subject: [Qemu-devel] [PATCH 08/35] 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Richard Henderson --- 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(-) -- 2.17.1 diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 788edd5cb3..e22518871a 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -273,11 +273,6 @@ struct AlphaCPU { QEMUTimer *alarm_timer; }; -static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env) -{ - return container_of(env, AlphaCPU, env); -} - #define ENV_OFFSET offsetof(AlphaCPU, env) #ifndef CONFIG_USER_ONLY diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 824b6d6658..2acdefde03 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -23,7 +23,7 @@ void cpu_loop(CPUAlphaState *env) { - CPUState *cs = CPU(alpha_env_get_cpu(env)); + CPUState *cs = 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 57e2c212b3..4769d44fd9 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -118,7 +118,7 @@ static int get_physical_address(CPUAlphaState *env, target_ulong addr, int prot_need, int mmu_idx, target_ulong *pphys, int *pprot) { - CPUState *cs = CPU(alpha_env_get_cpu(env)); + CPUState *cs = env_cpu(env); target_long saddr = addr; target_ulong phys = 0; target_ulong L1pte, L2pte, L3pte; @@ -463,8 +463,7 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, We expect that ENV->PC has already been updated. */ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error) { - AlphaCPU *cpu = alpha_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); cs->exception_index = excp; env->error_code = 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 = alpha_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); cs->exception_index = excp; env->error_code = 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)); } 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); } void helper_tb_flush(CPUAlphaState *env) { - tb_flush(CPU(alpha_env_get_cpu(env))); + tb_flush(env_cpu(env)); } void helper_halt(uint64_t restart) @@ -78,7 +78,7 @@ uint64_t helper_get_walltime(void) void helper_set_alarm(CPUAlphaState *env, uint64_t expire) { - AlphaCPU *cpu = alpha_env_get_cpu(env); + AlphaCPU *cpu = env_archcpu(env); if (expire) { env->alarm_expire = expire;