mips: use MIPSCPU instead of CPUMIPSState

This changes a cpu.h dependency into a cpu-qom.h dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2016-03-15 14:32:19 +01:00
parent 0774831d08
commit 5a975d435a
9 changed files with 24 additions and 18 deletions

View File

@ -81,11 +81,12 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
error_setg(errp, "%s: CPU initialization failed\n", __func__);
return;
}
env = &cpu->env;
/* Init internal devices */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
env = &cpu->env;
if (cpu_mips_itu_supported(env)) {
itu_present = true;
/* Attach ITC Tag to the VP */

View File

@ -151,8 +151,10 @@ static void mips_timer_cb (void *opaque)
env->CP0_Count--;
}
void cpu_mips_clock_init (CPUMIPSState *env)
void cpu_mips_clock_init (MIPSCPU *cpu)
{
CPUMIPSState *env = &cpu->env;
/*
* If we're in KVM mode, don't create the periodic timer, that is handled in
* kernel.

View File

@ -334,8 +334,8 @@ static void mips_fulong2e_init(MachineState *machine)
}
/* Init internal devices */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
/* North bridge, Bonito --> IP2 */
pci_bus = bonito_init((qemu_irq *)&(env->irq[2]));

View File

@ -58,8 +58,9 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
}
}
void cpu_mips_irq_init_cpu(CPUMIPSState *env)
void cpu_mips_irq_init_cpu(MIPSCPU *cpu)
{
CPUMIPSState *env = &cpu->env;
qemu_irq *qi;
int i;

View File

@ -201,8 +201,8 @@ static void mips_jazz_init(MachineState *machine,
}
/* Init CPU internal devices */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
/* Chipset */
rc4030 = rc4030_init(&dmas, &rc4030_dma_mr);

View File

@ -923,11 +923,10 @@ static void create_cpu_without_cps(const char *cpu_model,
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
env = &cpu->env;
/* Init internal devices */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
qemu_register_reset(main_cpu_reset, cpu);
}

View File

@ -216,8 +216,8 @@ mips_mipssim_init(MachineState *machine)
}
/* Init CPU internal devices. */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
/* Register 64 KB of ISA IO space at 0x1fd00000. */
memory_region_init_alias(isa, NULL, "isa_mmio",

View File

@ -267,8 +267,8 @@ void mips_r4k_init(MachineState *machine)
}
/* Init CPU internal devices */
cpu_mips_irq_init_cpu(env);
cpu_mips_clock_init(env);
cpu_mips_irq_init_cpu(cpu);
cpu_mips_clock_init(cpu);
/* ISA bus: IO space at 0x14000000, mem space at 0x10000000 */
memory_region_init_alias(isa_io, NULL, "isa-io",

View File

@ -1,5 +1,8 @@
#ifndef HW_MIPS_CPUDEVS_H
#define HW_MIPS_CPUDEVS_H
#include "target-mips/cpu-qom.h"
/* Definitions for MIPS CPU internal devices. */
/* mips_addr.c */
@ -9,9 +12,9 @@ uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr);
/* mips_int.c */
void cpu_mips_irq_init_cpu(CPUMIPSState *env);
void cpu_mips_irq_init_cpu(MIPSCPU *cpu);
/* mips_timer.c */
void cpu_mips_clock_init(CPUMIPSState *);
void cpu_mips_clock_init(MIPSCPU *cpu);
#endif