From patchwork Sun May 2 14:43:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 430444 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2117911jao; Sun, 2 May 2021 07:59:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3PNt0hJiLfYsF2NzHdSBy2tGaWNO/DIXoU5qAvh5L86AA0uqx+3gRGkmCx2iEpswXtnZM X-Received: by 2002:a5e:8a08:: with SMTP id d8mr6058503iok.192.1619967583839; Sun, 02 May 2021 07:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619967583; cv=none; d=google.com; s=arc-20160816; b=0xU1V1ccIVQaEsVNIFG3TkH1gAgX472TfkTS0mZZ5BmDMLuX30fvLYVsLZ6xRxqRIN P2rEGW0XsuuF6rfJ0qPWIVju2ZQUw5Iuiqx1qZS7syPsmQ80C/UBvdu6B8tGnEqJVwHd t5PApMab5SlXxK+vrJVC6XIdYOIFnouwQG0ZkDdnfUwyArXwU1tZKD1gatR9MmxWe2Fk E5j2Xu8qY2pNE3BbF8iYMziuHoDtdBOYONyLXSDAgSUNnIprQGZ5Xh/P/sVDsLvQl58o J86alEx1BBqbv0EZbTvKdGiXqbwwlwZMJcMFSMinaVbQQrA6NrxUCAmm2F48CulkkWMv dAag== 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=pbV3d5UOp4zIucQ+jGGDM6Fy1q3YuNEMSA2V6e1mngs=; b=CJezSEBmyXSOgpmLQgCHWRmdimLEo+bN9wEyv7t9DD6GN041+tplkY1NtNmzm7Dx8g Q8Ox++Gf2Galf7MH4M/HcQ4OeTeeXxZo8WVIuKX0Ns+9gH7JzFi+FRQ5ZjKcfFnyTByK XjfM8ne/54VmSrqz2B/dGYOBXqkiYT/P1zi9QVo+foLCZT+fx6xXMdijGIPHlQs85yMJ VroUrIKqwZhhyv4aQtlYYrctFrKozjGb6Pw4H9aRYfMkQ3BmLG4ZSOUWcmuYHkq4JfFz NNWTnT/W9k1GSM/FtdpKaVRq8eK9UbmTukw91YoJn9OTnKc7hpN6miqvQ7XAndheZCV5 23MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K6UEHiKP; 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=pass (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 s4si11599558jat.26.2021.05.02.07.59.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 May 2021 07:59:43 -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=pass header.i=@linaro.org header.s=google header.b=K6UEHiKP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldDZP-0008BN-AO for patch@linaro.org; Sun, 02 May 2021 10:59:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldDKi-0001MU-EN for qemu-devel@nongnu.org; Sun, 02 May 2021 10:44:32 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:37407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldDKf-0005C7-9S for qemu-devel@nongnu.org; Sun, 02 May 2021 10:44:32 -0400 Received: by mail-pl1-x630.google.com with SMTP id h20so1463888plr.4 for ; Sun, 02 May 2021 07:44:27 -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=pbV3d5UOp4zIucQ+jGGDM6Fy1q3YuNEMSA2V6e1mngs=; b=K6UEHiKPttOa69GtDHZjvKrFO2c6MFK1N2XzQlg/X1nl3F6L5Ejfnh/r4mctmHvZyT QTjAeZhZ/Cgr6/8EWg5KsJNCAG+Fjkq0F13yR9tTJw3IPfrMuXb/i0b7ls/Y7El3Qksm OB4cUaITaWHb05thyvxzZxRm4+hBpeY1mQ554PIw9u9Dyd4FmeYzd9PIZO8tiJL7HNzQ FMLXpsY4n+ceuYEwmos/emPJMpZca8ZFiNZ+WZQ6Cf2CYLnlyutvT93XCHmDz/kAnbci rQuGqfcG+nEYWyJEkhCGv45g4vtVwO5T1o5kL/gDaGGr0LwlXIC/HEQcv0JOUYdhK5ZE ACKQ== 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=pbV3d5UOp4zIucQ+jGGDM6Fy1q3YuNEMSA2V6e1mngs=; b=f0zZcmfZCQtJ9h9PfuPC8VgJGSECieS5UchzXnvyOqKv5Vt3v5PPmfQAiqoOMglyUU hIC0hUL2XDgz14UjNLlVhOSRGwdgRNUhor7rvWWYgk3yOcjHecqJ6Gva3Fi1vNx5wh+p 0Q8B5qFTVbXmuiLajmuPqYMtL11ENiKSVBzKTKjri21Y/KR4kor94ZATA5yA6m08AIPU hnOs/vQW8ARLYQxIvD01/g+Hrb2HmRyFZM1iz6+MuYSaMEdPW8ZznNbmpIaa55+z0Zty meZz+3u0FOqkOz05f+KM6cm+xOq+LC1sqN0Dcxo5TDXdUW5Z/6mjrSjQT6iIBvtYy736 dogQ== X-Gm-Message-State: AOAM530biyY6ZhLKmCkoaZ8L3YT4Sig8tUswh6dDLV5P8IwlPeYscmPH vB4Ba0Cjrlp86ehpxuPgsh+d6vGrHmgD5A== X-Received: by 2002:a17:902:9a0a:b029:e6:bf00:8a36 with SMTP id v10-20020a1709029a0ab02900e6bf008a36mr15616210plp.51.1619966666504; Sun, 02 May 2021 07:44:26 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id w14sm6889110pff.94.2021.05.02.07.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 May 2021 07:44:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 09/31] Hexagon (target/hexagon) use env_archcpu and env_cpu Date: Sun, 2 May 2021 07:43:57 -0700 Message-Id: <20210502144419.1659844-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210502144419.1659844-1-richard.henderson@linaro.org> References: <20210502144419.1659844-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: peter.maydell@linaro.org, Taylor Simpson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Taylor Simpson Remove hexagon_env_get_cpu and replace with env_archcpu Replace CPU(hexagon_env_get_cpu(env)) with env_cpu(env) Suggested-by: Richard Henderson Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <1617930474-31979-5-git-send-email-tsimpson@quicinc.com> Signed-off-by: Richard Henderson --- target/hexagon/cpu.h | 5 ----- linux-user/hexagon/cpu_loop.c | 2 +- target/hexagon/cpu.c | 4 ++-- target/hexagon/op_helper.c | 2 +- target/hexagon/translate.c | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index e04eac591c..2855dd3881 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -127,11 +127,6 @@ typedef struct HexagonCPU { target_ulong lldb_stack_adjust; } HexagonCPU; -static inline HexagonCPU *hexagon_env_get_cpu(CPUHexagonState *env) -{ - return container_of(env, HexagonCPU, env); -} - #include "cpu_bits.h" #define cpu_signal_handler cpu_hexagon_signal_handler diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c index 9a68ca05c3..bc34f5d7c3 100644 --- a/linux-user/hexagon/cpu_loop.c +++ b/linux-user/hexagon/cpu_loop.c @@ -25,7 +25,7 @@ void cpu_loop(CPUHexagonState *env) { - CPUState *cs = CPU(hexagon_env_get_cpu(env)); + CPUState *cs = env_cpu(env); int trapnr, signum, sigcode; target_ulong sigaddr; target_ulong syscallnum; diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index c2fe357702..f044506d0f 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -71,7 +71,7 @@ const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS] = { */ static target_ulong adjust_stack_ptrs(CPUHexagonState *env, target_ulong addr) { - HexagonCPU *cpu = hexagon_env_get_cpu(env); + HexagonCPU *cpu = env_archcpu(env); target_ulong stack_adjust = cpu->lldb_stack_adjust; target_ulong stack_start = env->stack_start; target_ulong stack_size = 0x10000; @@ -115,7 +115,7 @@ static void print_reg(FILE *f, CPUHexagonState *env, int regnum) static void hexagon_dump(CPUHexagonState *env, FILE *f) { - HexagonCPU *cpu = hexagon_env_get_cpu(env); + HexagonCPU *cpu = env_archcpu(env); if (cpu->lldb_compat) { /* diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 5d35dfc8f3..7ac85549db 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -35,7 +35,7 @@ static void QEMU_NORETURN do_raise_exception_err(CPUHexagonState *env, uint32_t exception, uintptr_t pc) { - CPUState *cs = CPU(hexagon_env_get_cpu(env)); + CPUState *cs = env_cpu(env); qemu_log_mask(CPU_LOG_INT, "%s: %d\n", __func__, exception); cs->exception_index = exception; cpu_loop_exit_restore(cs, pc); diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index f975d7a5a1..e235fdb315 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -585,7 +585,7 @@ static void hexagon_tr_translate_packet(DisasContextBase *dcbase, CPUState *cpu) * The CPU log is used to compare against LLDB single stepping, * so end the TLB after every packet. */ - HexagonCPU *hex_cpu = hexagon_env_get_cpu(env); + HexagonCPU *hex_cpu = env_archcpu(env); if (hex_cpu->lldb_compat && qemu_loglevel_mask(CPU_LOG_TB_CPU)) { ctx->base.is_jmp = DISAS_TOO_MANY; }