Commit 3d29fbef063ab1e8bfb9bc759ca94ab0becca9fa
1 parent
69d35728
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
Showing
2 changed files
with
16 additions
and
3 deletions
hw/slavio_timer.c
... | ... | @@ -263,7 +263,7 @@ static void slavio_timer_reset(void *opaque) |
263 | 263 | s->reached = 0; |
264 | 264 | s->mode &= 2; |
265 | 265 | s->stopped = 1; |
266 | - slavio_timer_get_out(s); | |
266 | + slavio_timer_irq(s); | |
267 | 267 | } |
268 | 268 | |
269 | 269 | void slavio_timer_init(uint32_t addr, int irq, int mode, unsigned int cpu, | ... | ... |
hw/sun4m.c
... | ... | @@ -243,7 +243,17 @@ void qemu_system_powerdown(void) |
243 | 243 | static void main_cpu_reset(void *opaque) |
244 | 244 | { |
245 | 245 | CPUState *env = opaque; |
246 | + | |
246 | 247 | cpu_reset(env); |
248 | + env->halted = 0; | |
249 | +} | |
250 | + | |
251 | +static void secondary_cpu_reset(void *opaque) | |
252 | +{ | |
253 | + CPUState *env = opaque; | |
254 | + | |
255 | + cpu_reset(env); | |
256 | + env->halted = 1; | |
247 | 257 | } |
248 | 258 | |
249 | 259 | 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, |
266 | 276 | env = cpu_init(); |
267 | 277 | cpu_sparc_register(env, def); |
268 | 278 | envs[i] = env; |
269 | - if (i != 0) | |
279 | + if (i == 0) { | |
280 | + qemu_register_reset(main_cpu_reset, env); | |
281 | + } else { | |
282 | + qemu_register_reset(secondary_cpu_reset, env); | |
270 | 283 | env->halted = 1; |
284 | + } | |
271 | 285 | register_savevm("cpu", i, 3, cpu_save, cpu_load, env); |
272 | - qemu_register_reset(main_cpu_reset, env); | |
273 | 286 | } |
274 | 287 | /* allocate RAM */ |
275 | 288 | cpu_register_physical_memory(0, ram_size, 0); | ... | ... |