mirror of https://github.com/xemu-project/xemu.git
hw/arm: QOM'ify armv7m.c
Drop the use of old SysBus init function and use instance_init Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
6459b94c26
commit
3f5ab25490
|
@ -132,14 +132,14 @@ typedef struct {
|
||||||
uint32_t base;
|
uint32_t base;
|
||||||
} BitBandState;
|
} BitBandState;
|
||||||
|
|
||||||
static int bitband_init(SysBusDevice *dev)
|
static void bitband_init(Object *obj)
|
||||||
{
|
{
|
||||||
BitBandState *s = BITBAND(dev);
|
BitBandState *s = BITBAND(obj);
|
||||||
|
SysBusDevice *dev = SYS_BUS_DEVICE(obj);
|
||||||
|
|
||||||
memory_region_init_io(&s->iomem, OBJECT(s), &bitband_ops, &s->base,
|
memory_region_init_io(&s->iomem, obj, &bitband_ops, &s->base,
|
||||||
"bitband", 0x02000000);
|
"bitband", 0x02000000);
|
||||||
sysbus_init_mmio(dev, &s->iomem);
|
sysbus_init_mmio(dev, &s->iomem);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void armv7m_bitband_init(void)
|
static void armv7m_bitband_init(void)
|
||||||
|
@ -244,9 +244,7 @@ static Property bitband_properties[] = {
|
||||||
static void bitband_class_init(ObjectClass *klass, void *data)
|
static void bitband_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
|
||||||
|
|
||||||
k->init = bitband_init;
|
|
||||||
dc->props = bitband_properties;
|
dc->props = bitband_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,6 +252,7 @@ static const TypeInfo bitband_info = {
|
||||||
.name = TYPE_BITBAND,
|
.name = TYPE_BITBAND,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(BitBandState),
|
.instance_size = sizeof(BitBandState),
|
||||||
|
.instance_init = bitband_init,
|
||||||
.class_init = bitband_class_init,
|
.class_init = bitband_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue