From patchwork Sat Mar 23 19:09:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160970 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2186039jan; Sat, 23 Mar 2019 12:31:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhquLS4pwaL6A+vGliF41+yRK6qiaYqmAJMlNjTkkFK/5Aoa7g6nlcK2JhuXiOumA3ykkt X-Received: by 2002:a5b:c01:: with SMTP id f1mr13459667ybq.495.1553369492399; Sat, 23 Mar 2019 12:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553369492; cv=none; d=google.com; s=arc-20160816; b=P9VA1aFn8EnizP3vi4O0VpeSPK3XsKsKiSDjFNFC1W8i1mnH++IVz5aKhj8irIQhoR uNVvERptJDane10ktEuHjKDORw2xaE0Aet0+IMmCEcWM+rEesyrqahzmsx3AgGQYUKxu Uh2S1ObZrRWhQ1ht+Hs8EthCi6R2MT0N4BjGqaj4cPqJ4xwfTCZH3lCj+WcItY1kvP1L uzNybim7aAd7zZKR3A/fNy6qhWxVlPoKhpqKXZTn2jgvjtj/8iSUpadNtsn4HtZx675l ODPX38oWbu+0TcwDiwlZKGqljJ+HRY/FW4HK9Ci/lgpCohYro6f+XJIfaLFvIuzinkdp XtLQ== 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=eawlOmTeSkyqr9eaczu6ySI83LiT4sEPbg+9pe0K3EE=; b=EQzFEFGagJxr6OlGdRnC3RQQ6OwvBsvnsK7ROngy4bz9rVouvO4o3SJ7VL+m3obKoL X42kOpwc6RnA/0hKzFttk1Uys1nT78BqfFo+JuXT4FGCtMw/SU9rC1I/9W7B7Nxmsx+L DfnqcIycMRnrc+DQVv/IcE3NKIHcaW592NZ9e/r3Cjo/ECMjNOjqQ0K2pSkGHYyGoywl 9gn54k7ixIQJEcHLcwmofTA54d2N8MVxJoHnO2/3R0GOFIFULvJOeGp7IEm08E33rUGT gQjFTx4tvmvO3tv0uXH7fDo9hoz/jJsfoErIBvrhwxsvec3nCjFQaCEcv8wFlu8nktM3 E1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v+gJ17PH; 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 d81si6488138ybh.23.2019.03.23.12.31.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Mar 2019 12:31:32 -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=v+gJ17PH; 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]:47049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mMd-0004sT-PV for patch@linaro.org; Sat, 23 Mar 2019 15:31:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7mFw-0007mr-0Q for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:24:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7m2B-0007J3-Qa for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:10:27 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:42138) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7m27-0006wH-T4 for qemu-devel@nongnu.org; Sat, 23 Mar 2019 15:10:22 -0400 Received: by mail-pf1-x443.google.com with SMTP id r15so3671831pfn.9 for ; Sat, 23 Mar 2019 12:09:52 -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=eawlOmTeSkyqr9eaczu6ySI83LiT4sEPbg+9pe0K3EE=; b=v+gJ17PHF8qXcm4Jg1gjFu1z/fKMr9ckaAZs495T7TTdzBtkQ4uqqJMnPAUvl+RjEH 7dxLArWu2XZUKXlyF/2wOOGMueSZxug3Rfi93sk+29sbztuCtCUzVMf9K2lKfRf1AIRN +45GdnK18NgexbPqIm7PgfZUqCBYWx/gx3MaMzGoU8N3Yk1Gw293nb1eH2LqvZbNQLax jjImeZ5nAAcLH97OYQMRxaQnCXK0hyxipvfeuc/+80ku8j00WQgLzXLwJ/MnkRZSrGt/ 1mcqDE/RH5agH7+nrQKJi+bbeNmRkAdDedkGNgTARNTydRiKbewGogrGdGp8725EdB1H /gDg== 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=eawlOmTeSkyqr9eaczu6ySI83LiT4sEPbg+9pe0K3EE=; b=mwrUPG5VnTt0xM5Vb9FMcuvfndImncLUSNl/X6LXVCcw0aEYAkf5ck+JzV+oNUQicV 0/UtcPWAwSYgAk2vTADvNJoZt8EwKHUPvfsJICCtbBLytZBiDkxzlnDyN88mi3s0vBc4 H8XnIwc8SdK4/iasyKmqLp/8HbiEy3bIiH12Yhd4QZdSMI4BV7/1+pZJT3NL8EDjqBOx TX84lDMDgfgkKYxfJcp9hUMhb6V5uoJ7su4gHz5TdaLeDZXd0wHfXmIdIB99K1LKge7X TtNbLC8+KLkdiH4GgEwtsVedNV+1x47ZymUVk6oo+VIPz+baHcdbUKmguKlb27peE66R Y7sw== X-Gm-Message-State: APjAAAXc1jLPq3+c7gV6HVFOsdDjYtTaoCtbEne6ppEHXYwkRmX5klW5 XkHVJVNVpfUPSQQ7zighuHtyKvlhQP0= X-Received: by 2002:a17:902:4301:: with SMTP id i1mr16626229pld.307.1553368191779; Sat, 23 Mar 2019 12:09:51 -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.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 12:09:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Mar 2019 12:09:09 -0700 Message-Id: <20190323190925.21324-20-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::443 Subject: [Qemu-devel] [PATCH 19/35] target/openrisc: 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" Signed-off-by: Richard Henderson --- target/openrisc/cpu.h | 5 ----- linux-user/openrisc/cpu_loop.c | 2 +- target/openrisc/exception_helper.c | 5 ++--- target/openrisc/sys_helper.c | 8 ++++---- 4 files changed, 7 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 3eda7957cf..853cf633e7 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -317,11 +317,6 @@ typedef struct OpenRISCCPU { } OpenRISCCPU; -static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env) -{ - return container_of(env, OpenRISCCPU, env); -} - #define ENV_OFFSET offsetof(OpenRISCCPU, env) void cpu_openrisc_list(FILE *f, fprintf_function cpu_fprintf); diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index f496e4b48a..4b8165b261 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -23,7 +23,7 @@ void cpu_loop(CPUOpenRISCState *env) { - CPUState *cs = CPU(openrisc_env_get_cpu(env)); + CPUState *cs = env_cpu(env); int trapnr; abi_long ret; target_siginfo_t info; diff --git a/target/openrisc/exception_helper.c b/target/openrisc/exception_helper.c index 6073a5b21c..dd639ba5f2 100644 --- a/target/openrisc/exception_helper.c +++ b/target/openrisc/exception_helper.c @@ -25,15 +25,14 @@ void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp) { - OpenRISCCPU *cpu = openrisc_env_get_cpu(env); + OpenRISCCPU *cpu = env_archcpu(env); raise_exception(cpu, excp); } static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc) { - OpenRISCCPU *cpu = openrisc_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); cs->exception_index = EXCP_RANGE; cpu_loop_exit_restore(cs, pc); diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 05f66c455b..8f11cb8202 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -30,8 +30,8 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu = openrisc_env_get_cpu(env); - CPUState *cs = CPU(cpu); + OpenRISCCPU *cpu = env_archcpu(env); + CPUState *cs = env_cpu(env); target_ulong mr; int idx; @@ -194,8 +194,8 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd, target_ulong spr) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu = openrisc_env_get_cpu(env); - CPUState *cs = CPU(cpu); + OpenRISCCPU *cpu = env_archcpu(env); + CPUState *cs = env_cpu(env); int idx; switch (spr) {