提交 1a522e8a 编写于 作者: B Blue Swirl

sparc32: convert IOMMU to reset + vmsd

Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 49ef6c90
...@@ -340,9 +340,9 @@ static const VMStateDescription vmstate_iommu = { ...@@ -340,9 +340,9 @@ static const VMStateDescription vmstate_iommu = {
} }
}; };
static void iommu_reset(void *opaque) static void iommu_reset(DeviceState *d)
{ {
IOMMUState *s = opaque; IOMMUState *s = container_of(d, IOMMUState, busdev.qdev);
memset(s->regs, 0, IOMMU_NREGS * 4); memset(s->regs, 0, IOMMU_NREGS * 4);
s->iostart = 0; s->iostart = 0;
...@@ -363,9 +363,8 @@ static int iommu_init1(SysBusDevice *dev) ...@@ -363,9 +363,8 @@ static int iommu_init1(SysBusDevice *dev)
io = cpu_register_io_memory(iommu_mem_read, iommu_mem_write, s); io = cpu_register_io_memory(iommu_mem_read, iommu_mem_write, s);
sysbus_init_mmio(dev, IOMMU_NREGS * sizeof(uint32_t), io); sysbus_init_mmio(dev, IOMMU_NREGS * sizeof(uint32_t), io);
vmstate_register(-1, &vmstate_iommu, s); iommu_reset(&s->busdev.qdev);
qemu_register_reset(iommu_reset, s);
iommu_reset(s);
return 0; return 0;
} }
...@@ -373,6 +372,8 @@ static SysBusDeviceInfo iommu_info = { ...@@ -373,6 +372,8 @@ static SysBusDeviceInfo iommu_info = {
.init = iommu_init1, .init = iommu_init1,
.qdev.name = "iommu", .qdev.name = "iommu",
.qdev.size = sizeof(IOMMUState), .qdev.size = sizeof(IOMMUState),
.qdev.vmsd = &vmstate_iommu,
.qdev.reset = iommu_reset,
.qdev.props = (Property[]) { .qdev.props = (Property[]) {
DEFINE_PROP_HEX32("version", IOMMUState, version, 0), DEFINE_PROP_HEX32("version", IOMMUState, version, 0),
DEFINE_PROP_END_OF_LIST(), DEFINE_PROP_END_OF_LIST(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册