From 1cf5ccbca8915277098727d900d52c495a711f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 9 Mar 2014 20:02:29 +0100 Subject: [PATCH] target-xtensa: Clean up ENV_GET_CPU() usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commits a00817cc4c18b7872e92765a4736fb2227cc237b and fdfba1a298ae26dd44bcfdb0429314139a0bc55a added usages of ENV_GET_CPU() macro in target-specific code. Use xtensa_env_get_cpu() instead. Cc: Max Filippov Cc: Edgar E. Iglesias Cc: Peter Maydell Signed-off-by: Andreas Färber --- target-xtensa/cpu.h | 4 +++- target-xtensa/helper.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h index 1cf5ea3aff..3c7fa805fd 100644 --- a/target-xtensa/cpu.h +++ b/target-xtensa/cpu.h @@ -493,6 +493,8 @@ static inline int cpu_mmu_index(CPUXtensaState *env) static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc, target_ulong *cs_base, int *flags) { + CPUState *cs = CPU(xtensa_env_get_cpu(env)); + *pc = env->pc; *cs_base = 0; *flags = 0; @@ -515,7 +517,7 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc, if (xtensa_option_enabled(env->config, XTENSA_OPTION_COPROCESSOR)) { *flags |= env->sregs[CPENABLE] << XTENSA_TBFLAG_CPENABLE_SHIFT; } - if (ENV_GET_CPU(env)->singlestep_enabled && env->exception_taken) { + if (cs->singlestep_enabled && env->exception_taken) { *flags |= XTENSA_TBFLAG_EXCEPTION; } } diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c index 60cb055a93..3cb0bbd972 100644 --- a/target-xtensa/helper.c +++ b/target-xtensa/helper.c @@ -552,7 +552,7 @@ static int get_physical_addr_mmu(CPUXtensaState *env, bool update_tlb, static int get_pte(CPUXtensaState *env, uint32_t vaddr, uint32_t *pte) { - CPUState *cs = ENV_GET_CPU(env); + CPUState *cs = CPU(xtensa_env_get_cpu(env)); uint32_t paddr; uint32_t page_size; unsigned access; -- GitLab