aboutsummaryrefslogtreecommitdiff
path: root/target/s390x
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-03-22 16:07:18 -0700
committerRichard Henderson <richard.henderson@linaro.org>2019-06-10 07:03:34 -0700
commit29a0af618ddd21f55df5753c3e16b0625f534b3c (patch)
tree18b00b62ec94b2c90d4f0594b1bbc8c992a3b777 /target/s390x
parent2161a612b4e1d388046320bc464adefd6bba01a0 (diff)
cpu: Replace ENV_GET_CPU with env_cpu
Now that we have both ArchCPU and CPUArchState, we can define this generically instead of via macro in each target's cpu.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/s390x')
-rw-r--r--target/s390x/cpu.h2
-rw-r--r--target/s390x/gdbstub.c24
-rw-r--r--target/s390x/mem_helper.c2
3 files changed, 13 insertions, 15 deletions
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index a8c3d702d3..56767f289d 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -168,8 +168,6 @@ static inline S390CPU *s390_env_get_cpu(CPUS390XState *env)
return container_of(env, S390CPU, env);
}
-#define ENV_GET_CPU(e) CPU(s390_env_get_cpu(e))
-
#define ENV_OFFSET offsetof(S390CPU, env)
#ifndef CONFIG_USER_ONLY
diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c
index 9cfd8fe3e0..a45d805a21 100644
--- a/target/s390x/gdbstub.c
+++ b/target/s390x/gdbstub.c
@@ -96,7 +96,7 @@ static int cpu_write_ac_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
switch (n) {
case S390_A0_REGNUM ... S390_A15_REGNUM:
env->aregs[n] = ldl_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 4;
default:
return 0;
@@ -201,9 +201,9 @@ static int cpu_write_c_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
case S390_C0_REGNUM ... S390_C15_REGNUM:
env->cregs[n] = ldtul_p(mem_buf);
if (tcg_enabled()) {
- tlb_flush(ENV_GET_CPU(env));
+ tlb_flush(env_cpu(env));
}
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
default:
return 0;
@@ -251,35 +251,35 @@ static int cpu_write_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
switch (n) {
case S390_VIRT_CKC_REGNUM:
env->ckc = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_CPUTM_REGNUM:
env->cputm = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_BEA_REGNUM:
env->gbea = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_PREFIX_REGNUM:
env->psa = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_PP_REGNUM:
env->pp = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_PFT_REGNUM:
env->pfault_token = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_PFS_REGNUM:
env->pfault_select = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
case S390_VIRT_PFC_REGNUM:
env->pfault_compare = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
default:
return 0;
@@ -303,7 +303,7 @@ static int cpu_read_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
static int cpu_write_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
{
env->gscb[n] = ldtul_p(mem_buf);
- cpu_synchronize_post_init(ENV_GET_CPU(env));
+ cpu_synchronize_post_init(env_cpu(env));
return 8;
}
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index ffd5f02fbe..4a0161602f 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -1461,7 +1461,7 @@ static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1,
#endif
if ((HAVE_CMPXCHG128 ? 0 : fc + 2 > max) ||
(HAVE_ATOMIC128 ? 0 : sc > max)) {
- cpu_loop_exit_atomic(ENV_GET_CPU(env), ra);
+ cpu_loop_exit_atomic(env_cpu(env), ra);
}
}