@@ -183,11 +183,6 @@ struct CRISCPU {
CPUCRISState env;
};
-static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
-{
- return container_of(env, CRISCPU, env);
-}
-
#define ENV_OFFSET offsetof(CRISCPU, env)
#ifndef CONFIG_USER_ONLY
@@ -23,7 +23,7 @@
void cpu_loop(CPUCRISState *env)
{
- CPUState *cs = CPU(cris_env_get_cpu(env));
+ CPUState *cs = env_cpu(env);
int trapnr, ret;
target_siginfo_t info;
@@ -290,7 +290,6 @@ static int cris_mmu_translate_page(struct cris_mmu_result *res,
void cris_mmu_flush_pid(CPUCRISState *env, uint32_t pid)
{
- CRISCPU *cpu = cris_env_get_cpu(env);
target_ulong vaddr;
unsigned int idx;
uint32_t lo, hi;
@@ -316,7 +315,7 @@ void cris_mmu_flush_pid(CPUCRISState *env, uint32_t pid)
vaddr = tlb_vpn << TARGET_PAGE_BITS;
D_LOG("flush pid=%x vaddr=%x\n",
pid, vaddr);
- tlb_flush_page(CPU(cpu), vaddr);
+ tlb_flush_page(env_cpu(env), vaddr);
}
}
}
@@ -67,7 +67,7 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size,
void helper_raise_exception(CPUCRISState *env, uint32_t index)
{
- CPUState *cs = CPU(cris_env_get_cpu(env));
+ CPUState *cs = env_cpu(env);
cs->exception_index = index;
cpu_loop_exit(cs);
@@ -85,8 +85,7 @@ void helper_tlb_flush_pid(CPUCRISState *env, uint32_t pid)
void helper_spc_write(CPUCRISState *env, uint32_t new_spc)
{
#if !defined(CONFIG_USER_ONLY)
- CRISCPU *cpu = cris_env_get_cpu(env);
- CPUState *cs = CPU(cpu);
+ CPUState *cs = env_cpu(env);
tlb_flush_page(cs, env->pregs[PR_SPC]);
tlb_flush_page(cs, new_spc);
@@ -99,9 +98,6 @@ void helper_spc_write(CPUCRISState *env, uint32_t new_spc)
void helper_movl_sreg_reg(CPUCRISState *env, uint32_t sreg, uint32_t reg)
{
-#if !defined(CONFIG_USER_ONLY)
- CRISCPU *cpu = cris_env_get_cpu(env);
-#endif
uint32_t srs;
srs = env->pregs[PR_SRS];
srs &= 3;
@@ -143,7 +139,7 @@ void helper_movl_sreg_reg(CPUCRISState *env, uint32_t sreg, uint32_t reg)
D_LOG("tlb flush vaddr=%x v=%d pc=%x\n",
vaddr, tlb_v, env->pc);
if (tlb_v) {
- tlb_flush_page(CPU(cpu), vaddr);
+ tlb_flush_page(env_cpu(env), vaddr);
}
}
}
@@ -3104,7 +3104,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
* delayslot, like in real hw.
*/
pc_start = tb->pc & ~1;
- dc->cpu = cris_env_get_cpu(env);
+ dc->cpu = env_archcpu(env);
dc->tb = tb;
dc->is_jmp = DISAS_NEXT;
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/cris/cpu.h | 5 ----- linux-user/cris/cpu_loop.c | 2 +- target/cris/mmu.c | 3 +-- target/cris/op_helper.c | 10 +++------- target/cris/translate.c | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) -- 2.17.1