summaryrefslogtreecommitdiff
path: root/hw/sun4m.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-17 19:21:46 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-17 19:21:46 +0000
commit3d29fbef063ab1e8bfb9bc759ca94ab0becca9fa (patch)
treecc943bf9f87d4058ce221467149f1ff751ce9bcb /hw/sun4m.c
parent69d357286d0ab5a852e827dad1dc4b05917aaaa8 (diff)
downloadqemu-3d29fbef063ab1e8bfb9bc759ca94ab0becca9fa.tar.gz
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
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r--hw/sun4m.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 89f4b418d2..fc410bdd7f 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -243,7 +243,17 @@ void qemu_system_powerdown(void)
static void main_cpu_reset(void *opaque)
{
CPUState *env = opaque;
+
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,
@@ -266,10 +276,13 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int ram_size,
env = cpu_init();
cpu_sparc_register(env, def);
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;
+ }
register_savevm("cpu", i, 3, cpu_save, cpu_load, env);
- qemu_register_reset(main_cpu_reset, env);
}
/* allocate RAM */
cpu_register_physical_memory(0, ram_size, 0);