Patchwork [next,v2,12/74] sun4u: Store SPARCCPU in ResetData

login
register
mail settings
Submitter Andreas Färber
Date May 10, 2012, 12:13 a.m.
Message ID <1336608892-30501-13-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/158121/
State New
Headers show

Comments

Andreas Färber - May 10, 2012, 12:13 a.m.
We can now use cpu_reset() in place of cpu_state_reset() in
main_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/sun4u.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/sun4u.c b/hw/sun4u.c
index df1aada..feede80 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -334,7 +334,7 @@  static void cpu_set_ivec_irq(void *opaque, int irq, int level)
 }
 
 typedef struct ResetData {
-    CPUSPARCState *env;
+    SPARCCPU *cpu;
     uint64_t prom_addr;
 } ResetData;
 
@@ -387,10 +387,10 @@  static void cpu_timer_reset(CPUTimer *timer)
 static void main_cpu_reset(void *opaque)
 {
     ResetData *s = (ResetData *)opaque;
-    CPUSPARCState *env = s->env;
+    CPUSPARCState *env = &s->cpu->env;
     static unsigned int nr_resets;
 
-    cpu_state_reset(env);
+    cpu_reset(CPU(s->cpu));
 
     cpu_timer_reset(env->tick);
     cpu_timer_reset(env->stick);
@@ -774,7 +774,7 @@  static SPARCCPU *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
                                     hstick_frequency, TICK_INT_DIS);
 
     reset_info = g_malloc0(sizeof(ResetData));
-    reset_info->env = env;
+    reset_info->cpu = cpu;
     reset_info->prom_addr = hwdef->prom_addr;
     qemu_register_reset(main_cpu_reset, reset_info);