From 89aaf60dedbe0e6415acfe816e02b538e5c54e68 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sat, 10 Mar 2012 17:55:05 +0000 Subject: sparc: reset CPU state on reset Not strictly accurate for Sparc64 but avoid confusing Valgrind. Reported-by: Michael S. Tsirkin Signed-off-by: Blue Swirl --- target-sparc/cpu.h | 5 +++-- target-sparc/cpu_init.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 86f9de6cf..887adc363 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -415,14 +415,15 @@ struct CPUSPARCState { #if !defined(TARGET_SPARC64) int psref; /* enable fpu */ #endif - target_ulong version; int interrupt_index; - uint32_t nwindows; /* NOTE: we allow 8 more registers to handle wrapping */ target_ulong regbase[MAX_NWINDOWS * 16 + 8]; CPU_COMMON + target_ulong version; + uint32_t nwindows; + /* MMU regs */ #if defined(TARGET_SPARC64) uint64_t lsu; diff --git a/target-sparc/cpu_init.c b/target-sparc/cpu_init.c index 29132fb99..5c03f0b89 100644 --- a/target-sparc/cpu_init.c +++ b/target-sparc/cpu_init.c @@ -30,6 +30,7 @@ void cpu_state_reset(CPUSPARCState *env) log_cpu_state(env, 0); } + memset(env, 0, offsetof(CPUSPARCState, breakpoints)); tlb_flush(env, 1); env->cwp = 0; #ifndef TARGET_SPARC64 -- cgit v1.2.3