aboutsummaryrefslogtreecommitdiff
path: root/hw/slavio_timer.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-10-24 17:35:13 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-10-24 17:35:13 +0000
commit0e0bfeea68e44a575708090bc6c6281c44c37425 (patch)
treeb0ddd2f29de53c55d82ae2cdf79e2dc0d6fd4df3 /hw/slavio_timer.c
parent2be378332830939e5367a48926a13f833592c72c (diff)
downloadqemu-0e0bfeea68e44a575708090bc6c6281c44c37425.zip
qemu-0e0bfeea68e44a575708090bc6c6281c44c37425.tar.gz
qemu-0e0bfeea68e44a575708090bc6c6281c44c37425.tar.bz2
sparc32: convert slavio_timer to reset + vmsd
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/slavio_timer.c')
-rw-r--r--hw/slavio_timer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c
index b745a4b..b2f8aab 100644
--- a/hw/slavio_timer.c
+++ b/hw/slavio_timer.c
@@ -362,9 +362,9 @@ static const VMStateDescription vmstate_slavio_timer = {
}
};
-static void slavio_timer_reset(void *opaque)
+static void slavio_timer_reset(DeviceState *d)
{
- SLAVIO_TIMERState *s = opaque;
+ SLAVIO_TIMERState *s = container_of(d, SLAVIO_TIMERState, busdev.qdev);
unsigned int i;
CPUTimerState *curr_timer;
@@ -411,9 +411,8 @@ static int slavio_timer_init1(SysBusDevice *dev)
sysbus_init_irq(dev, &s->cputimer[i].irq);
}
- vmstate_register(-1, &vmstate_slavio_timer, s);
- qemu_register_reset(slavio_timer_reset, s);
- slavio_timer_reset(s);
+ slavio_timer_reset(&s->busdev.qdev);
+
return 0;
}
@@ -421,6 +420,8 @@ static SysBusDeviceInfo slavio_timer_info = {
.init = slavio_timer_init1,
.qdev.name = "slavio_timer",
.qdev.size = sizeof(SLAVIO_TIMERState),
+ .qdev.vmsd = &vmstate_slavio_timer,
+ .qdev.reset = slavio_timer_reset,
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("num_cpus", SLAVIO_TIMERState, num_cpus, 0),
DEFINE_PROP_END_OF_LIST(),