Revision 4721c457
b/hw/mc146818rtc.c | ||
---|---|---|
206 | 206 |
static void rtc_update_second(void *opaque) |
207 | 207 |
{ |
208 | 208 |
RTCState *s = opaque; |
209 |
int64_t delay; |
|
209 | 210 |
|
210 | 211 |
/* if the oscillator is not in normal operation, we do not update */ |
211 | 212 |
if ((s->cmos_data[RTC_REG_A] & 0x70) != 0x20) { |
... | ... | |
218 | 219 |
/* update in progress bit */ |
219 | 220 |
s->cmos_data[RTC_REG_A] |= REG_A_UIP; |
220 | 221 |
} |
222 |
/* should be 244 us = 8 / 32768 seconds, but currently the |
|
223 |
timers do not have the necessary resolution. */ |
|
224 |
delay = (ticks_per_sec * 1) / 100; |
|
225 |
if (delay < 1) |
|
226 |
delay = 1; |
|
221 | 227 |
qemu_mod_timer(s->second_timer2, |
222 |
s->next_second_time + (ticks_per_sec * 99) / 100);
|
|
228 |
s->next_second_time + delay);
|
|
223 | 229 |
} |
224 | 230 |
} |
225 | 231 |
|
Also available in: Unified diff