Patchwork [next,v2,14/74] leon3: Store SPARCCPU in ResetData

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

Comments

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

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

Patch

diff --git a/hw/leon3.c b/hw/leon3.c
index 8ffef83..878d3aa 100644
--- a/hw/leon3.c
+++ b/hw/leon3.c
@@ -42,16 +42,16 @@ 
 #define MAX_PILS 16
 
 typedef struct ResetData {
-    CPUSPARCState *env;
+    SPARCCPU *cpu;
     uint32_t  entry;            /* save kernel entry in case of reset */
 } ResetData;
 
 static void main_cpu_reset(void *opaque)
 {
     ResetData *s   = (ResetData *)opaque;
-    CPUSPARCState  *env = s->env;
+    CPUSPARCState  *env = &s->cpu->env;
 
-    cpu_state_reset(env);
+    cpu_reset(CPU(s->cpu));
 
     env->halted = 0;
     env->pc     = s->entry;
@@ -129,7 +129,7 @@  static void leon3_generic_hw_init(ram_addr_t  ram_size,
 
     /* Reset data */
     reset_info        = g_malloc0(sizeof(ResetData));
-    reset_info->env   = env;
+    reset_info->cpu   = cpu;
     qemu_register_reset(main_cpu_reset, reset_info);
 
     /* Allocate IRQ manager */