Patchwork [qom-next,25/59] sun4m: Pass SPARCCPU to cpu_set_irq()

login
register
mail settings
Submitter Andreas Färber
Date May 23, 2012, 3:07 a.m.
Message ID <1337742502-28565-26-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/160861/
State New
Headers show

Comments

Andreas Färber - May 23, 2012, 3:07 a.m.
Needed for cpu_kick_irq().

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

Patch

diff --git a/hw/sun4m.c b/hw/sun4m.c
index a959261..e9b9d9b 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -262,7 +262,8 @@  static void cpu_kick_irq(CPUSPARCState *env)
 
 static void cpu_set_irq(void *opaque, int irq, int level)
 {
-    CPUSPARCState *env = opaque;
+    SPARCCPU *cpu = opaque;
+    CPUSPARCState *env = &cpu->env;
 
     if (level) {
         trace_sun4m_cpu_set_irq_raise(irq);
@@ -828,7 +829,7 @@  static void cpu_devinit(const char *cpu_model, unsigned int id,
         qemu_register_reset(secondary_cpu_reset, cpu);
         env->halted = 1;
     }
-    *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, env, MAX_PILS);
+    *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS);
     env->prom_addr = prom_addr;
 }