|
@@ -239,15 +239,8 @@ static const VMStateDescription goldfish_rtc_vmstate = {
|
|
static void goldfish_rtc_reset(DeviceState *dev)
|
|
static void goldfish_rtc_reset(DeviceState *dev)
|
|
{
|
|
{
|
|
GoldfishRTCState *s = GOLDFISH_RTC(dev);
|
|
GoldfishRTCState *s = GOLDFISH_RTC(dev);
|
|
- struct tm tm;
|
|
|
|
|
|
|
|
timer_del(s->timer);
|
|
timer_del(s->timer);
|
|
-
|
|
|
|
- qemu_get_timedate(&tm, 0);
|
|
|
|
- s->tick_offset = mktimegm(&tm);
|
|
|
|
- s->tick_offset *= NANOSECONDS_PER_SECOND;
|
|
|
|
- s->tick_offset -= qemu_clock_get_ns(rtc_clock);
|
|
|
|
- s->tick_offset_vmstate = 0;
|
|
|
|
s->alarm_next = 0;
|
|
s->alarm_next = 0;
|
|
s->alarm_running = 0;
|
|
s->alarm_running = 0;
|
|
s->irq_pending = 0;
|
|
s->irq_pending = 0;
|
|
@@ -258,6 +251,7 @@ static void goldfish_rtc_realize(DeviceState *d, Error **errp)
|
|
{
|
|
{
|
|
SysBusDevice *dev = SYS_BUS_DEVICE(d);
|
|
SysBusDevice *dev = SYS_BUS_DEVICE(d);
|
|
GoldfishRTCState *s = GOLDFISH_RTC(d);
|
|
GoldfishRTCState *s = GOLDFISH_RTC(d);
|
|
|
|
+ struct tm tm;
|
|
|
|
|
|
memory_region_init_io(&s->iomem, OBJECT(s),
|
|
memory_region_init_io(&s->iomem, OBJECT(s),
|
|
&goldfish_rtc_ops[s->big_endian], s,
|
|
&goldfish_rtc_ops[s->big_endian], s,
|
|
@@ -267,6 +261,11 @@ static void goldfish_rtc_realize(DeviceState *d, Error **errp)
|
|
sysbus_init_irq(dev, &s->irq);
|
|
sysbus_init_irq(dev, &s->irq);
|
|
|
|
|
|
s->timer = timer_new_ns(rtc_clock, goldfish_rtc_interrupt, s);
|
|
s->timer = timer_new_ns(rtc_clock, goldfish_rtc_interrupt, s);
|
|
|
|
+
|
|
|
|
+ qemu_get_timedate(&tm, 0);
|
|
|
|
+ s->tick_offset = mktimegm(&tm);
|
|
|
|
+ s->tick_offset *= NANOSECONDS_PER_SECOND;
|
|
|
|
+ s->tick_offset -= qemu_clock_get_ns(rtc_clock);
|
|
}
|
|
}
|
|
|
|
|
|
static const Property goldfish_rtc_properties[] = {
|
|
static const Property goldfish_rtc_properties[] = {
|