mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
cpu: Move halted and interrupt_request fields to CPUState
Both fields are used in VMState, thus need to be moved together. Explicitly zero them on reset since they were located before breakpoints. Pass PowerPCCPU to kvmppc_handle_halt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
21317bc222
commit
259186a7d2
70 changed files with 319 additions and 224 deletions
|
@ -256,10 +256,11 @@ void cpu_check_irqs(CPUSPARCState *env)
|
|||
static void cpu_kick_irq(SPARCCPU *cpu)
|
||||
{
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUState *cs = CPU(cpu);
|
||||
|
||||
env->halted = 0;
|
||||
cs->halted = 0;
|
||||
cpu_check_irqs(env);
|
||||
qemu_cpu_kick(CPU(cpu));
|
||||
qemu_cpu_kick(cs);
|
||||
}
|
||||
|
||||
static void cpu_set_irq(void *opaque, int irq, int level)
|
||||
|
@ -285,19 +286,19 @@ static void dummy_cpu_set_irq(void *opaque, int irq, int level)
|
|||
static void main_cpu_reset(void *opaque)
|
||||
{
|
||||
SPARCCPU *cpu = opaque;
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUState *cs = CPU(cpu);
|
||||
|
||||
cpu_reset(CPU(cpu));
|
||||
env->halted = 0;
|
||||
cpu_reset(cs);
|
||||
cs->halted = 0;
|
||||
}
|
||||
|
||||
static void secondary_cpu_reset(void *opaque)
|
||||
{
|
||||
SPARCCPU *cpu = opaque;
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
CPUState *cs = CPU(cpu);
|
||||
|
||||
cpu_reset(CPU(cpu));
|
||||
env->halted = 1;
|
||||
cpu_reset(cs);
|
||||
cs->halted = 1;
|
||||
}
|
||||
|
||||
static void cpu_halt_signal(void *opaque, int irq, int level)
|
||||
|
@ -826,6 +827,7 @@ static const TypeInfo ram_info = {
|
|||
static void cpu_devinit(const char *cpu_model, unsigned int id,
|
||||
uint64_t prom_addr, qemu_irq **cpu_irqs)
|
||||
{
|
||||
CPUState *cs;
|
||||
SPARCCPU *cpu;
|
||||
CPUSPARCState *env;
|
||||
|
||||
|
@ -841,7 +843,8 @@ static void cpu_devinit(const char *cpu_model, unsigned int id,
|
|||
qemu_register_reset(main_cpu_reset, cpu);
|
||||
} else {
|
||||
qemu_register_reset(secondary_cpu_reset, cpu);
|
||||
env->halted = 1;
|
||||
cs = CPU(cpu);
|
||||
cs->halted = 1;
|
||||
}
|
||||
*cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS);
|
||||
env->prom_addr = prom_addr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue