aboutsummaryrefslogtreecommitdiff
path: root/hw/sparc/leon3.c
diff options
context:
space:
mode:
authorKONRAD Frederic <frederic.konrad@adacore.com>2019-05-15 14:31:28 +0200
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-05-17 09:17:11 +0100
commitea005daec3b15f172d991f705b3526427461e15d (patch)
tree50eb47991f9f6f74f71a461a66a80cde851ecc32 /hw/sparc/leon3.c
parentbd30132cd87001af51640d5f1b5754a5dc7fbbe6 (diff)
grlib, irqmp: get rid of the old-style create function
Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/sparc/leon3.c')
-rw-r--r--hw/sparc/leon3.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index f438718794..34306937bc 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -47,6 +47,8 @@
#define MAX_PILS 16
+#define LEON3_IRQMP_OFFSET (0x80000200)
+
typedef struct ResetData {
SPARCCPU *cpu;
uint32_t entry; /* save kernel entry in case of reset */
@@ -121,6 +123,7 @@ static void leon3_generic_hw_init(MachineState *machine)
int bios_size;
int prom_size;
ResetData *reset_info;
+ DeviceState *dev;
/* Init CPU */
cpu = SPARC_CPU(cpu_create(machine->cpu_type));
@@ -135,9 +138,14 @@ static void leon3_generic_hw_init(MachineState *machine)
qemu_register_reset(main_cpu_reset, reset_info);
/* Allocate IRQ manager */
- grlib_irqmp_create(0x80000200, env, &cpu_irqs, MAX_PILS, &leon3_set_pil_in);
-
+ dev = qdev_create(NULL, TYPE_GRLIB_IRQMP);
+ qdev_prop_set_ptr(dev, "set_pil_in", leon3_set_pil_in);
+ qdev_prop_set_ptr(dev, "set_pil_in_opaque", env);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_IRQMP_OFFSET);
+ env->irq_manager = dev;
env->qemu_irq_ack = leon3_irq_manager;
+ cpu_irqs = qemu_allocate_irqs(grlib_irqmp_set_irq, dev, MAX_PILS);
/* Allocate RAM */
if (ram_size > 1 * GiB) {