qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hw/unicore32/puv3: Simplify puv3_soc_init()


From: Philippe Mathieu-Daudé
Subject: [PATCH] hw/unicore32/puv3: Simplify puv3_soc_init()
Date: Fri, 21 Feb 2020 17:23:25 +0100

Since commit d8ed887bdc, the puv3_intc_cpu_handler handler takes
a pointer to UniCore32CPU in its opaque argument.  Directly pass
the cpu pointer.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 hw/unicore32/puv3.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 7e933de228..eec7f561eb 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -48,7 +48,7 @@ static void puv3_intc_cpu_handler(void *opaque, int irq, int 
level)
     }
 }
 
-static void puv3_soc_init(CPUUniCore32State *env)
+static void puv3_soc_init(UniCore32CPU *cpu)
 {
     qemu_irq cpu_intc, irqs[PUV3_IRQS_NR];
     DeviceState *dev;
@@ -56,8 +56,7 @@ static void puv3_soc_init(CPUUniCore32State *env)
     int i;
 
     /* Initialize interrupt controller */
-    cpu_intc = qemu_allocate_irq(puv3_intc_cpu_handler,
-                                 env_archcpu(env), 0);
+    cpu_intc = qemu_allocate_irq(puv3_intc_cpu_handler, cpu, 0);
     dev = sysbus_create_simple("puv3_intc", PUV3_INTC_BASE, cpu_intc);
     for (i = 0; i < PUV3_IRQS_NR; i++) {
         irqs[i] = qdev_get_gpio_in(dev, i);
@@ -131,7 +130,7 @@ static void puv3_init(MachineState *machine)
     cpu = UNICORE32_CPU(cpu_create(machine->cpu_type));
     env = &cpu->env;
 
-    puv3_soc_init(env);
+    puv3_soc_init(cpu);
     puv3_board_init(env, ram_size);
     puv3_load_kernel(kernel_filename);
 }
-- 
2.21.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]