mirror of https://github.com/xqemu/xqemu.git
Force the primary CPU to run and other CPUs to halt, recalculate timers
after system_reset. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2822 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
69d357286d
commit
3d29fbef06
|
@ -263,7 +263,7 @@ static void slavio_timer_reset(void *opaque)
|
||||||
s->reached = 0;
|
s->reached = 0;
|
||||||
s->mode &= 2;
|
s->mode &= 2;
|
||||||
s->stopped = 1;
|
s->stopped = 1;
|
||||||
slavio_timer_get_out(s);
|
slavio_timer_irq(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void slavio_timer_init(uint32_t addr, int irq, int mode, unsigned int cpu,
|
void slavio_timer_init(uint32_t addr, int irq, int mode, unsigned int cpu,
|
||||||
|
|
17
hw/sun4m.c
17
hw/sun4m.c
|
@ -243,7 +243,17 @@ void qemu_system_powerdown(void)
|
||||||
static void main_cpu_reset(void *opaque)
|
static void main_cpu_reset(void *opaque)
|
||||||
{
|
{
|
||||||
CPUState *env = opaque;
|
CPUState *env = opaque;
|
||||||
|
|
||||||
cpu_reset(env);
|
cpu_reset(env);
|
||||||
|
env->halted = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void secondary_cpu_reset(void *opaque)
|
||||||
|
{
|
||||||
|
CPUState *env = opaque;
|
||||||
|
|
||||||
|
cpu_reset(env);
|
||||||
|
env->halted = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sun4m_hw_init(const struct hwdef *hwdef, int ram_size,
|
static void sun4m_hw_init(const struct hwdef *hwdef, int ram_size,
|
||||||
|
@ -266,10 +276,13 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int ram_size,
|
||||||
env = cpu_init();
|
env = cpu_init();
|
||||||
cpu_sparc_register(env, def);
|
cpu_sparc_register(env, def);
|
||||||
envs[i] = env;
|
envs[i] = env;
|
||||||
if (i != 0)
|
if (i == 0) {
|
||||||
|
qemu_register_reset(main_cpu_reset, env);
|
||||||
|
} else {
|
||||||
|
qemu_register_reset(secondary_cpu_reset, env);
|
||||||
env->halted = 1;
|
env->halted = 1;
|
||||||
|
}
|
||||||
register_savevm("cpu", i, 3, cpu_save, cpu_load, env);
|
register_savevm("cpu", i, 3, cpu_save, cpu_load, env);
|
||||||
qemu_register_reset(main_cpu_reset, env);
|
|
||||||
}
|
}
|
||||||
/* allocate RAM */
|
/* allocate RAM */
|
||||||
cpu_register_physical_memory(0, ram_size, 0);
|
cpu_register_physical_memory(0, ram_size, 0);
|
||||||
|
|
Loading…
Reference in New Issue