From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v4 19/39] target/moxie: Use env_cpu, env_archcpu
Date: Tue, 4 Jun 2019 15:33:31 -0500 [thread overview]
Message-ID: <20190604203351.27778-20-richard.henderson@linaro.org> (raw)
In-Reply-To: <20190604203351.27778-1-richard.henderson@linaro.org>
Cleanup in the boilerplate that each target must define.
Replace moxie_env_get_cpu with env_archcpu. The combination
CPU(moxie_env_get_cpu) should have used ENV_GET_CPU to begin;
use env_cpu now.
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/moxie/cpu.h | 5 -----
target/moxie/helper.c | 4 ++--
target/moxie/translate.c | 2 +-
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h
index 275fb9bfbb..b9f5635e50 100644
--- a/target/moxie/cpu.h
+++ b/target/moxie/cpu.h
@@ -90,11 +90,6 @@ typedef struct MoxieCPU {
CPUMoxieState env;
} MoxieCPU;
-static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)
-{
- return container_of(env, MoxieCPU, env);
-}
-
#define ENV_OFFSET offsetof(MoxieCPU, env)
void moxie_cpu_do_interrupt(CPUState *cs);
diff --git a/target/moxie/helper.c b/target/moxie/helper.c
index f5c1d4181c..b1919f62b3 100644
--- a/target/moxie/helper.c
+++ b/target/moxie/helper.c
@@ -28,7 +28,7 @@
void helper_raise_exception(CPUMoxieState *env, int ex)
{
- CPUState *cs = CPU(moxie_env_get_cpu(env));
+ CPUState *cs = env_cpu(env);
cs->exception_index = ex;
/* Stash the exception type. */
@@ -65,7 +65,7 @@ uint32_t helper_udiv(CPUMoxieState *env, uint32_t a, uint32_t b)
void helper_debug(CPUMoxieState *env)
{
- CPUState *cs = CPU(moxie_env_get_cpu(env));
+ CPUState *cs = env_cpu(env);
cs->exception_index = EXCP_DEBUG;
cpu_loop_exit(cs);
diff --git a/target/moxie/translate.c b/target/moxie/translate.c
index c668178f2c..c87e9ec2b1 100644
--- a/target/moxie/translate.c
+++ b/target/moxie/translate.c
@@ -816,7 +816,7 @@ static int decode_opc(MoxieCPU *cpu, DisasContext *ctx)
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
{
CPUMoxieState *env = cs->env_ptr;
- MoxieCPU *cpu = moxie_env_get_cpu(env);
+ MoxieCPU *cpu = env_archcpu(env);
DisasContext ctx;
target_ulong pc_start;
int num_insns;
--
2.17.1
next prev parent reply other threads:[~2019-06-04 20:50 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 20:33 [Qemu-devel] [PATCH v4 00/39] tcg: Move the softmmu tlb to CPUNegativeOffsetState Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 01/39] tcg: Fold CPUTLBWindow into CPUTLBDesc Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 02/39] tcg: Split out target/arch/cpu-param.h Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 03/39] tcg: Create struct CPUTLB Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 04/39] cpu: Define CPUArchState with typedef Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 05/39] cpu: Define ArchCPU Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 06/39] cpu: Replace ENV_GET_CPU with env_cpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 07/39] cpu: Introduce env_archcpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 08/39] target/alpha: Use env_cpu, env_archcpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 09/39] target/arm: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 10/39] target/cris: Reindent mmu.c Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 11/39] target/cris: Reindent op_helper.c Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 12/39] target/cris: Use env_cpu, env_archcpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 13/39] target/hppa: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 14/39] target/i386: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 15/39] target/lm32: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 16/39] target/m68k: " Richard Henderson
2019-06-05 11:15 ` Laurent Vivier
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 17/39] target/microblaze: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 18/39] target/mips: " Richard Henderson
2019-06-04 20:33 ` Richard Henderson [this message]
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 20/39] target/nios2: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 21/39] target/openrisc: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 22/39] target/ppc: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 23/39] target/riscv: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 24/39] target/s390x: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 25/39] target/sh4: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 26/39] target/sparc: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 27/39] target/tilegx: Use env_cpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 28/39] target/tricore: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 29/39] target/unicore32: Use env_cpu, env_archcpu Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 30/39] target/xtensa: " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 31/39] cpu: Move ENV_OFFSET to exec/gen-icount.h Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 32/39] cpu: Introduce cpu_set_cpustate_pointers Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 33/39] cpu: Introduce CPUNegativeOffsetState Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 34/39] cpu: Move icount_decr to CPUNegativeOffsetState Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 35/39] cpu: Move the softmmu tlb " Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 36/39] cpu: Remove CPU_COMMON Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 37/39] tcg/aarch64: Use LDP to load tlb mask+table Richard Henderson
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 38/39] tcg/arm: Use LDRD " Richard Henderson
2019-06-07 10:24 ` Peter Maydell
2019-06-04 20:33 ` [Qemu-devel] [PATCH v4 39/39] tcg/arm: Remove mostly unreachable tlb special case Richard Henderson
2019-06-04 22:28 ` [Qemu-devel] [PATCH v4 00/39] tcg: Move the softmmu tlb to CPUNegativeOffsetState no-reply
2019-06-04 22:48 ` no-reply
2019-06-04 22:54 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190604203351.27778-20-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).