diff options
author | Richard Henderson | 2019-03-23 03:46:31 +0100 |
---|---|---|
committer | Richard Henderson | 2019-06-10 16:03:42 +0200 |
commit | 31266e68d2921d2a2f73176349e94e28842fadd8 (patch) | |
tree | 2c51849ef73cee2969dd79f9d6ea675d7bef38b5 /target/unicore32/softmmu.c | |
parent | target/tricore: Use env_cpu (diff) | |
download | qemu-31266e68d2921d2a2f73176349e94e28842fadd8.tar.gz qemu-31266e68d2921d2a2f73176349e94e28842fadd8.tar.xz qemu-31266e68d2921d2a2f73176349e94e28842fadd8.zip |
target/unicore32: Use env_cpu, env_archcpu
Cleanup in the boilerplate that each target must define.
Replace uc32_env_get_cpu with env_archcpu. The combination
CPU(uc32_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>
Diffstat (limited to 'target/unicore32/softmmu.c')
-rw-r--r-- | target/unicore32/softmmu.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/target/unicore32/softmmu.c b/target/unicore32/softmmu.c index 27f218abf0..cbdaa500b7 100644 --- a/target/unicore32/softmmu.c +++ b/target/unicore32/softmmu.c @@ -36,8 +36,6 @@ /* Map CPU modes onto saved register banks. */ static inline int bank_number(CPUUniCore32State *env, int mode) { - UniCore32CPU *cpu = uc32_env_get_cpu(env); - switch (mode) { case ASR_MODE_USER: case ASR_MODE_SUSR: @@ -51,7 +49,7 @@ static inline int bank_number(CPUUniCore32State *env, int mode) case ASR_MODE_INTR: return 4; } - cpu_abort(CPU(cpu), "Bad mode %x\n", mode); + cpu_abort(env_cpu(env), "Bad mode %x\n", mode); return -1; } @@ -126,8 +124,7 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, int access_type, int is_user, uint32_t *phys_ptr, int *prot, target_ulong *page_size) { - UniCore32CPU *cpu = uc32_env_get_cpu(env); - CPUState *cs = CPU(cpu); + CPUState *cs = env_cpu(env); int code; uint32_t table; uint32_t desc; @@ -174,11 +171,11 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, *page_size = TARGET_PAGE_SIZE; break; default: - cpu_abort(CPU(cpu), "wrong page type!"); + cpu_abort(cs, "wrong page type!"); } break; default: - cpu_abort(CPU(cpu), "wrong page type!"); + cpu_abort(cs, "wrong page type!"); } *phys_ptr = phys_addr; |