@@ -1361,7 +1361,6 @@ uint64_t cpu_mips_phys_to_kseg1(void *opaque, uint64_t addr);
/* HW declaration specific to the MIPS target */
void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);
void cpu_mips_irq_init_cpu(MIPSCPU *cpu);
-void cpu_mips_clock_init(MIPSCPU *cpu);
#endif /* !CONFIG_USER_ONLY */
@@ -214,6 +214,7 @@ void cpu_mips_store_count(CPUMIPSState *env, uint32_t value);
void cpu_mips_store_compare(CPUMIPSState *env, uint32_t value);
void cpu_mips_start_count(CPUMIPSState *env);
void cpu_mips_stop_count(CPUMIPSState *env);
+void cpu_mips_clock_init(CPUMIPSState *env);
static inline void mips_env_set_pc(CPUMIPSState *env, target_ulong value)
{
@@ -479,7 +479,7 @@ static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
/* Init internal devices */
#ifndef CONFIG_USER_ONLY
cpu_mips_irq_init_cpu(cpu);
- cpu_mips_clock_init(cpu);
+ cpu_mips_clock_init(env);
#endif
if (!clock_get(cpu->clock)) {
#ifndef CONFIG_USER_ONLY
@@ -133,10 +133,8 @@ static void mips_timer_cb(void *opaque)
cpu_mips_timer_expire(env);
}
-void cpu_mips_clock_init(MIPSCPU *cpu)
+void cpu_mips_clock_init(CPUMIPSState *env)
{
- CPUMIPSState *env = &cpu->env;
-
/*
* If we're in KVM mode, don't create the periodic timer, that is handled in
* kernel.
Simplify cpu_mips_clock_init() by having it directly take a CPU env, move its declaration from "cpu.h" to "internal.h", as it shouldn't be accessible from hw/. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/mips/cpu.h | 1 - target/mips/internal.h | 1 + target/mips/cpu.c | 2 +- target/mips/system/cp0_timer.c | 4 +--- 4 files changed, 3 insertions(+), 5 deletions(-)