From nobody Tue Feb 10 23:59:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553816677670830.4234525082974; Thu, 28 Mar 2019 16:44:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:43521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9ehD-0006GR-GF for importer@patchew.org; Thu, 28 Mar 2019 19:44:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9eKp-0001dn-JL for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:21:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9e4h-00037Y-W1 for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:04:45 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:33302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h9e4h-00036R-LG for qemu-devel@nongnu.org; Thu, 28 Mar 2019 19:04:43 -0400 Received: by mail-pf1-x441.google.com with SMTP id i19so93864pfd.0 for ; Thu, 28 Mar 2019 16:04:40 -0700 (PDT) Received: from cloudburst.ASUS (cpe-66-75-72-255.hawaii.res.rr.com. [66.75.72.255]) by smtp.gmail.com with ESMTPSA id f1sm280911pgl.35.2019.03.28.16.04.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 16:04:38 -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=qs9zN17WkfabAcIa/bdvOutNVAcn1jEKjKO8TOPto2DBrA0iVj6rgXPg25Nr7sBnwi DTrQuyfGbJVBAFstaD5KxEUdZhSJ7qVbhpZzy2UziowW5C3gCMgK9K+twI2iQxldEQ5E GB4VQrZyVyYJD3akAdPkfHZ2TXtdF2NsQJoRkVXBACm17gIxcV5Q/gqFL26d5JEzpSV/ FkSB5f6+dff3iMu9adPg2G/TySmOD5aZ/Nmu5tlhc/Fn22rSh3Bzzram4nYMYSrESRjZ 6GfouwiuqHugzoI78ftUGDGgZV5dH9wbybrmGEK4/XluwlLVkq3NQvV05TdVLlEKEfyJ w3Aw== 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=ndPoOEmX0MwbSQl7Y90hHQieyo3C/Rri/bpC6IC0igBbucmbtDKwwhlvsgTQ58zj11 Ce67+IjKGTaxvlshK/JT50l9qCRg/oCHDSwGQg9K2QQRDg33SgxCvlxpHjJFG19K1mU2 9Xyr59QDe/rfn+oO+WV2VAXNzBQO8Fokz5wP7dGZDCqNwKCzwwtcbzsmafq6xjZageZC F0/isHJH6CPHwAeGR+yksE+dcpQW0tcNPkxqfInXzmkYcqohK7FpD2sjf+9q7NutX/qH Nfg+SqVfl5ndBgxm7KKaO3tqa5XEwIounjxRTjZfRkQ5NBq33JNTQyFpmpNXwZ8nANTh 6mkA== X-Gm-Message-State: APjAAAU0YgRtrc9wTOoHlBk5uqkGSqTUpxK4HGeTcZP5N8d9Y32knPi9 Rphm3cwtD2nEA36oon/geb8z9TMNIJo= X-Google-Smtp-Source: APXvYqzmGWcY+6zZQtZBhscExdREPI9ULyVZDp2aXQPm5XKDg+Q2TWTkC2/posdtuP2140dMAH5X9A== X-Received: by 2002:a63:ef09:: with SMTP id u9mr19356722pgh.126.1553814279206; Thu, 28 Mar 2019 16:04:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2019 13:03:47 -1000 Message-Id: <20190328230404.12909-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190328230404.12909-1-richard.henderson@linaro.org> References: <20190328230404.12909-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::441 Subject: [Qemu-devel] [PATCH for-4.1 v2 19/36] 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 3eda7957cf..853cf633e7 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -317,11 +317,6 @@ typedef struct OpenRISCCPU { =20 } OpenRISCCPU; =20 -static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env) -{ - return container_of(env, OpenRISCCPU, env); -} - #define ENV_OFFSET offsetof(OpenRISCCPU, env) =20 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 @@ =20 void cpu_loop(CPUOpenRISCState *env) { - CPUState *cs =3D CPU(openrisc_env_get_cpu(env)); + CPUState *cs =3D 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 @@ =20 void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp) { - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); + OpenRISCCPU *cpu =3D env_archcpu(env); =20 raise_exception(cpu, excp); } =20 static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc) { - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D 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 r= b) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + OpenRISCCPU *cpu =3D env_archcpu(env); + CPUState *cs =3D env_cpu(env); target_ulong mr; int idx; =20 @@ -194,8 +194,8 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, targe= t_ulong rd, target_ulong spr) { #ifndef CONFIG_USER_ONLY - OpenRISCCPU *cpu =3D openrisc_env_get_cpu(env); - CPUState *cs =3D CPU(cpu); + OpenRISCCPU *cpu =3D env_archcpu(env); + CPUState *cs =3D env_cpu(env); int idx; =20 switch (spr) { --=20 2.17.1