mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
next-cube: introduce next_pc_init() object init function
Move initialisation of the memory regions and GPIOs from next_pc_realize() to the new next_pc_init() function. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Message-ID: <20241222130012.1013374-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
This commit is contained in:
parent
1441b8f922
commit
9364f7b875
1 changed files with 11 additions and 6 deletions
|
@ -897,20 +897,24 @@ static void next_pc_reset(DeviceState *dev)
|
|||
|
||||
static void next_pc_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
NeXTPC *s = NEXT_PC(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
/* SCSI */
|
||||
next_scsi_init(dev);
|
||||
}
|
||||
|
||||
qdev_init_gpio_in(dev, next_irq, NEXT_NUM_IRQS);
|
||||
static void next_pc_init(Object *obj)
|
||||
{
|
||||
NeXTPC *s = NEXT_PC(obj);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||
|
||||
qdev_init_gpio_in(DEVICE(obj), next_irq, NEXT_NUM_IRQS);
|
||||
|
||||
memory_region_init_io(&s->mmiomem, OBJECT(s), &next_mmio_ops, s,
|
||||
"next.mmio", 0x9000);
|
||||
memory_region_init_io(&s->scrmem, OBJECT(s), &next_scr_ops, s,
|
||||
"next.scr", 0x20000);
|
||||
|
||||
sysbus_init_mmio(sbd, &s->mmiomem);
|
||||
sysbus_init_mmio(sbd, &s->scrmem);
|
||||
|
||||
/* SCSI */
|
||||
next_scsi_init(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -971,6 +975,7 @@ static void next_pc_class_init(ObjectClass *klass, void *data)
|
|||
static const TypeInfo next_pc_info = {
|
||||
.name = TYPE_NEXT_PC,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_init = next_pc_init,
|
||||
.instance_size = sizeof(NeXTPC),
|
||||
.class_init = next_pc_class_init,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue