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: 163582 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp2000131ilm; Tue, 7 May 2019 17:25:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXq2f7I+TYa55yJwkb+dJr1xVqYZ3hAdIrRee7jbZMKg90BMeUoq/xIjvo1qN63KeZ/ruE X-Received: by 2002:a1c:14:: with SMTP id 20mr807756wma.66.1557275126892; Tue, 07 May 2019 17:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557275126; cv=none; d=google.com; s=arc-20160816; b=0oU/fOiEEafCaULGZpKufq1Jr3nm42Xt3U4mX3pydVFaNFbUp+VHgWT3l3eADMLqdy aYIdm/2HWX3W7ZMpj/OUevO28b8pRJyzYRhGINWbekn0p8UT3DDakaq7gEw+5seoXigE PVJx0u8OyR8WmCWtts7kF0oWQ0yvIGG3AXArfRR1gx0rWv7GIKrOF0CBH0nj4UXx3WNV h1BU0Sc8FGJ/ekgTZwnu/EPgt/yG19MKAh1YoXZ2ykyk9HBRAzhs4GOY4ViIgDM95qJX lgCCSH+8OU2bnDXP6M6pG/y/BCvK53rnUGKTWFQZOPgF00MskteAASk1SfXbaVGn3CCv 34DA== 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=52zjib8k8hXnxTjLlPWtXLTTNAt1VVEt0hF/cXL6Z2g=; b=DpYAShmrfM9JKP312AGLUdKtNFxNN33vrg60K+J6rTG2b6C35PPXrVa+Xm17RFKgbR 2IjVQTaoo/gkxvbyb6Jg9Vdi7BdzdgJ9q+J0KUEpCCrHfFwl+7P42J3YIKubDCDUqDxE G2nbPh3Env7YpZIJqxmpLwIWCSL/DpgGDK9UzeIcYdkokPEGTxNB9OS/4WTsLZbxrwHD myLVY/SCP/jAC7PejuwrwkWoy0rmtr4/Aa/uaIVb2t4UlQhBDRlxHkBNaCEmTBcaycR9 MZSMzhcA8mA6CZ17MvH/abzEeC+5t/Uk9JPlIVMfMH+q56NeT4KMfSeXx6E43KAt3nSn mBYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SQKkAutq; 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 l10si10421969wrp.239.2019.05.07.17.25.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 May 2019 17:25:26 -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=SQKkAutq; 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]:56656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOAOj-0006vq-P6 for patch@linaro.org; Tue, 07 May 2019 20:25:25 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell 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 Reviewed-by: Alistair Francis 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) {