mirror of https://github.com/proxmox/mirror_qemu
target/moxie: Use env_cpu, env_archcpu
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>master
parent
5a7330b35c
commit
f8600ba221
|
@ -90,11 +90,6 @@ typedef struct MoxieCPU {
|
||||||
CPUMoxieState env;
|
CPUMoxieState env;
|
||||||
} MoxieCPU;
|
} MoxieCPU;
|
||||||
|
|
||||||
static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)
|
|
||||||
{
|
|
||||||
return container_of(env, MoxieCPU, env);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ENV_OFFSET offsetof(MoxieCPU, env)
|
#define ENV_OFFSET offsetof(MoxieCPU, env)
|
||||||
|
|
||||||
void moxie_cpu_do_interrupt(CPUState *cs);
|
void moxie_cpu_do_interrupt(CPUState *cs);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
void helper_raise_exception(CPUMoxieState *env, int ex)
|
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;
|
cs->exception_index = ex;
|
||||||
/* Stash the exception type. */
|
/* 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)
|
void helper_debug(CPUMoxieState *env)
|
||||||
{
|
{
|
||||||
CPUState *cs = CPU(moxie_env_get_cpu(env));
|
CPUState *cs = env_cpu(env);
|
||||||
|
|
||||||
cs->exception_index = EXCP_DEBUG;
|
cs->exception_index = EXCP_DEBUG;
|
||||||
cpu_loop_exit(cs);
|
cpu_loop_exit(cs);
|
||||||
|
|
|
@ -816,7 +816,7 @@ static int decode_opc(MoxieCPU *cpu, DisasContext *ctx)
|
||||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
|
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
|
||||||
{
|
{
|
||||||
CPUMoxieState *env = cs->env_ptr;
|
CPUMoxieState *env = cs->env_ptr;
|
||||||
MoxieCPU *cpu = moxie_env_get_cpu(env);
|
MoxieCPU *cpu = env_archcpu(env);
|
||||||
DisasContext ctx;
|
DisasContext ctx;
|
||||||
target_ulong pc_start;
|
target_ulong pc_start;
|
||||||
int num_insns;
|
int num_insns;
|
||||||
|
|
Loading…
Reference in New Issue