Commit 1cc8e6f067f9048556af1d1863271db55b15efc1
1 parent
e57448f1
We must reset the PowerPC CPU _after_ registering it, as hardware reset
effect is implementation dependant. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3323 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
5 additions
and
3 deletions
hw/ppc405_uc.c
... | ... | @@ -51,20 +51,22 @@ CPUState *ppc405_init (const unsigned char *cpu_model, |
51 | 51 | |
52 | 52 | /* init CPUs */ |
53 | 53 | env = cpu_init(); |
54 | - qemu_register_reset(&cpu_ppc_reset, env); | |
55 | - register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); | |
56 | 54 | ppc_find_by_name(cpu_model, &def); |
57 | 55 | if (def == NULL) { |
58 | 56 | cpu_abort(env, "Unable to find PowerPC %s CPU definition\n", |
59 | 57 | cpu_model); |
60 | 58 | } |
61 | 59 | cpu_ppc_register(env, def); |
60 | + cpu_ppc_reset(env); | |
62 | 61 | cpu_clk->cb = NULL; /* We don't care about CPU clock frequency changes */ |
63 | 62 | cpu_clk->opaque = env; |
64 | 63 | /* Set time-base frequency to sysclk */ |
65 | 64 | tb_clk->cb = ppc_emb_timers_init(env, sysclk); |
66 | 65 | tb_clk->opaque = env; |
67 | 66 | ppc_dcr_init(env, NULL, NULL); |
67 | + /* Register Qemu callbacks */ | |
68 | + qemu_register_reset(&cpu_ppc_reset, env); | |
69 | + register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); | |
68 | 70 | |
69 | 71 | return env; |
70 | 72 | } | ... | ... |
linux-user/main.c
... | ... | @@ -2100,7 +2100,7 @@ int main(int argc, char **argv) |
2100 | 2100 | "Unable to find PowerPC CPU definition\n"); |
2101 | 2101 | } |
2102 | 2102 | cpu_ppc_register(env, def); |
2103 | - | |
2103 | + cpu_ppc_reset(env); | |
2104 | 2104 | for (i = 0; i < 32; i++) { |
2105 | 2105 | if (i != 12 && i != 6 && i != 13) |
2106 | 2106 | env->msr[i] = (regs->msr >> i) & 1; | ... | ... |