summaryrefslogtreecommitdiff
path: root/hw/iommu.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-10-24 19:39:17 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-10-24 19:39:17 +0000
commit1a522e8a671f460019675075d68d8e4d6373b4c2 (patch)
tree11960f58fdf24714b9306b502c8ca61e7858bf4c /hw/iommu.c
parent49ef6c905598ebe240ccff7ab7f99fd73eee7d48 (diff)
downloadqemu-1a522e8a671f460019675075d68d8e4d6373b4c2.zip
sparc32: convert IOMMU to reset + vmsd
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/iommu.c')
-rw-r--r--hw/iommu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/iommu.c b/hw/iommu.c
index 20da7ab969..e1022f6ec5 100644
--- a/hw/iommu.c
+++ b/hw/iommu.c
@@ -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);
s->iostart = 0;
@@ -363,9 +363,8 @@ static int iommu_init1(SysBusDevice *dev)
io = cpu_register_io_memory(iommu_mem_read, iommu_mem_write, s);
sysbus_init_mmio(dev, IOMMU_NREGS * sizeof(uint32_t), io);
- vmstate_register(-1, &vmstate_iommu, s);
- qemu_register_reset(iommu_reset, s);
- iommu_reset(s);
+ iommu_reset(&s->busdev.qdev);
+
return 0;
}
@@ -373,6 +372,8 @@ static SysBusDeviceInfo iommu_info = {
.init = iommu_init1,
.qdev.name = "iommu",
.qdev.size = sizeof(IOMMUState),
+ .qdev.vmsd = &vmstate_iommu,
+ .qdev.reset = iommu_reset,
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("version", IOMMUState, version, 0),
DEFINE_PROP_END_OF_LIST(),