diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-15 00:59:50 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-30 11:32:12 +0200 |
commit | 11c1986817fa8ec515b87291445786734f78e4e0 (patch) | |
tree | 0e5647f1bde80b920cc2e647ba4473c8a6337bfe /target-m68k/cpu.c | |
parent | b9e7a234343501e2498680fd7bc0cd2aad947560 (diff) | |
download | qemu-11c1986817fa8ec515b87291445786734f78e4e0.zip qemu-11c1986817fa8ec515b87291445786734f78e4e0.tar.gz qemu-11c1986817fa8ec515b87291445786734f78e4e0.tar.bz2 |
target-m68k: QOM'ify CPU reset
Move code from cpu_state_reset() into QOM m68k_cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
Diffstat (limited to 'target-m68k/cpu.c')
-rw-r--r-- | target-m68k/cpu.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c index 457c5c1..e599ece 100644 --- a/target-m68k/cpu.c +++ b/target-m68k/cpu.c @@ -29,9 +29,23 @@ static void m68k_cpu_reset(CPUState *s) M68kCPUClass *mcc = M68K_CPU_GET_CLASS(cpu); CPUM68KState *env = &cpu->env; + if (qemu_loglevel_mask(CPU_LOG_RESET)) { + qemu_log("CPU Reset (CPU %d)\n", env->cpu_index); + log_cpu_state(env, 0); + } + mcc->parent_reset(s); - cpu_state_reset(env); + memset(env, 0, offsetof(CPUM68KState, breakpoints)); +#if !defined(CONFIG_USER_ONLY) + env->sr = 0x2700; +#endif + m68k_switch_sp(env); + /* ??? FP regs should be initialized to NaN. */ + env->cc_op = CC_OP_FLAGS; + /* TODO: We should set PC from the interrupt vector. */ + env->pc = 0; + tlb_flush(env, 1); } static void m68k_cpu_class_init(ObjectClass *c, void *data) |