@@ -317,11 +317,6 @@ typedef struct OpenRISCCPU {
} OpenRISCCPU;
-static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env)
-{
- return container_of(env, OpenRISCCPU, env);
-}
-
#define ENV_OFFSET offsetof(OpenRISCCPU, env)
void cpu_openrisc_list(FILE *f, fprintf_function cpu_fprintf);
@@ -23,7 +23,7 @@
void cpu_loop(CPUOpenRISCState *env)
{
- CPUState *cs = CPU(openrisc_env_get_cpu(env));
+ CPUState *cs = env_cpu(env);
int trapnr;
abi_long ret;
target_siginfo_t info;
@@ -25,15 +25,14 @@
void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
{
- OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
+ OpenRISCCPU *cpu = env_archcpu(env);
raise_exception(cpu, excp);
}
static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc)
{
- OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
- CPUState *cs = CPU(cpu);
+ CPUState *cs = env_cpu(env);
cs->exception_index = EXCP_RANGE;
cpu_loop_exit_restore(cs, pc);
@@ -30,8 +30,8 @@
void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
{
#ifndef CONFIG_USER_ONLY
- OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
- CPUState *cs = CPU(cpu);
+ OpenRISCCPU *cpu = env_archcpu(env);
+ CPUState *cs = env_cpu(env);
target_ulong mr;
int idx;
@@ -194,8 +194,8 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
target_ulong spr)
{
#ifndef CONFIG_USER_ONLY
- OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
- CPUState *cs = CPU(cpu);
+ OpenRISCCPU *cpu = env_archcpu(env);
+ CPUState *cs = env_cpu(env);
int idx;
switch (spr) {
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/openrisc/cpu.h | 5 ----- linux-user/openrisc/cpu_loop.c | 2 +- target/openrisc/exception_helper.c | 5 ++--- target/openrisc/sys_helper.c | 8 ++++---- 4 files changed, 7 insertions(+), 13 deletions(-) -- 2.17.1