From c29646009a6a5428cf13600281f7d51eba9e8458 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Wed, 28 Feb 2018 20:32:36 +0000 Subject: heathrow: change heathrow_pic_init() to return the heathrow device This enables the device to be made available during the setup of the Old World machine. In order to pass back the previous set of IRQs we temporarily introduce a new pic_irqs parameter until it can be removed. An additional benefit of this change is that it is also possible to remove the pic_mem pointer used for macio by accessing the memory region via sysbus. Signed-off-by: Mark Cave-Ayland Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/intc/heathrow_pic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'hw/intc/heathrow_pic.c') diff --git a/hw/intc/heathrow_pic.c b/hw/intc/heathrow_pic.c index 5fd2b33a12..393fdd7326 100644 --- a/hw/intc/heathrow_pic.c +++ b/hw/intc/heathrow_pic.c @@ -170,13 +170,15 @@ static void heathrow_reset(DeviceState *d) static void heathrow_init(Object *obj) { HeathrowState *s = HEATHROW(obj); + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); memory_region_init_io(&s->mem, OBJECT(s), &heathrow_ops, s, "heathrow-pic", 0x1000); + sysbus_init_mmio(sbd, &s->mem); } -qemu_irq *heathrow_pic_init(MemoryRegion **pmem, - int nb_cpus, qemu_irq **irqs) +DeviceState *heathrow_pic_init(int nb_cpus, qemu_irq **irqs, + qemu_irq **pic_irqs) { DeviceState *d; HeathrowState *s; @@ -188,9 +190,9 @@ qemu_irq *heathrow_pic_init(MemoryRegion **pmem, /* only 1 CPU */ s->irqs = irqs[0]; - *pmem = &s->mem; + *pic_irqs = qemu_allocate_irqs(heathrow_set_irq, s, HEATHROW_NUM_IRQS); - return qemu_allocate_irqs(heathrow_set_irq, s, HEATHROW_NUM_IRQS); + return d; } static void heathrow_class_init(ObjectClass *oc, void *data) -- cgit v1.2.3