aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/macio/macio.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc/macio/macio.c')
-rw-r--r--hw/misc/macio/macio.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 9cc33d8f96..7f99aa0d5c 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -202,11 +202,12 @@ static int macio_oldworld_initfn(PCIDevice *d)
return 0;
}
-static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, int index)
+static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
+ int index)
{
gchar *name;
- object_initialize(ide, TYPE_MACIO_IDE);
+ object_initialize(ide, ide_size, TYPE_MACIO_IDE);
qdev_set_parent_bus(DEVICE(ide), sysbus_get_default());
memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
&ide->mem);
@@ -224,13 +225,13 @@ static void macio_oldworld_init(Object *obj)
qdev_init_gpio_out(DEVICE(obj), os->irqs, ARRAY_SIZE(os->irqs));
- object_initialize(&os->nvram, TYPE_MACIO_NVRAM);
+ object_initialize(&os->nvram, sizeof(os->nvram), TYPE_MACIO_NVRAM);
dev = DEVICE(&os->nvram);
qdev_prop_set_uint32(dev, "size", 0x2000);
qdev_prop_set_uint32(dev, "it_shift", 4);
for (i = 0; i < 2; i++) {
- macio_init_ide(s, &os->ide[i], i);
+ macio_init_ide(s, &os->ide[i], sizeof(os->ide[i]), i);
}
}
@@ -310,7 +311,7 @@ static void macio_newworld_init(Object *obj)
qdev_init_gpio_out(DEVICE(obj), ns->irqs, ARRAY_SIZE(ns->irqs));
for (i = 0; i < 2; i++) {
- macio_init_ide(s, &ns->ide[i], i);
+ macio_init_ide(s, &ns->ide[i], sizeof(ns->ide[i]), i);
}
}
@@ -321,7 +322,7 @@ static void macio_instance_init(Object *obj)
memory_region_init(&s->bar, NULL, "macio", 0x80000);
- object_initialize(&s->cuda, TYPE_CUDA);
+ object_initialize(&s->cuda, sizeof(s->cuda), TYPE_CUDA);
qdev_set_parent_bus(DEVICE(&s->cuda), sysbus_get_default());
object_property_add_child(obj, "cuda", OBJECT(&s->cuda), NULL);