diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-01-20 13:05:00 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-01-30 19:14:59 +0000 |
commit | 1d84950234b2aea0f0e3e323ab35e20dbbc77bff (patch) | |
tree | 960811854d3622f6156322fd6211ddcf13493dc0 | |
parent | 0c685d2827ad591484b3ef667834a81967b5fad7 (diff) | |
download | qemu-1d84950234b2aea0f0e3e323ab35e20dbbc77bff.zip qemu-1d84950234b2aea0f0e3e323ab35e20dbbc77bff.tar.gz qemu-1d84950234b2aea0f0e3e323ab35e20dbbc77bff.tar.bz2 |
m48t59: use rtc_clock for alarm timer
This lets the RTC get adjustments from the host NTP client.
The watchdog still uses the vm_clock. The previous behavior is
available with "-rtc clock=vm".
Cc: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | hw/m48t59.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/m48t59.c b/hw/m48t59.c index 262cfb8..bd610f0 100644 --- a/hw/m48t59.c +++ b/hw/m48t59.c @@ -126,7 +126,7 @@ static void alarm_cb (void *opaque) /* Repeat once a second */ next_time = 1; } - qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(vm_clock) + + qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(rtc_clock) + next_time * 1000); qemu_set_irq(NVRAM->IRQ, 0); } @@ -687,7 +687,7 @@ static void m48t59_init_common(M48t59State *s) { s->buffer = g_malloc0(s->size); if (s->type == 59) { - s->alrm_timer = qemu_new_timer_ns(vm_clock, &alarm_cb, s); + s->alrm_timer = qemu_new_timer_ns(rtc_clock, &alarm_cb, s); s->wd_timer = qemu_new_timer_ns(vm_clock, &watchdog_cb, s); } qemu_get_timedate(&s->alarm, 0); |