From patchwork Wed May 8 00:06:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 10933979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57529924 for ; Wed, 8 May 2019 00:23:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4978928715 for ; Wed, 8 May 2019 00:23:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E56528751; Wed, 8 May 2019 00:23:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D4CFB28715 for ; Wed, 8 May 2019 00:23:56 +0000 (UTC) Received: from localhost ([127.0.0.1]:56616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOANI-0005dk-4x for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 May 2019 20:23:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOA79-0007cI-Nv for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOA78-00073e-JN for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:15 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:42963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOA78-0006w7-Dk for qemu-devel@nongnu.org; Tue, 07 May 2019 20:07:14 -0400 Received: by mail-pl1-x641.google.com with SMTP id x15so8963339pln.9 for ; Tue, 07 May 2019 17:07:13 -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=52zjib8k8hXnxTjLlPWtXLTTNAt1VVEt0hF/cXL6Z2g=; b=SQKkAutqOQLk3uYO3BqvHfuX7z6OPaFdPqq0Oa5GOaNtjOC4Z7lylblQV9NXPSfR8E MVuO6FI4WK8Qw99YvbxFtOt/7FE5uBkivuk+ST197IHxu10R2MnODaZILZPNr/Zk8FQE 5PhJLUq/lBW+xEYUd0SuNlRtFMq+k3vjSngAWlk6yPcGy47Q6pMz0uvWTVD5m0tUuSbb XCTXNYdv9HrqZ2cnL/l9DHYp7dotL9LFmN98Y7IIAUoqZD7vdm08+5Wy7UoQayESDmCv inpuoe3UkjAIP6BKqvbsSjWHYgQ/M76MHFJKKE4iB1sMLECT7diggAVi2wbXMs8F5u2Y Kp3Q== 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=52zjib8k8hXnxTjLlPWtXLTTNAt1VVEt0hF/cXL6Z2g=; b=DCL/wA0DCC4AXOjnWVn+hp3AZfZYZ5DxMxfQM6bnI7E33Mfvz1NQmQbtmRdWuWdPUy i4nyemoWvMpEIKv0Ns1NafadcPrqOWEvVMSCffiHSEOnMW629N54sbNUR9nDL8+XFJhG mwIik1MiXfwi7afR4+s+dMcaV8jYqN3a0xlQ4bno5DOGrnrCQRde3Sw2TB9X/YZtzZnP GIvSbn94vUCJqvwmeSZYdEWWVZE++MsdgM46oJAPIgpGLjABb/D/94dEThQyLjRJvQEb FpypbXZ+ch1VPgl9e7WlyLlxCobV+7zpEtyPJntR1U2GGpHwHqpn1X4fGW1QMk7qSO6C xdCg== X-Gm-Message-State: APjAAAVvAfxtaz6cXQHlSXhk6weldDWnlhZzH4stvTPACQPOg1v0RoGS y39ODvpT3Vv4gGkra266u1Q6mNjQyZg= X-Google-Smtp-Source: APXvYqy2d3tjR7jZI0loJCFNHQrUooeO3bJ0A52xVLakuGWpSJCYtK4D7K0cER1uALnGUdIPytZyAA== X-Received: by 2002:a17:902:820c:: with SMTP id x12mr42185155pln.199.1557274031172; Tue, 07 May 2019 17:07:11 -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.07.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 17:07:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 17:06:23 -0700 Message-Id: <20190508000641.19090-22-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::641 Subject: [Qemu-devel] [PATCH v3 21/39] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis --- 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(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 0ba4ae3356..91ba667139 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(void); 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) {